Vision Sensor#

Introduction#

The Vision Sensor is a camera-based sensor that can detect and track Color Signatures and Color Codes. It allows a robot to analyze its surroundings and respond to visual input.

Below is a list of all blocks:

Actions — Capture data from the Vision Sensor for a selected object type.

Settings — Choose which object to interact with.

Values — Access and use the captured data.

Actions#

take vision snapshot#

The take vision snapshot stack block will capture the current image from the Vision Sensor to be processed and analyzed for color signatures or color codes.

Color signatures and color codes must be configured first in the Vision Sensor Utility before they can be used with this block.

Note: A snapshot is required first before using any other Vision Sensor blocks.

The dataset stores objects ordered from largest to smallest by width, starting at index 0. Each object’s properties can be accessed using the vision object property block. An empty dataset is reported if no matching objects are detected.

    take a [Vision1 v] snapshot of [SELECT_A_SIG v]

Parameter

Description

vision sensor

The Vision Sensor to use, configured in the Devices window.

signature

Filters the dataset to only include data of the given signature. Available signatures are:

  • NAME - A color signature or color code where NAME is the name configured in the Vision Sensor Utility

Settings#

set vision object index#

The set vision object index stack block sets which item in the dataset to use.

    set [Vision1 v] object index to [1]

Parameter

Description

vision sensor

The Vision Sensor to use, configured in the Devices window.

index

The number of the item in the dataset to use.

Values#

vision object exists#

The vision object exists Boolean block reports whether a specified color signature or color code is detected in the dataset.

  • True — The dataset includes a color signature or color code.

  • False — The dataset does not include a color signature or color code.

    <[Vision1 v] object exists?>

Parameters

Description

vision sensor

The Vision Sensor to use, configured in the Devices window.

vision object count#

The vision object count reporter block reports the number of detected objects in the dataset as a whole number.

    ([Vision1 v] object count)

Parameters

Description

vision sensor

The Vision Sensor to use, configured in the Devices window.

vision object property#

There are five properties that are included with each object (shown below) stored after the take vision snapshot block is used.

    ([Vision1 v] object [width v])

All property values describe the detected object’s position and size in the Vision Sensor’s view at the moment the take vision snapshot block was used. These values are measured in pixels, based on the sensor’s 316 by 212 pixel resolution.

Parameter

Description

vision sensor

The Vision Sensor to use, configured in the Devices window.

property

Which property of the detected object to use:

width#

The width property reports the width of the detected color signature in pixels as a whole number from 0 to 316.

The Vision object property stack block with its parameter set to width.#
  [Vision1 v] object [width v]

height#

The height property reports the height of the detected color signature in pixels as a whole number from 0 to 212.

The Vision object property stack block with its parameter set to height.#
  [Vision1 v] object [height v]

centerX#

The centerX property reports the x-coordinate of the center of the detected color signature in pixels as a whole number from 0 to 316.

The Vision object property stack block with its parameter set to centerX.#
  [Vision1 v] object [centerX v]

centerY#

The centerY property reports the y-coordinate of the center of the detected color signature in pixels as a whole number from 0 to 212.

The Vision object property stack block with its parameter set to centerY.#
  [Vision1 v] object [centerY v]

angle#

The angle property reports the orientation of the detected color code as a whole number in degrees from 0 to 359.

Note: The angle property can only be used with color codes.

The Vision object property stack block with its parameter set to angle.#
  [Vision1 v] object [angle v]