Putting It All Together: Programming Robotics Peripheral Vision
Let the coding begin!Copyright 2004 Microsoft Corporation, One Microsoft Way, Redmond, WA 98052-6399 USA. All rights reserved.
In this culminating activity of the unit, students bring together everything they've learned in order to write the code to solve the Grand Challenge. The code solution takes two images captured by robots and combines them to create an image that can be focused at different distances, similar to the way that humans can focus either near or far. They write in a derivative of C++ called QT; all code is listed in this activity.
For a robot to be useful, software must be written to enable it to perform its functions. This is one of the main phases in the design and construction of robots. In this activity, students write the software for their hypothetical robot. In a real-life situation, computer programmers would work closely with electrical and computer engineers in designing the software for the robot to function as intended.
After this activity, students should be able to:
- Initialize a two-dimensional array.
- Initialize a new instance of a vector class.
- Store RGB values in a vector.
- Read data from the vector and write it to a new image.
- Create, compile and test code that addresses the Grand Challenge.
- Explain how this code writing process is similar to what a computer science engineer "does."
Tennessee State Standards for C++ Programming Applications (2005)
- Standard 5.0 - The student will write and document an executable program in C++ programming language.
- Use computers and calculators to access, retrieve, organize, process, maintain, interpret, and evaluate data and information in order to communicate.
Grades 9-12
Do you agree with this alignment? - STEL-8N Use various approaches to communicate processes and procedures for using, maintaining, and assessing technological products and systems.
Grades 9-12
Do you agree with this alignment?
- HS-ETS1-4 Use a computer simulation to model the impact of proposed solutions to a complex real-world problem with numerous criteria and constraints on interactions within and between systems relevant to the problem.
Grades 9-12
This resource focuses on the following Three Dimensional Learning aspects of NGSS:
Science & Engineering Practices- Use mathematical models and/or computer simulations to predict the effects of a design solution on systems and/or the interactions between systems.Do you agree with this alignment?
Disciplinary Core Ideas- Both physical models and computers can be used in various ways to aid in the engineering design process. Computers are useful for a variety of purposes, such as running simulations to test different ways of solving a problem or to see which one is most efficient or economical; and in making a persuasive presentation to a client about how a given design will meet his or her needs.Do you agree with this alignment?
Crosscutting Concepts- Models (e.g., physical, mathematical, computer models) can be used to simulate systems and interactions—including energy, matter, and information flows—within and between systems at different scales.Do you agree with this alignment?
Do you agree with this alignment? - Use mathematical models and/or computer simulations to predict the effects of a design solution on systems and/or the interactions between systems.
Each group needs access to a computer and supporting software (QT) for writing code.:
Familiarity with QT and the basic functions within the QT libraries imageloader, QtGui, QString, cmath and QVector.
In this activity, you will take all the lessons taught up to this point and combine the knowledge and skills you have gained to write the code that provides a solution to the Grand Challenge. This will fulfill the "research and revise" and "test your mettle" steps of the Legacy Cycle as you learn about the coding, write it yourself, test your program by running it, and revise until it is functional. Finally, being able to show your functioning program meets the "go public" stage of the Legacy Cycle as we finally answer the Grand Challenge.
Let's recall the Grand Challenge: "The Wall-e robotics firm thinks it has a unique and novel solution for getting a broader spectrum of usable data. Instead of using a single camera, they mounted on the top of the robot two cameras at different focal lengths. The first camera provides an up-close and detailed image (however, this image lacks surrounding data) and the second camera provides a broader view with less detail. However, they need this data to be usable by a humans. Right now a person must look at two separate pictures. Could you somehow combine those images to simulate how a human's vision would focus in and out of the two focal lengths? How would you accomplish this task?"
You will write the code in QT, a language similar to C++. Let the coding begin!
Before the Activity
- Arrange for the necessary computer and software access for six class periods.
- Make sure that the computers are working.
With the Students
- Present the Introduction/Motivation content to the class.
- Have students list the concepts they now understand that will help them write the code. Expect these to include information about vision, lenses, digital images, color formats and arrays, as well as concepts such as focal length, foveal vision, peripheral vision, pixel, RGB, hexadecimal and subscript. Indicate that this is the sort of background information software engineers and computer science engineers might need to learn about if they were given the Grand Challenge as an engineering project. Tell students that they will be performaing as computer science engineers as they write a code solution.
- Remind students of the time limitations for this activity. Give them six class periods to write code, test it and deploy the program.
- Remind students of the Learning Objectives (write them on the classroom board or a place where they can easily see them throughout the activity).
- Divide the class into groups of three students each. Oversee and guide the students to write, test and improve until they obtain a functioning code solution.
- code
- File(s) of statements written in one of many human-readable programming languages that are used to manipulate computers to perform many different actions.
- qt
- A coding application that runs off an enriched version of C++.
Functioning Code: Assess student groups on the success of their completed programs. See the Suggested Program Code Solution (PDF) for a programming solution algorithm that students should work towards developing.
"Programming Code." Last updated June 20, 2010. Wikipedia, The Free Encyclopedia. Accessed June 20, 2010. http://en.wikipedia.org/wiki/Programming_code
- Robotics Peripheral Vision
- The Grand Challenge: Simulating Human Vision
- What Makes Up a Color?
- How Do You Store All This Data?
- Putting It All Together: Programming Robotics Peripheral Vision
Contributors
Mark Gonyea; Anna Goncharova; Rachelle Klinger
Supporting Program
VU Bioengineering RET Program, School of Engineering, Vanderbilt University
Acknowledgements
The contents of this digital library curriculum were developed under National Science Foundation RET grant nos. 0338092 and 0742871. However, these contents do not necessarily represent the policies of the NSF, and you should not assume endorsement by the federal government.
Copyright
2013 by Regents of the University of Colorado; original © 2010 Vanderbilt University
