Partial translation of input commands in PIXHAWK2

  • The MAVLink protocol defines a large number of MAV_CMD waypoint command types (sent in a MAVLink_mission_item_message). ArduPilot implements handling for the subset of these commands and command-parameters that are most relevant and meaningful for each of the vehicles. Unsupported commands that are sent to a particular autopilot will simply be dropped.

  • This article lists and describes the commands and command-parameters that are supported on each of the vehicle types. Any parameter that is “grey” is not supported by the autopilot and will be ignored (they are still documented to make it clear which properties that are supported by the MAV_CMD protocol are not implemented by the vehicle.

  • Some commands and command-parameters are not implemented because they are not relevant for particular vehicle types (for example “MAV_CMD_NAV_TAKEOFF” command makes sense for Plane and Copter but not Rover, and the pitch parameter only makes sense for Plane). There are also some potentially useful command-parameters that are not handled because there is a limit to the message size, and a decision has been made to prioritise some parameters over others.

  The MAVLink protocol defines many MAV_CMD path commands. Ardupilot is responsible for executing these commands related to specific aircraft. Unsupported commands are simply ignored.
  This article will list the commands and corresponding parameters supported by various aircraft. Any gray parameters indicate that they are not supported by the current aircraft, but we still list these to let people know which parameters are in the MAV_CMD. , but the current aircraft type is not supported.
  Some commands will not be supported by certain types of aircraft, for example MAV_CMD_NAV_TAKEOFF has no meaning for ships, PITCH only makes sense for aircraft.
  Some parameters can be very useful, but are not processed due to message size constraints, and we have made some optimizations to put more important parameters first.

There are several different types of commands that can be used within missions:

  • Navigation commands are used to control the movement of the vehicle, including takeoff, moving to and around waypoints, changing altitude, and landing.
  • DO commands are for auxiliary functions and do not affect the vehicle’s position (for example, setting the camera trigger distance, or setting a servo value).
  • Condition commands are used to delay DO commands until some condition is met, for example the UAV reaches a certain altitude or distance from the waypoint.
  • During a mission at most one “Navigation” command and one “Do” or “Condition” command can be running at one time. A typical mission might set a waypoint (NAV command), add a CONDITION command that doesn’t complete until a certain distance from the destination (MAV_CMD_CONDITION_DISTANCE), and then add a number of DO commands that are executed sequentially (for example MAV_CMD_DO_SET_CAM_TRIGG_DIST to take pictures at regular intervals) when the condition completes.

  There are many different kinds of commands:
  
  1. Coordination commands can be used to control the actions of the aircraft, including take off, fly to waypoint, orbit around waypoint, change altitude, and land.
  2. The DO command can be used to change the attitude of the servo, but it will not change the position of the aircraft itself.
  3. The Condition command is used to conditionally execute the Do command.
  In a task, only one coordination command or one Con or Do command can be run at the same time. As an example: a typical task would set a waypoint, then add a conditional command, adding a sequence of action events. If the conditional command is satisfied, the Do command will be executed sequentially.

Navigation commands

NAV commands have the highest priority. Any DO_ and CONDITION_ commands that have not executed when a NAV command is loaded are skipped (for example, if a waypoint completes and the NAV command for another waypoint is loaded, and unexecuted DO/CONDITION commands associated with the first waypoint are dropped.

  The negotiation command has the highest priority, any DO or CON command will be ignored when the NAV command is loaded (for example, when the aircraft reaches a waypoint and another NAV command is loaded, then the CO or CON command associated with the first waypoint will be ignored. DO commands are automatically ignored).

MAV_CMD_DO_JUMP

Supported by: Copter, Plane, Rover.

Jump to the specified command in the mission list. The jump command can be repeated either a specified number of times before continuing the mission, or it can be repeated indefinitely.

  Jump to the command specified in the command list. The jump command can be repeated a specified number of times or indefinitely.

Order MP describe
parameter 1 wp# The index number of the command to jump to
parameter 2 repeat# The number of times the do_jump command is executed, 0 is executed immediately, -1 is executed infinitely

DO commands

The “DO” or “Now” commands are executed once to perform some action. All the DO commands associated with a waypoint are executed immediately.

  DO or NOW commands are executed once, and DO commands related to waypoints are executed immediately.
 

MAV_CMD_DO_CHANGE_SPEED
Supported by: Copter, Plane, Rover.

Change the target horizontal speed and/or throttle of the vehicle. The changes will be used until they are explicitly changed again or the device is rebooted.

  Change the target horizontal speed or throttle, the change takes effect immediately until it is changed again or the aircraft is restarted.

MAV_CMD_DO_SET_SERVO

Supported by: Copter, Plane, Rover.

Set a given servo pin output to a specific PWM value.

Order MP describe
parameter 1 Servo No. As I said before the steering gear number
parameter 2 PWM PWM value

Mission planner screenshots

write picture description here
In the example above, the servo attached to output channel 8 would be moved to PWM 1700 (servos generally accept PWM values between 1000 and 2000).

  In the above example, the channel 8 connected to the output channel is set to 1700 (the PWM range received by the servo is 1000 to 2000).

MAV_CMD_DO_REPEAT_SERVO

Supported by: Copter, Plane, Rover.

Cycle a servo PWM output pin between its mid-position value and a specified PWM value, for a given number of cycles and with a set period.

The mid-position value is specified in the RCn_TRIM parameter for the channel (RC8_TRIM in the screenshot below). The default value is 1500.

  Periodically output the PWM at the specified rate for the set number of times between the given intermediate value and the specified value.

Order MP describe
parameter 1 Servo No. As I said before the steering gear number
parameter 2 PWM PWM value
parameter 3 repeat times The number of times to let the servo output to the specified PWM value
parameter 4 delay The interval between each output PWM (in seconds)

write picture description here

In the example above, the servo attached to output channel 8 would be moved to PWM 1700, then after 4 second, back to mid, after another 4 seconds it would be moved to 1700 again, then finally after 4 more seconds it would be moved back to mid.

  In the above example, the 8-channel servo will output PWM with a set value of 1700. After 4 seconds, it will return to the middle value, and after another 4 seconds, it will return to 1700. After another 4 seconds, it will return to Median. So there are always 2 iterations. Each switch delays 4S.

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=326226983&siteId=291194637