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.

Circular compass dial from 0-360 degrees surrounding a drone with 4 propellers. The front of the drone faces 0 degrees on the compass dial.

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.

Settings – Adjust movement and turn speeds.

Altitude – Track and modify the drone’s 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.

move forward stack block#
    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.

move forward stack block#
    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.

move forward stack block#
    hover

Parameters

Description

This block has no parameters.

Example

Example coming soon!

climb#

The climb block moves the drone in a specified vertical direction.

move forward stack block#
    climb [up v]

Parameters

Description

direction

The direction in which the drone will fly:

  • up
  • down

Example

Example coming soon!

climb for#

The climb for block moves the drone in a specified vertical direction for a specific distance.

move forward stack block#
    climb [up v] for (500) [mm v] ▶

Parameters

Description

direction

The direction in which the drone will fly:

  • up
  • down

distance

The distance the drone will fly for.

units

The unit of measurement, which can be one of the following:

  • mm (millimeters)
  • inches

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.

move forward stack block#
    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:

  • mm (millimeters)
  • inches

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 stack block#
    move [forward v]

Parameters

Description

direction

Move the drone in one of the following directions:

  • forward
  • right
  • left
  • reverse

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 stack block#
    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 for 200 mm stack block#
    move [forward v] for (200) [mm v] ▶

Parameters

Description

direction

Move the drone in one of the following directions:

  • forward
  • right
  • left
  • reverse

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:

  • mm (millimeters)
  • inches

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 angle for stack block#
    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:

  • mm (millimeters)
  • inches

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 stack block#
    turn [right v] 

Parameters

Description

direction

The direction in which the drone turns:

  • right
  • left

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 for 90 degrees stack block#
    turn [right v] for (90) degrees ▶

Parameters

Description

direction

The direction in which the drone turns:

  • right
  • left

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 90 degrees stack block#
    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.

move forward stack block#
    set steering POV to [standard v]

Parameters

Description

style

Sets the viewpoint that is used to steer the drone:

  • standard – The drone moves relative to where it is facing.
  • headless – The drone moves relative to where it was facing at the start of the project.

Example

Example coming soon!

set movement#

The set movement block sets the drone’s movement style.

move forward stack block#
    set movement to [precision v]

Parameters

Description

style

Sets the speed that is used to steer the drone:

  • precision – The drone moves at a slower base speed.
  • balanced – The drone moves at a medium base speed.
  • performance – The drone moves at a faster base speed.

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.

move forward stack block#
    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 melocity to 50% stack block#
    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.

move forward stack block#
    altitude in [mm v]

Parameters

Description

units

The unit of measurement, which can be one of the following:

  • mm (millimeters)
  • inches

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 position in mm reporter block#
    [x v] position in [mm v]

Parameters

Description

coordinate

The coordinate axis, which can be one of the following:

  • x
  • y
  • z

unit

The unit of measurement, which can be one of the following:

  • mm (millimeters)
  • inches

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 position stack block#
    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.

move forward stack block#
    <flight state is [off v]?>

Parameters

Description

state

The drone state to check:

  • off – The drone is turned off.
  • calibration – The drone is calibrating its sensors.
  • motor start – The drone is starting up its motors.
  • flight ready – The drone is ready to begin flying.
  • flight – The drone is in flight.

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.

move forward stack block#
    <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.

move forward stack block#
    <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.

is move active report block#
    <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 reporter block#
    <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.

move forward stack block#
    <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.

move forward stack block#
    <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.

move forward stack block#
    <landing?>

Parameters

Description

This block has no parameters.

Example

Example coming soon!