Encoded MAVLink commands

Overview

It is desired for a human to have the option of viewing and modifying the MAVLink commands generated by Autonomy programs before they are executed. This is provided as a common data structure which is transferred between programs.

Requirements

Must be able to be saved to a file.

Encoding scheme

It was debated whether or not to encode this file as CSV or in Mission Plain-Text File format, however it was decided that the encoding will be saved as a CSV file. The main reasoning behind this was the team’s familiarity with CSV and the flexibility offered by CSV files. Instead of pilots having to look up command codes every time, CSV’s can parse enums (strings) and allow for a more readable interface for pilots. CSV files can also be opened in excel for more user friendly editing.

It is recommended that pilots modify the csv file via Excel or another spreadsheet software in order to minimize errors.

The encoding will have the following headers:

frame

command_type

param1

param2

param3

param4

param5

param6

param7

frame

command_type

param1

param2

param3

param4

param5

param6

param7

 

 

 

 

 

 

 

 

 

The values will be interpreted as follows:

frame: The frame of reference for the command. Frame should be one of the following two.

  • global (usually used for landing or return to launch)

  • global_relative_alt (all other commands, such as waypoint, spline waypoint, etc.)

 

command_type: The command type. Depending on this value, params 1 through 7 will take on different meanings. This should be one of the following enums:

  • land:

  • return_to_launch: Return to the home location where the vehicle was last armed.

  • takeoff

  • waypoint: Navigate to the specified waypoint

  • waypoint_spline

  • loiter_timed: Loiter at the specified location for an specified amount of time

  • loiter_unlimited: Loiter at the specified location for an unlimited amount of time

  • do_jump: Jump to the specified command in the mission list.

  • Parsing will throw an error if the command type is unrecognized

 

param1 through param7: These take different meanings depending on the command type. See the following table for their respective meanings. N/A means that this parameter is inapplicable and should be set to 0 in the CSV.

More information on the parameters can be found from the link below:

Mission Commands — Copter documentation

** If set to zero, the aircraft will land at its current location.

command_type

param1

param2

param3

param4

param5

param6

param7

command_type

param1

param2

param3

param4

param5

param6

param7

land

N/A

N/A

N/A

N/A

**Target latitude in decimal degrees

**Target longitude in decimal degrees

N/A

return_to_launch

N/A

N/A

N/A

N/A

N/A

N/A

N/A

takeoff

N/A

N/A

N/A

N/A

N/A

N/A

Altitude in metres

waypoint

Hold time in seconds

Acceptance radius in metres

N/A

N/A

Latitude in decimal degrees

Longitude in decimal degrees

Altitude in metres

waypoint_spline

Hold time in seconds

N/A

N/A

N/A

Latitude in decimal degrees

Longitude in decimal degrees

Altitude in metres

loiter_timed

Loitering time in seconds

N/A

N/A

N/A

Latitude in decimal degrees

Longitude in decimal degrees

Altitude in metres

loiter_unlimited

N/A

N/A

N/A

N/A

Latitude in decimal degrees

Longitude in decimal degrees

Altitude in metres

do_jump

The sequence number of the mission command to jump to

Maximum number of times to perform the jump.

N/A

N/A

N/A

N/A

N/A

Usage

The encoded MAVLink commands buffer can be passed directly as part of interprocess communication or written to and read from a file.

The HMI program can be a simple text editor or a custom GUI created by WARG.