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
show / hide camera video on screen - Shows or hides a specified Vision Sensor feed on the controller screen.
Overlay
overlay reticle on video - Shows or hides the reticle overlay on the downward Vision Sensor.
overlay telemetry on video - Shows or hides the telemetry data overlay.
Capture
start recording on camera - Records a video from a Vision Sensor.
stop recording on camera - Stops recording a video from a Vision Sensor.
capture image on camera - Captures an image from a Vision Sensor.
is camera recording? - Returns whether the Vision Sensor is recording.
Video#
show / hide camera video on screen#
The show / hide camera video on screen block shows or hides the feed of the specified Vision Sensor.
[show v] [forward v] camera video on screen
Parameters |
Description |
|---|---|
state |
The state of the Vision Sensor’s feed:
|
camera |
Which Vision Sensor’s feed to use:
|
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 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.
overlay [show v] reticle on video
Parameters |
Description |
|---|---|
state |
The state of the overlay reticle:
|
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 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.
overlay [show v] telemetry on video
Parameters |
Description |
|---|---|
state |
The state of the telemetry data:
|
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 block starts a recording with the specified Vision Sensor.
For information about viewing and retrieving recordings, go here.
Note: A recording will not be saved if the stop recording on camera block is not used.
start recording on [forward v] camera
Parameters |
Description |
|---|---|
camera |
The Vision Sensor to record with:
|
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 block stops the recording of the specified Vision Sensor.
For information about viewing and retrieving recordings, go here.
stop recording on [forward v] camera
Parameters |
Description |
|---|---|
camera |
The Vision Sensor to stop recording with:
|
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 block takes a picture with the specified Vision Sensor.
For information about viewing and retrieving captured images, go here.
capture image on [forward v] camera
Parameters |
Description |
|---|---|
camera |
The Vision Sensor to take a picture with:
|
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? block returns a Boolean indicating whether the specified Vision Sensor is currently recording.
True — The Vision Sensor is recording.
False — The Vision Sensor is not recording.
<is [forward v] camera recording?>
Parameters |
Description |
|---|---|
camera |
The Vision Sensor to check the recording status of:
|
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