Motion#

Introduction#

The VEX AIR Hornet 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 Hornet.

  • take off - Lifts the Hornet to a specified height.

  • land - Lands the Hornet.

  • hover - Keeps the Hornet at its position.

  • climb - Moves the Hornet in a specified vertical direction.

  • climb for - Moves the Hornet in a specified vertical direction for a specific distance.

  • climb to altitude - Moves the Hornet to a specified altitude.

  • move – Moves the Hornet forward, reverse, left, or right.

  • move at angle – Moves the Hornet in a specified direction using an angle.

  • move for – Moves the Hornet in a specific direction for a set distance.

  • move at angle for – Moves the Hornet at a specific angle for a set distance.

  • turn – Rotates the Hornet left or right.

  • turn for – Rotates the Hornet for a specified number of degrees.

  • turn to heading – Rotates the Hornet to face a specific heading.

  • move with controller – Allows the Hornet to be driven using the controller.

Flight Control – Adjust flight settings.

Settings – Adjust movement and turn speeds.

Altitude – Track and modify the Hornet’s maximum altitude.

Position – Track and modify the Hornet’s position.

  • position – Returns the Hornet’s current x, y, or z coordinate.

  • set drone position – Manually sets the Hornet’s x, y, and z position.

Values – Check movement status.

  • safe mode? - Returns the Hornet’s propeller lock state.

  • climb active? - Returns whether the Hornet is currently climbing.

  • move active? – Returns whether the Hornet is currently moving.

  • turn active? – Returns whether the Hornet is currently turning.

  • hovering? - Returns whether the Hornet is currently hovering.

  • taking off? - Returns whether the Hornet is currently taking off.

  • landing? - Returns whether the Hornet is currently landing.

Actions#

take off#

The take off block lifts the Hornet into the air.

move forward stack block#
    take off to [500] mm ▶

Parameters

Description

distance

The distance the Hornet will fly to in millimeters.

expanding arrow

By default, this is a waiting block, so the Hornet will finish moving before running the next block. To make the Hornet 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 Hornet.

move forward stack block#
    land ▶

Parameters

Description

expanding arrow

By default, this is a waiting block, so the Hornet will finish moving before running the next block. To make the Hornet 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 Hornet 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 Hornet in a specified vertical direction.

move forward stack block#
    climb [up v]

Parameters

Description

direction

The direction in which the Hornet will fly:

  • up
  • down

Example

Example coming soon!

climb for#

The climb for block moves the Hornet 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 Hornet will fly:

  • up
  • down

distance

The distance the Hornet 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 Hornet will finish moving before running the next block. To make the Hornet 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 Hornet 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 Hornet 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 Hornet will finish moving before running the next block. To make the Hornet 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 Hornet in four specific directions using the current move velocity.

move forward stack block#
    move [forward v]

Parameters

Description

direction

Move the Hornet in one of the following directions:

  • forward
  • right
  • left
  • reverse

Example

Example coming soon!

move at angle#

The move at angle block moves the Hornet 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 Hornet moves, ranging from 0 to 360 degrees.

expanding arrow

By default, this is a waiting block, so the Hornet will finish moving before running the next block. To make the Hornet 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 Hornet 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 Hornet in one of the following directions:

  • forward
  • right
  • left
  • reverse

distance

The distance, as an integer or decimal, that the Hornet 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 Hornet will finish moving before running the next block. To make the Hornet 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 Hornet 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 Hornet moves, ranging from 0 to 360 degrees.

distance

The distance, as an integer or decimal, that the Hornet 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 Hornet will finish moving before running the next block. To make the Hornet 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 Hornet in a specific direction using the current turn velocity.

turn right stack block#
    turn [right v] 

Parameters

Description

direction

The direction in which the Hornet turns:

  • right
  • left

Example

Example coming soon!

turn for#

The turn for block turns the Hornet 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 Hornet turns:

  • right
  • left

angle

The angle, as an integer or decimal, at which the Hornet moves, ranging from 0 to 360 degrees.

expanding arrow

By default, this is a waiting block, so the Hornet will finish moving before running the next block. To make the Hornet 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 Hornet 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 Hornet will turn to face from 0 to 360 degrees.

expanding arrow

By default, this is a waiting block, so the Hornet will finish moving before running the next block. To make the Hornet 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 Hornet using the VEX AIR 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 Hornet to move, the Hornet 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 Hornet.

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

Parameters

Description

style

Sets the viewpoint that is used to steer the Hornet:

  • drone – The Hornet moves relative to where it is facing.
  • pilot – The Hornet 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 Hornet’s movement style.

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

Parameters

Description

style

Sets the speed that is used to steer the Hornet:

  • tracking – The Hornet moves at a normal speed.
  • sport – The Hornet moves at a faster 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 Hornet 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 Hornet will move as a percent.

Example

Example coming soon!

set turn velocity#

Documentation Coming Soon

Altitude#

altitude#

The altitude block returns the Hornet’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 Hornet’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 Hornet’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 Hornet, in mm.

y

The y-position to set for the Hornet, in mm.

z

The z-position to set for the Hornet, in mm.

Example

Example coming soon!

Values#

safe mode?#

The safe mode? block returns a Boolean indicating whether the propeller lock is enabled on the Hornet.

  • 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 Hornet is climbing.

  • True – The Hornet is currently climbing.

  • False – The Hornet 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 Hornet is moving.

  • True – The Hornet is currently moving.

  • False – The Hornet 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 Hornet is turning.

  • True – The Hornet is currently turning.

  • False – The Hornet 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 Hornet is hovering.

  • True – The Hornet is currently hovering.

  • False – The Hornet 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 Hornet is taking off.

  • True – The Hornet is currently taking off.

  • False – The Hornet 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 Hornet is landing.

  • True – The Hornet is currently landing.

  • False – The Hornet is not landing.

move forward stack block#
    <landing?>

Parameters

Description

This block has no parameters.

Example

Example coming soon!