Motion#
Introduction#
The VEX AIR Drone features four propellers, allowing it to move in any direction and rotate independently. Motion provides methods for movement, turning, speed adjustments, and position tracking.
Below is a list of available blocks:
Actions – Move and turn the drone.
take off - Lifts the drone to a specified height.
land - Lands the drone.
hover - Keeps the drone at its position.
climb - Moves the drone in a specified vertical direction.
climb for - Moves the drone in a specified vertical direction for a specific distance.
climb to altitude - Moves the drone to a specified altitude.
move – Moves the drone forward, reverse, left, or right.
move at angle – Moves the drone in a specified direction using an angle.
move for – Moves the drone in a specific direction for a set distance.
move at angle for – Moves the drone at a specific angle for a set distance.
turn – Rotates the drone left or right.
turn for – Rotates the drone for a specified number of degrees.
turn to heading – Rotates the drone to face a specific heading.
move with controller – Allows the drone to be driven using the controller.
Flight Control – Adjust flight settings.
set steering POV – Sets the POV for steering the drone.
set movement – Sets the movement style of the drone.
Settings – Adjust movement and turn speeds.
set climb velocity – Sets the default climbing speed.
set move velocity – Sets the default movement speed.
set turn velocity – Sets the default turning speed.
Altitude – Track and modify the drone’s maximum altitude.
altitude – Returns the drone’s altitude.
set maximum altitude - Sets the maximum altitude.
Position – Track and modify the drone’s position.
position – Returns the drone’s current x, y, or z coordinate.
set drone position – Manually sets the drone’s x, y, and z position.
Values – Check movement status.
flight state? - Returns the current state of the drone.
safe mode? - Returns the drone’s propeller lock state.
climb active? - Returns whether the drone is currently climbing.
move active? – Returns whether the drone is currently moving.
turn active? – Returns whether the drone is currently turning.
hovering? - Returns whether the drone is currently hovering.
taking off? - Returns whether the drone is currently taking off.
landing? - Returns whether the drone is currently landing.
Actions#
take off#
The take off block lifts the drone into the air.
take off to [500] mm ▶
Parameters |
Description |
---|---|
distance |
The distance the drone will fly to in millimeters. |
expanding arrow |
By default, this is a waiting block, so the drone will finish moving before running the next block. To make the drone start moving and immediately run the next block right away, expand the block to say and don’t wait. |
Example
Example coming soon!
land#
The land block lands the drone.
land ▶
Parameters |
Description |
---|---|
expanding arrow |
By default, this is a waiting block, so the drone will finish moving before running the next block. To make the drone start moving and immediately run the next block right away, expand the block to say and don’t wait. |
Example
Example coming soon!
hover#
The hover block makes the drone hover in the air.
hover
Parameters |
Description |
---|---|
This block has no parameters. |
Example
Example coming soon!
climb#
The climb block moves the drone in a specified vertical direction.
climb [up v]
Parameters |
Description |
---|---|
direction |
The direction in which the drone will fly:
|
Example
Example coming soon!
climb for#
The climb for block moves the drone in a specified vertical direction for a specific distance.
climb [up v] for (500) [mm v] ▶
Parameters |
Description |
---|---|
direction |
The direction in which the drone will fly:
|
distance |
The distance the drone will fly for. |
units |
The unit of measurement, which can be one of the following:
|
expanding arrow |
By default, this is a waiting block, so the drone will finish moving before running the next block. To make the drone start moving and immediately run the next block right away, expand the block to say and don’t wait. |
Example
Example coming soon!
climb to altitude#
The climb to altitude block moves the drone to a specific altitude.
climb to altitude [500] [mm v] ▶
Parameters |
Description |
---|---|
altitude |
The altitude, as an integer or decimal, the drone will climb to. |
units |
The unit of measurement, which can be one of the following:
|
expanding arrow |
By default, this is a waiting block, so the drone will finish moving before running the next block. To make the drone start moving and immediately run the next block right away, expand the block to say and don’t wait. |
Example
Example coming soon!
move#
The move block moves the drone in four specific directions using the current move velocity.
move [forward v]
Parameters |
Description |
---|---|
direction |
Move the drone in one of the following directions:
|
Example
Example coming soon!
move at angle#
The move at angle block moves the drone at a specified angle using the current move velocity.
move at (90) degrees ▶
Parameters |
Description |
---|---|
angle |
The angle, as an integer or decimal, at which the drone moves, ranging from 0 to 360 degrees. |
expanding arrow |
By default, this is a waiting block, so the drone will finish moving before running the next block. To make the drone start moving and immediately run the next block right away, expand the block to say and don’t wait. |
Examples
Example coming soon!
move for#
The move for block moves the drone in four specific directions for a specific distance using the current move velocity.
move [forward v] for (200) [mm v] ▶
Parameters |
Description |
---|---|
direction |
Move the drone in one of the following directions:
|
distance |
The distance, as an integer or decimal, that the drone will move. |
unit |
The unit of measurement, which can be one of the following:
|
expanding arrow |
By default, this is a waiting block, so the drone will finish moving before running the next block. To make the drone start moving and immediately run the next block right away, expand the block to say and don’t wait. |
Example
Example coming soon!
move at angle for#
The move at angle for block moves the drone at a specific angle for a specified distance using the current move velocity.
move at (45) degrees for (200) [mm v] ▶
Parameters |
Description |
---|---|
angle |
The angle, as an integer or decimal, at which the drone moves, ranging from 0 to 360 degrees. |
distance |
The distance, as an integer or decimal, that the drone will move. |
unit |
The unit of measurement, which can be one of the following:
|
expanding arrow |
By default, this is a waiting block, so the drone will finish moving before running the next block. To make the drone start moving and immediately run the next block right away, expand the block to say and don’t wait. |
Examples
Example coming soon!
turn#
The turn block turns the drone in a specific direction using the current turn velocity.
turn [right v]
Parameters |
Description |
---|---|
direction |
The direction in which the drone turns:
|
Example
Example coming soon!
turn for#
The turn for block turns the drone in a specified direction for a set distance relative to its current facing direction using the current turn velocity.
turn [right v] for (90) degrees ▶
Parameters |
Description |
---|---|
direction |
The direction in which the drone turns:
|
angle |
The angle, as an integer or decimal, at which the drone moves, ranging from 0 to 360 degrees. |
expanding arrow |
By default, this is a waiting block, so the drone will finish moving before running the next block. To make the drone start moving and immediately run the next block right away, expand the block to say and don’t wait. |
Examples
Example coming soon!
turn to heading#
The turn to heading block turns the drone to face a specific heading using the current turn velocity.
turn to heading (270) degrees ▶
Parameters |
Description |
---|---|
heading |
The heading that the drone will turn to face from 0 to 360 degrees. |
expanding arrow |
By default, this is a waiting block, so the drone will finish moving before running the next block. To make the drone start moving and immediately run the next block right away, expand the block to say and don’t wait. |
Examples
Example coming soon!
move with controller#
The move with controller block lets you drive the drone using the VEX AIR Drone Controller. To use the controller, you need to put the block inside a loop - such as a “forever” loop. If the loop stops and there are no other blocks telling the drone to move, the drone will keep going in the last direction you pushed the joystick.
move with controller
Parameters |
Description |
---|---|
This block has no parameters. |
Example
Example coming soon!
Flight Control#
set steering POV#
The set steering POV block sets the viewpoint that is used when steering the drone.
set steering POV to [standard v]
Parameters |
Description |
---|---|
style |
Sets the viewpoint that is used to steer the drone:
|
Example
Example coming soon!
set movement#
The set movement block sets the drone’s movement style.
set movement to [precision v]
Parameters |
Description |
---|---|
style |
Sets the speed that is used to steer the drone:
|
Example
Example coming soon!
Settings#
set climb velocity#
The set climb velocity block sets the default climbing speed as a percentage for all subsequent movement blocks in the project.
set climb velocity to [100] %
Parameters |
Description |
---|---|
velocity |
The velocity at which the drone will climb as a percent. |
Example
Example coming soon!
set move velocity#
The set move velocity block sets the default movement speed as a percentage for all subsequent movement blocks in the project.
set move velocity to (100)%
Parameters |
Description |
---|---|
velocity |
The velocity at which the drone will move as a percent. |
Example
Example coming soon!
set turn velocity#
Documentation Coming Soon
Altitude#
altitude#
The altitude block returns the drone’s altitude.
altitude in [mm v]
Parameters |
Description |
---|---|
units |
The unit of measurement, which can be one of the following:
|
Example
Example coming soon!
set maximum altitude#
Documentation Coming Soon
Position#
position#
The position block returns the drone’s current x, y, or z-coordinate as an integer.
[x v] position in [mm v]
Parameters |
Description |
---|---|
coordinate |
The coordinate axis, which can be one of the following:
|
unit |
The unit of measurement, which can be one of the following:
|
Example
Example coming soon!
set drone position#
The set drone position block sets the drone’s current position to specified values in millimeters (mm).
set drone position x: (0) y: (0) z: (0)
Parameters |
Description |
---|---|
x |
The x-position to set for the drone, in mm. |
y |
The y-position to set for the drone, in mm. |
z |
The z-position to set for the drone, in mm. |
Example
Example coming soon!
Values#
flight state?#
The flight state? block returns a Boolean indicating whether or not the drone is in the specified flight state.
True – The drone is in the specified state.
False – The drone is not in the specified state.
<flight state is [off v]?>
Parameters |
Description |
---|---|
state |
The drone state to check:
|
Example
Example coming soon!
safe mode?#
The safe mode? block returns a Boolean indicating whether the propeller lock is enabled on the drone.
True – Propellers are in locked.
False – Propellers are not locked.
<safe mode?>
Parameters |
Description |
---|---|
This block has no parameters. |
Example
Example coming soon!
climb active?#
The climb active? block returns a Boolean indicating whether the drone is climbing.
True – The drone is currently climbing.
False – The drone is not climbing.
<climb active?>
Parameters |
Description |
---|---|
This block has no parameters. |
Example
Example coming soon!
move active?#
The move active? block returns a Boolean indicating whether the drone is moving.
True – The drone is currently moving.
False – The drone is not moving.
<move active?>
Parameters |
Description |
---|---|
This block has no parameters. |
Example
Example coming soon!
turn active?#
The turn active? block returns a Boolean indicating whether the drone is turning.
True – The drone is currently turning.
False – The drone is not turning.
<turn active?>
Parameters |
Description |
---|---|
This block has no parameters. |
Example
Example coming soon!
hovering?#
The hovering? block returns a Boolean indicating whether the drone is hovering.
True – The drone is currently hovering.
False – The drone is not hovering.
<hovering?>
Parameters |
Description |
---|---|
This block has no parameters. |
Example
Example coming soon!
taking off?#
The taking off? block returns a Boolean indicating whether the drone is taking off.
True – The drone is currently taking off.
False – The drone is not taking off.
<taking off?>
Parameters |
Description |
---|---|
This block has no parameters. |
Example
Example coming soon!
landing?#
The landing? block returns a Boolean indicating whether the drone is landing.
True – The drone is currently landing.
False – The drone is not landing.
<landing?>
Parameters |
Description |
---|---|
This block has no parameters. |
Example
Example coming soon!