Main Content

Pixy2 Vision Sensor

Represent connected CMUcam5 Pixy2 vision sensor and tracks object (color blob)

Since R2020a

Add-On Required: This feature requires the Simulink Support Package for LEGO MINDSTORMS EV3 Hardware add-on.

  • Pixy2 Vision Sensor block

Libraries:
Simulink Support Package for LEGO MINDSTORMS EV3 Hardware

Description

The Pixy2 Vision Sensor block allows you to extend the capabilities of the LEGO® MINDSTORMS® EV3 hardware and reads the coordinates of object (color blobs) detected by the Pixy2 vision sensor.

Note

This block supports Pixy2 LEGO firmware version 3.0.14.

Functional Modes

Pixy2 Vision Sensor block has four functional modes:

  • Color Signature: Detects object that matches the configured color signature in the PixyMon utility.

  • Color Code Signature: Detects object that matches the configured color-coded signature in the PixyMon utility.

  • Color and Color Code Signature (Mixed): Detects object that matches the configured color and color-coded signature in the PixyMon utility.

  • Line: Detects and tracks the line.

Launch PixyMon

If you have already installed the support package for LEGO MINDSTORMS EV3 hardware and followed the additional hardware setup as mentioned in Install Support for LEGO MINDSTORMS EV3 Hardware, the PixyMon utility will launch automatically.

Ports

Output

expand all

The x-location of the center of the most significant object (color blob) based on the field of view, as detected by the Pixy2 vision sensor.

Dependencies

To enable this port , set the Tracking mode parameter to either Color Signature, Color Code Signature, or Color and Color Code Signature (Mixed).

Data Types: uint16

The y-location of the center of the most significant object (color blob) based on the field of view, as detected by the Pixy2 vision sensor.

Dependencies

To enable this port , set the Tracking mode parameter to either Color Signature, Color Code Signature, or Color and Color Code Signature (Mixed).

Data Types: uint16

The width of the most significant object (color blob) based on the field of view, as detected by the Pixy2 vision sensor.

Dependencies

To enable this port , set the Tracking mode parameter to either Color Signature, Color Code Signature, or Color and Color Code Signature (Mixed).

Data Types: uint16

The height of the most significant object (color blob) based on the field of view, as detected by the Pixy2 vision sensor.

Dependencies

To enable this port , set the Tracking mode parameter to either Color Signature, Color Code Signature, or Color and Color Code Signature (Mixed).

Data Types: uint16

The number of objects (color blobs) based on the field of view, as detected by the Pixy2 vision sensor.

Dependencies

To enable this port , set the Tracking mode parameter to either Color Signature, Color Code Signature, or Color and Color Code Signature (Mixed).

Data Types: uint8

The signature of the color or color-coded objects (color blobs) based on the field of view, as detected by the Pixy2 vision sensor.

Dependencies

To enable this port , set the Tracking mode parameter to either Color Code Signature or Color and Color Code Signature (Mixed).

Data Types: uint16

The angle of the color or color-coded signature of objects (color blobs) based on the field of view, as detected by the Pixy2 vision sensor.

Dependencies

To enable this port , set the Tracking mode parameter to Color and Color Code Signature (Mixed).

Data Types: int16

The starting point of the x-coordinate of the most significant line based on the field of view, as detected by the Pixy2 vision sensor.

Dependencies

To enable this port , set the Tracking mode parameter to Line.

Data Types: uint16

The starting point of the y-coordinate of the most significant line based on the field of view, as detected by the Pixy2 vision sensor.

Dependencies

To enable this port , set the Tracking mode parameter to Line.

Data Types: uint16

The ending point of the x-coordinate of the most significant line based on the field of view, as detected by the Pixy2 vision sensor.

Dependencies

To enable this port , set the Tracking mode parameter to Line.

Data Types: uint16

The ending point of the y-coordinate of the most significant line based on the field of view, as detected by the Pixy2 vision sensor.

Dependencies

To enable this port , set the Tracking mode parameter to Line.

Data Types: uint16

The presence of intersecting lines in the field of view of the Pixy2 vision sensor. 1 indicates the presence of intersecting lines.

Dependencies

To enable this port , set the Tracking mode parameter to Line.

Data Types: uint8

Parameters

expand all

Select the input port on the LEGO MINDSTORMS EV3 hardware to which the Pixy2 vision sensor is connected. There are four ports on the hardware and you can select any one of the ports. Specify a unique input port for each Pixy2 Vision Sensor block in the model.

Enter the hexadecimal address of the I2C bus connected to the Pixy2 vision Sensor. Ensure that the same I2C address is configured in the PixyMon utility.

Select the tracking mode to detect the object that matches the configured color or color-coded signature in the PixyMon utility. The xy-coordinates, width, and height of the detected object remain the same for the Color Signature, Color Code Signature, and Color and Color Code Signature (Mixed) tracking modes.

Select the color signature of the object to be tracked as configured in the PixyMon utility. Select ALL to track all the configured color signatures.

Enter the time interval at which the block reads values from the Pixy2 vision sensor.

Version History

Introduced in R2020a