Skip to main content
Teacher Portal

Teacher Toolbox icon Teacher Toolbox

The purpose of the Vision Data Challenge is to ensure that students understand the data collected from the Vision Sensor's snapshot and how center X and Y values are calculated. Your students should also finish this lab with an understanding of how that data might be interpreted (e.g., the center X value can be used to determine where the object is relative to the center point of the robot), and best practices for naming objects when configuring.

Vision Sensor snapshot from the configuration showing a hand holding a yellow gear. A square overlay is over the gear with the following data listed above: Yellow Box, X 90, Y 62, W 102, H 98.

Complete the Vision Data Challenge by answering the questions and filling in the missing data in your engineering notebook.

  1. Which of these blocks was used to take the snapshot above?
    • VEXcode IQ take snapshot block set to Redbox
    • VEXcode IQ Take snapshot block set to Yellowbox
  2. Fill in these values:

Vision Sensor blocks listed down the left side with blank boxes to fill in with their values. From top to bottom the blocks are listed: Object exists?, object count, object center x, object center y, object width, and object height.

  1. Is YELLOWBOX to the left or to the right of the robot's center point?
  2. Is YELLOWBOX above or below the robot's center point?
  3. YELLOWBOX is NOT the best name to give this object if you want to easily recognize which color signature is which. Which of these is a better name? Why?
    • YELLOWGEAR
    • YELLOWCUBE

Teacher Toolbox icon Teacher Toolbox - Answers

Students' answers can be discussed as a class and/or you can review their engineering notebooks to ensure that they completed the activity successfully.

  1. B.

    Take snapshot block with parameter set to Yellowbox.

  2. Completed data aligned to the VEXcode blocks. Answers read, in order, objects exists = True; object count = 1; object center x = 141; object center y = 111; object width = 102; object height = 98.
  3. YELLOWBOX is slightly to the left of the robot's center point but only by a difference of 16.5 pixels (center 157.5 - 141).
  4. YELLOWBOX is slightly lower than the robot's center point but only by a difference of 5.5 pixels (111 - center 105.5).
  5. A. YELLOWGEAR
    This is a better name because it describes not only the color of the object but also the type of the object. It is a gear, not a box or cube.

Extend Your Learning icon Extend Your Learning - Use the Sensing Blocks within a Project

Now that some of the Vision Sensor's reported data is better understood, students might want to use these Sensing blocks within a project. Allow them to explore doing so.
Some students might simply add print blocks to display the values on the screen.

Code snippet showing an If then else block with the parameter set to Vision object exists. Within the If branch are print commands to print 'Green object found' and each piece of data, setting the cursor to the next row between each. Print commands read, in order, Print object count; print object center x, print object center y; print object width; and print object height. The else branch read Print 'No Green Object'.

More advanced students might use these blocks within a project to make decisions. That will require adding a drivetrain to the robot's configuration.

Code snippet showing how to use drivetrain commands with the sensor commands. The code reads: Drive forward, comment - avoid the greenbox obstacle, take a snapshot of Greenbox. Then there is and if then else block. The if branch has the condition set to object exists and object center x greater than 157.5 then turn left for 90 degrees. The else branch reads turn right for 90 degrees.