Camera#

Introduction#

The VEX AIR Drone includes two Vision Sensors that serve as its onboard cameras—one on the front and one on the bottom. These can capture both images and video during flight. In VEXcode AIR, the word “camera” always refers to one of these Vision Sensors. For instance, when forward and downward cameras are parameter options, they are referring to the forward facing Vision Sensor and the downward facing Vision Sensor.

To transfer video recordings and images from the VEX AIR Drone Controller, connect the controller to your computer. It will appear as a mass-storage device (similar to a USB drive), allowing you to copy files directly. After ending a project, wait about a minute for the controller to finish downloading any images or recordings from the drone before attempting to copy them.

Below is a list of available blocks:

Video

Overlay

Capture

Video#

show / hide camera video on screen#

The show / hide camera video on screen stack block shows or hides the feed of the specified Vision Sensor.

move forward stack block#
    [show v] [forward v] camera video on screen

Parameters

Description

state

The state of the Vision Sensor’s feed: show or hide.

camera

Which Vision Sensor’s feed to use: forward or downward.

Examples

    when started
    [Switch camera feeds after 3 seconds.]
    [show v] [downward v] camera video on screen
    wait (3) seconds
    [show v] [forward v] camera video on screen

    when started
    [Hide camera feed after 3 seconds.]
    [show v] [forward v] camera video on screen
    wait (3) seconds
    [hide v] [forward v] camera video on screen

Overlay#

overlay reticle on video#

The overlay reticle on video stack block shows or hides the reticle overlay. A reticle is a visual marker, like a crosshair, that appears in the camera’s view to help with aiming or aligning objects.

By default, the reticle overlay is shown at the start of a project, only on the downward Vision Sensor.

move forward stack block#
    overlay [show v] reticle on video

Parameters

Description

state

The state of the overlay reticle: show or hide.

Example

    when started
    [Hide the reticle when not aligning to a landing area.]
    [show v] [downward v] camera video on screen
    take off to [500] [mm v] ▶
    overlay [hide v] reticle on video
    forever
    move with controller

overlay telemetry on video#

The overlay telemetry on video stack block enables or disables the visibility of telemetry data on the controller’s screen. Telemetry is live data from the drone while it is flying or running a project.

By default, the telemetry data overlay is shown at the start of a project.

move forward stack block#
    overlay [show v] telemetry on video

Parameters

Description

state

The state of the telemetry data: show or hide.

Example

    when started
    [Clear the camera video for better visibility.]
    [show v] [forward v] camera video on screen
    take off to [500] [mm v] ▶
    overlay [hide v] telemetry on video
    forever
    move with controller

Capture#

start recording on camera#

The start recording on camera stack block starts a recording with the specified Vision Sensor.

For information about viewing and retrieving recordings, go here.

Note: To save a recording, use the stop recording on camera block before ending the project.

move forward stack block#
    start recording on [forward v] camera

Parameters

Description

camera

The Vision Sensor to record with: forward or downward.

Example

    when started
    [Record a video as you fly around!]
    [show v] [forward v] camera video on screen
    take off to [500] [mm v] ▶
    start recording on [forward v] camera
    forever
    move with controller

    when controller button [7 v] [pressed v]
    [Press button 7 to end recording.]
    stop recording on [forward v] camera
    land ▶

stop recording on camera#

The stop recording on camera stack block stops the recording of the specified Vision Sensor.

For information about viewing and retrieving recordings, go here.

move forward stack block#
    stop recording on [forward v] camera

Parameters

Description

camera

The Vision Sensor to stop recording with: forward or downward.

Example

    when started
    [Record a video as you fly around!]
    [show v] [forward v] camera video on screen
    take off to [500] [mm v] ▶
    start recording on [forward v] camera
    forever
    move with controller

    when controller button [7 v] [pressed v]
    [Press button 7 to end recording.]
    stop recording on [forward v] camera
    land ▶

capture image on camera#

The capture image on camera stack block takes a picture with the specified Vision Sensor.

For information about viewing and retrieving captured images, go here.

move forward stack block#
    capture image on [forward v] camera

Parameters

Description

camera

The Vision Sensor to take a picture with: forward or downward.

Example

    when started
    [Take pictures while you control the drone.]
    [show v] [forward v] camera video on screen
    take off to [500] [mm v] ▶
    forever
    move with controller
    
    when controller button [5 v] [pressed v]
    [Use button 5 to take pictures.]
    capture image on [forward v] camera

is camera recording#

The is camera recording Boolean block reports whether the specified Vision Sensor is currently recording.

  • True — The Vision Sensor is recording.

  • False — The Vision Sensor is not recording.

move forward stack block#
    <is [forward v] camera recording?>

Parameters

Description

camera

The Vision Sensor to check the recording status of: forward or downward.

Example

    when started
    [Make video recordings while you control the drone.]
    [show v] [forward v] camera video on screen
    take off to [500] [mm v] ▶
    forever
    move with controller
    
    when controller button [7 v] [pressed v]
    [Use button 7 to start and stop recording.]
    if <is [forward v] camera recording?> then
    stop recording on [forward v] camera
    else
    start recording on [forward v] camera