2011-02-24 01:56:59 -04:00
ArduPilotMega 2.0 Commands
2010-12-19 12:40:33 -04:00
Command Structure in bytes
0 0x00 byte Command ID
1 0x01 byte Parameter 1
2011-02-24 01:56:59 -04:00
2 0x02 long Parameter 2
2010-12-19 12:40:33 -04:00
3 0x03 ..
2011-02-24 01:56:59 -04:00
4 0x04 ..
2010-12-19 12:40:33 -04:00
5 0x05 ..
2011-02-24 01:56:59 -04:00
6 0x06 long Parameter 3
2010-12-19 12:40:33 -04:00
7 0x07 ..
2011-02-24 01:56:59 -04:00
8 0x08 ..
2010-12-19 12:40:33 -04:00
9 0x09 ..
2011-02-24 01:56:59 -04:00
10 0x0A long Parameter 4
2010-12-19 12:40:33 -04:00
11 0x0B ..
2011-02-24 01:56:59 -04:00
11 0x0C ..
11 0x0D ..
2010-12-19 12:40:33 -04:00
***********************************
2011-02-24 01:56:59 -04:00
Commands below MAV_CMD_NAV_LAST are commands that have a end criteria, eg "reached waypoint" or "reached altitude"
2010-12-19 12:40:33 -04:00
***********************************
2011-02-24 01:56:59 -04:00
Command ID Name Parameter 1 Altitude Latitude Longitude
2011-04-20 03:44:49 -03:00
0x10 / 16 MAV_CMD_NAV_WAYPOINT delay (seconds) altitude lat lon
2011-03-26 03:35:52 -03:00
0x11 / 17 MAV_CMD_NAV_LOITER_UNLIM (forever) altitude lat lon
2011-04-20 02:37:05 -03:00
0x14 / 20 MAV_CMD_NAV_RETURN_TO_LAUNCH - - - -
0x15 / 21 MAV_CMD_NAV_LAND - - - -
0x16 / 22 MAV_CMD_NAV_TAKEOFF - altitude - -
2011-05-14 23:02:09 -03:00
0x19 / 22 MAV_CMD_NAV_LOITER_TIME - altitude - -
2010-12-19 12:40:33 -04:00
2011-03-26 03:35:52 -03:00
NOTE: for command 0x16 the value takeoff pitch specifies the minimum pitch for the case with airspeed sensor and the target pitch for the case without.
2010-12-19 12:40:33 -04:00
***********************************
May Commands - these commands are optional to finish
2011-02-24 01:56:59 -04:00
Command ID Name Parameter 1 Parameter 2 Parameter 3 Parameter 4
2011-03-13 03:25:38 -03:00
0x70 / 112 MAV_CMD_CONDITION_DELAY - - time (seconds) -
2011-02-24 01:56:59 -04:00
0x71 / 113 MAV_CMD_CONDITION_CHANGE_ALT rate (cm/sec) alt (finish) - -
2011-03-13 03:25:38 -03:00
Note: rate must be > 10 cm/sec due to integer math
2011-04-25 02:12:59 -03:00
// MAV_CMD_NAV_LAND_OPTIONS (NOT CURRENTLY IN MAVLINK PROTOCOL OR IMPLEMENTED IN APM)
2010-12-19 12:40:33 -04:00
2011-03-13 03:25:38 -03:00
0x72 / 114 MAV_CMD_CONDITION_DISTANCE - - distance (meters) -
0x71 / 115 MAV_CMD_CONDITION_YAW angle speed direction (-1,1) rel (1), abs (0)
2010-12-19 12:40:33 -04:00
***********************************
2011-02-24 01:56:59 -04:00
Unexecuted commands > MAV_CMD_NAV_LAST are dropped when ready for the next command < MAV_CMD_NAV_LAST so plan/queue commands accordingly!
For example if you had a string of CMD_MAV_CONDITION commands following a 0x10 command that had not finished when the waypoint was
reached, the unexecuted CMD_MAV_CONDITION and CMD_MAV_DO commands would be skipped and the next command < MAV_CMD_NAV_LAST would be loaded
2010-12-19 12:40:33 -04:00
***********************************
Now Commands - these commands are executed once until no more new now commands are available
2011-02-24 01:56:59 -04:00
Command ID Name Parameter 1 Parameter 2 Parameter 3 Parameter 4
2011-03-13 03:25:38 -03:00
0xB1 / 177 MAV_CMD_DO_JUMP index - repeat count -
Note: The repeat count must be greater than 1 for the command to execute. Use a repeat count of 1 if you intend a single use.
0XB2 / 178 MAV_CMD_DO_CHANGE_SPEED Speed type Speed (m/s) Throttle (Percent) -
(0=Airspeed, 1=Ground Speed) (-1 indicates no change)(-1 indicates no change)
0xB3 / 179 MAV_CMD_DO_SET_HOME Use current altitude lat lon
(1=use current location, 0=use specified location)
0xB4 / 180 MAV_CMD_DO_SET_PARAMETER Param number Param value (NOT CURRENTLY IMPLEMENTED IN APM)
0xB5 / 181 MAV_CMD_DO_SET_RELAY Relay number On/off (1/0) - -
0xB6 / 182 MAV_CMD_DO_REPEAT_RELAY Relay number Cycle count Cycle time (sec) -
Note: Max cycle time = 60 sec, A repeat relay or repeat servo command will cancel any current repeating event
0xB7 / 183 MAV_CMD_DO_SET_SERVO Servo number (5-8) On/off (1/0) - -
0xB6 / 184 MAV_CMD_DO_REPEAT_SERVO Servo number (5-8) Cycle count Cycle time (sec) -
Note: Max cycle time = 60 sec, A repeat relay or repeat servo command will cancel any current repeating event
2010-12-19 12:40:33 -04:00
2011-04-25 02:12:59 -03:00
// need to add command
2011-05-07 16:41:55 -03:00
0xB7 / 185 MAV_CMD_DO_SET_ROI Yaw_Mode altitude lat lon