Train V5 Vision Sensor for Color Signature
The V5 Vision Sensor connected to V5 Robot Brain needs to be trained for color signatures that are saved on the sensor. The VEX Vision Utility, which helps you to train the sensor, is available as part of the installation of Simulink® Coder™ Support Package for VEX® EDR V5 Robot Brain.
Calibrate and Save Color Signature on V5 Vision Sensor
Connect the V5 Vision Sensor to the host computer using micro-USB cable.
Note
Do not hold the button on the V5 Vision Sensor while plugging in the USB cable (it triggers an unwanted Update mode).
The V5 Robot Brain does not need to be connected to the host computer or switched-on for training the V5 Vision Sensor.
In the Simulink model, open the Vision Sensor block from the Simulink model and click Launch V5 Vision Utility.
The VEX Vision Utility opens in a separate window.
Position the colored object in the field of view of the V5 Vision Sensor so that the object takes up the majority of the frame in the VEX Vision Utility.
Click and hold on one corner of the colored object, drag the cursor to the opposite corner of the object, and then release. This creates a red rectangle over the colored object.
Click Set corresponding to a particular signature (for example,
SIG_1
) to store the selection as a color signature.Click on the arrows to the right of the selected Set button, and then drag the slider that appears, to the left or right. You can do this until most area of the colored object is highlighted while the background and other objects are not highlighted.
Move the colored object within the field of view of the Vision Sensor to ensure that it is being tracked.
Save all the changes and close the VEX Vision Utility. The signatures are now saved to the V5 Vision Sensor.
Note
The V5 Vision Sensor is sensitive to different levels of illumination. You need to train the sensor again if the illumination levels change in the actual environment.
Verify Color Signature in the Deployed Model
In the Simulink model, you design the logic using the Vision Sensor block. In the block mask, ensure that you select the same color signature that is saved in the V5 Vision Sensor (using the VEX Vision Utility).
To verify the color signature:
Connect the V5 Robot Brain to the host computer.
Connect the V5 Vision Sensor to the Smart port on the V5 Robot brain (the same Smart port that is selected in the block mask of the Vision Sensor block in the Simulink model).
Deploy the Simulink model to the V5 Robot brain and run the model.
Place a colored object (which uses the same color that you used for training the sensor and saving the signature) in the field of view of the V5 Vision Sensor.
Based on the logic that you defined in the Simulink model, the robot moves according to the placement of the colored object.