Vision Sensor

Represent connected V5 Vision Sensor and read coordinates of color blobs (objects)

  • Library:
  • Simulink Coder Support Package for VEX EDR V5 Robot Brain / Sensors

Description

The Vision Sensor block represents a V5 Vision Sensor connected to a specified port on a VEX® EDR V5 Robot Brain, and reads the coordinates of color blobs (objects) detected by the V5 Vision Sensor. The color blob to detect depends on the ID of the color signature that you select in this block.

Note

To configure a color signature that you specify in the Vision Sensor block, you need to use the VEX Vision Utility. For details about saving a color signature on V5 Vision Sensor using the VEX Vision Utility, refer to the steps mentioned at this link.

Ports

Output

expand all

The number of objects (color blobs) that are detected by V5 Vision Sensor, based on the selected ID of Color signature. One Vision Sensor block can be used to detect up to 10 objects based on the selected ID.

Dependencies

This output depends on the value selected for the Maximum no. of objects parameter.

Data Types: double

The x coordinate of the color blob (object) based on the field of view, measured in pixels, as detected by V5 Vision Sensor. If multiple objects (say, n) are detected, this output is a 1-by-n array of values.

Data Types: double

The y coordinate of the color blob (object) based on the field of view, as detected by V5 Vision Sensor. If multiple objects (say, n) are detected, this output is a 1-by-n array of values.

Data Types: double

The width of the field of view of the color blob, as detected by V5 Vision Sensor. If multiple objects (say, n) are detected, this output is a 1-by-n array of values.

Data Types: double

The height of the field of view of the color blob, as detected by V5 Vision Sensor. If multiple objects (say, n) are detected, this output is a 1-by-n array of values.

Data Types: double

Parameters

expand all

Select the Smart Port on the VEX EDR V5 Robot Brain to which the V5 Vision Sensor is connected. There are 21 Smart Ports on the VEX EDR V5 Robot Brain that you can connect to V5 Vision Sensor.

Smart Port must be unique for each block in the model. If multiple Vision Sensor blocks with the same port are used, the last executed Vision Sensor block may only be active.

Select the ID of the color signature (which you configured using the VEX Vision Utility) to detect the object. The ID corresponds to the sequence of the color signature as it appears in the Vision Utility, irrespective of the name that you gave for a particular signature.

Select the maximum number of objects that the V5 Vision Sensor should try to detect based on the selected ID of Color signature.

Select this option to enable the display of objects (as detected by the V5 Vision Sensor) on the LCD screen of VEX V5 Robot Brain. The size of the color blobs displayed in the LCD screen corresponds to the distance of the objects from the V5 Vision Sensor.

Enter the time interval at which the block reads values from the V5 Vision Sensor.

When you set this parameter to -1, Simulink® determines the best sample time for the block based on the block context within the model.

Introduced in R2019b