MAVLink Mission Command Messages (MAV_CMD)
本文描述的特定任务的一组命令和参数
命令的类型
有几种不同类型的命令可用于任务:
-
导航命令是用于控制车辆的运动,包括起飞、航路点周围移动,并且,改变高度,并着陆。
-
做指令的辅助功能,不影响车辆的位置(例如,设定触发相机的距离、或者设置值伺服)。
-
状态命令是用于命令进行延迟,直到达到某些条件,例如UAV的一定的高度或距离航点。
Types of commands
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.
参考帧。
许多命令(特别是NAV_命令)包括位置/定位信息。该信息被提供的“参照系”,在该消息中指定的参考帧。场。使用直升机和火星车任务MAV_do_CMD_SET_HOME设置命令的“初始位置”在全局坐标系(globalMAV_FRAME),WGS84坐标系统其中,高度是相对于平均海平面。使用的所有其他命令MAV帧global_ALT相对帧使用同样的纬度和经度,而通过设定相对于作为高度家庭位置家庭(高度=0)。
Frames of reference
Many of the commands (in particular the NAV_ commands) include position/location information. The information is provided relative to a particular “frame of reference”, which is specified in the message’s Frames of reference field. Copter and Rover Mission use MAV_CMD_DO_SET_HOME command to set the “home position” in the global coordinate frame (MAV_FRAME_GLOBAL), WGS84 coordinate system, where altitude is relative to mean sea level. All other commands use the MAV_FRAME_GLOBAL_RELATIVE_ALT frame, which uses the same latitude and longitude, but sets altitude as relative to the home position (home altitude = 0).
导航命令
导航命令是用于控制车辆的运动,包括起飞、航路点和移动至周围和着陆。
导航命令的优先级最高。和条件做任何__命令的命令时,不执行NAV的加载被跳过(例如,如果NAV的航点和完成另一个路点的指令被加载,并且未做条件/第一停靠点相关联的命令被丢弃。
MAV_CMD_NAV_WAYPOINT
Supported by: Copter, Plane, Rover.
Navigate to the specified position.导航到指定位置。
MAV_CMD_NAV_TAKEOFF
Supported by: Copter, Plane (not Rover).
Takeoff (either from ground or by hand-launch). It should be the first command of nearly all Plane and Copter missions.从地面起飞(发射)或通过手工。几乎所有飞机和直升机的第一个命令。
MAV_CMD_NAV_LOITER_UNLIM
Supported by: Copter, Plane, Rover.
Loiter at the specified location for an unlimited amount of time.在指定位置上绕点飞行。
MAV_CMD_NAV_LOITER_TURNS
Supported by: Copter, Plane (not Rover).
Loiter (circle) the specified location for a specified number of turns.指定的位置盘旋指定的转数(圆圈)。
MAV_CMD_NAV_LOITER_TIME
Supported by: Copter, Plane, Rover(车).
Loiter at the specified location for a set time (in seconds).指定的位置盘旋指定的时间(秒)。
MAV_CMD_NAV_RETURN_TO_LAUNCH
Supported by: Copter, Plane, Rover.
Return to the home location or the nearest Rally Point, if closer. The home location is where the vehicle was last armed (or when it first gets GPS lock after arming if the vehicle configuration allows this).返回家位置或就近的集结点 。家的位置是飞行器解锁位置(或如果飞行器配置允许,最初获得GPS锁定位置)。
MAV_CMD_NAV_LAND
Supported by: Copter, Plane (not Rover).
Land the vehicle at the current or a specified location.在当前或指定位置降落。
MAV_CMD_NAV_CONTINUE_AND_CHANGE_ALT
Supported by: Plane (not Copter, Rover).
Continue on the current course and climb/descend to specified altitude. Move to the next command when the desired altitude is reached.继续当前飞行课程和爬升/下降到指定高度。移动到下一个命令时所需的高度。
MAV_CMD_NAV_SPLINE_WAYPOINT
Supported by: Copter (not Plane or Rover).
Navigate to the target location using a spline path.导航至目标位置使用样条路径。
MAV_CMD_NAV_GUIDED_ENABLE
Supported by: Copter (not Plane or Rover).
Enable GUIDED
mode to hand over control to an external controller.启用引导
控制模式切换到外部控制器。
See also MAV_CMD_DO_GUIDED_LIMITS for information on how to apply time, altitude and distance limits on the external control.也参见MAV_CMD_do引导Limits关于施加时间、高度和距离控制的外部限制。
MAV_CMD_NAV_ALTITUDE_WAIT
Supported by: Plane (not Copter or Rover).
Mission command to wait for an altitude or downwards vertical speed.任务命令等待向下垂直速度或高度。
MAV_CMD_NAV_LOITER_TO_ALT
Supported by: Plane (not Copter or Rover).
Begin loiter at the specified Latitude and Longitude. If Lat=Lon=0, then loiter at the current position. Don’t consider the navigation command complete (don’t leave loiter) until the altitude has been reached. Additionally, if the Heading Required parameter is non-zero the aircraft will not leave the loiter until heading toward the next waypoint.开始游荡在指定纬度和经度。如果LATLON==0,那么在当前位置处待机。不考虑该导航命令(不完整),直到离开巡航高度。另外,若所需参数为非零的飞机将不会离开前往待机直到下一个航点。
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.
跳转到指定的命令的任务列表。跳过命令可以重复指定的次数,然后继续任务,或它可以无限地重复。
MAV_CMD_CONDITION_DELAY
Supported by: Copter, Plane, Rover.
After reaching a waypoint, delay the execution of the next conditional “DO” command for the specified number of seconds (e.g. MAV_CMD_DO_SET_ROI).
MAV_CMD_DO_SET_RELAY
Supported by: Copter, Plane, Rover.
Set a Relay pin’s voltage high (on) or low (off).
HW TODO / Question - is “toggling supported” using -1 in the setting? Some docs indicate this, but no information. “Toggling the Relay will turn an off relay on and vice versa”
Command parameters
Command Field | Mission Planner Field | Description |
---|---|---|
param1 | Relay No | Relay number. |
param2 | off(0)/on(1) | Set relay state: 1: Set relay high/on (3.3V on Pixhawk, 5V on APM). 0: Set relay low/off (0v) |
MAV_CMD_DO_REPEAT_RELAY
Supported by: Copter, Plane, Rover.
Toggle the Relay pin’s voltage/state a specified number of times with a given period. Toggling the Relay will turn an off relay on and vice versa
Command parameters
Command Field | Mission Planner Field | Description |
---|---|---|
param1 | Relay No | Relay number. |
param2 | Repeat # | Cycle count - the number of times the relay should be toggled |
param3 | Delay(s) | Cycle time (seconds, decimal) - time between each toggle. |
MAV_CMD_DO_SET_SERVO
Supported by: Copter, Plane, Rover.
Set a given servo pin output to a specific PWM value.
Command parameters
Command Field | Mission Planner Field | Description |
---|---|---|
param1 | Ser No | Servo number - target servo output pin/channel number. |
param2 | PWM | PWM value to output, in microseconds (typically 1000 to 2000). |
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).
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..
Command parameters
Command Field | Mission Planner Field | Description |
---|---|---|
param1 | Ser No | Servo number - target servo output pin/channel. |
param2 | PWM | PWM value to output, in microseconds (typically 1000 to 2000). |
param3 | Repeat # | Cycle count - number of times to move the servo to the specified PWM value |
param4 | Delay (s) | Cycle time (seconds) - the delay in seconds between each servo movement. |
MAV_CMD_DO_LAND_START
Supported by: Plane (not Copter, Rover).
Mission command to prepare for a landing.
MAV_CMD_DO_SET_ROI
Supported by: Copter, Plane, Rover.
Sets the region of interest (ROI) for a sensor set or the vehicle itself. This can then be used by the vehicles control system to control the vehicle attitude and the attitude of various sensors such as cameras.
HW TODO / Questions - What is the frame - altitude above home or above terrain or relative to vehicle?
HW TODO / Questions - Is behaviour on all vehicles the same (except for Yaw). If so, merge 3 sections below.
MAV_CMD_DO_DIGICAM_CONFIGURE
Supported by: Copter, Plane, Rover.
Configure an on-board camera controller system.
The parameters are forwarded to an on-board camera controller system (like the 3DR Camera Control Board), if one is present.
Command parameters
Command Field | Mission Planner Field | Description |
---|---|---|
param1 | Mode | Set camera mode: 1: ProgramAuto 2: Aperture Priority 3: Shutter Priority 4: Manual 5: IntelligentAuto 6: SuperiorAuto |
param2 | Shutter Speed | Shutter speed (seconds divisor). So if the speed is 1/60 seconds, the value entered would be 60. Slowest shutter trigger supported is 1 second. |
param3 | Aperture | Aperture: F stop number |
param4 | ISO | ISO number e.g. 80, 100, 200, etc. |
param5 | ExposureMode | Exposure type enumerator |
param6 | CommandID | Command Identity |
param7 | Engine Cut-Off | Main engine cut-off time before camera trigger in seconds/10 (0 means no cut-off). |
MAV_CMD_DO_DIGICAM_CONTROL
Supported by: Copter, Plane, Rover.
AC3.3: Control an on-board camera controller system (like the 3DR Camera Control Board).
Currently/BEFORE AC3.3: Trigger the camera shutter once. This command takes no additional arguments.
Command parameters
The parameters below reflect the supported fields in AC3.3. In general if a command field is sent as 0 it is ignored. All parameters are ignored prior to AC3.3.
Command Field | Mission Planner Field | Description |
---|---|---|
param1 | On/Off | Session control (on/off or show/hide lens): 0: Turn off the camera / hide the lens 1: Turn on the camera /Show the lens |
param2 | Zoom Position | Zoom's absolute position. 2x, 3x, 10x, etc. |
param3 | Zoom Step | Zooming step value to offset zoom from the current position |
param4 | Focus Lock | Focus Locking, Unlocking or Re-locking: 0: Ignore 1: Unlock 2: Lock |
param5 | Shutter Cmd | Shooting Command. Any non-zero value triggers the camera. |
param6 | CommandID | Command Identity |
param7 | Empty |
Mission planner screenshots
imageCopter: Mission PlannerSettings for DO_DIGICAM_CONTROL command.
MAV_CMD_DO_MOUNT_CONTROL
Supported by: Copter, Plane, Rover.
Mission command to control a camera or antenna mount.
This command allows you to specify a roll, pitch and yaw angle which will be sent to the camera gimbal. This can be used to point the camera in specific directions at various times in the mission.
Note
Supported from AC3.3, Plane 3.4
Command parameters
Command Field | Mission Planner Field | Description |
---|---|---|
param1 | Pitch, in degrees. | |
param2 | Roll, in degrees. | |
param3 | Yaw, in degrees. | |
param4 | reserved | |
param5 | reserved | |
param6 | reserved | |
param7 |
MAV_MOUNT_MODE __ enum value. |
Mission planner screenshots
imageCopter: Mission PlannerSettings for DO_MOUNT_CONTROL command
MAV_CMD_DO_SET_CAM_TRIGG_DIST
Supported by: Copter, Plane, Rover.
Trigger the camera shutter at regular distance intervals. This command is useful in camera survey missions.
Note
In AC3.1.5 (and earlier) versions this command cannot be shut-off. The camera will continue to be triggered repeatedly even after the mission has been ended. In AC3.2 (and higher) providing a distance of zero will stop the camera shutter from being triggered.
Command parameters
Command Field | Mission Planner Field | Description |
---|---|---|
param1 | Dist (m) | Camera trigger distance interval (meters). Zero to turn off distance triggering. |
param2 | Empty | |
param3 | Empty | |
param4 | Empty | |
param5 | Empty | |
param6 | Empty | |
param7 | Empty |
Mission planner screenshots
imageCopter: Mission PlannerSettings for DO_SET_CAM_TRIGG_DIST command
The above configuration above will cause the camera shutter to trigger after every 5m that the vehicle travels.
MAV_CMD_DO_FENCE_ENABLE
Supported by: Plane (not Copter or Rover).
Mission command to enable the GeoFence.
MAV_CMD_DO_PARACHUTE
Supported by: Copter (not Plane or Rover).
Mission command to trigger a parachute (if enabled).
MAV_CMD_DO_INVERTED_FLIGHT
Supported by: Plane (not Copter or Rover).
Change to/from inverted flight.
MAV_CMD_DO_GRIPPER
Supported by: Copter (not Plane or Rover).
Mission command to operate EPM gripper.
MAV_CMD_DO_GUIDED_LIMITS
Supported by: Copter (not Plane or Rover).
Set limits for external control.
MAV_CMD_DO_AUTOTUNE_ENABLE
Supported by: Plane (not Copter or Rover).
Enable/disable autotune.
网友评论