PIXHAWK2之输入命令部分翻译

来源:互联网 发布:海洋cms一点不好用 编辑:程序博客网 时间:2024/05/24 15:39

注意:并非是有文章单独介绍该部分,而是我整理下,截取翻译。

Overview

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.

  MAVLink协议定义了很多MAV_CMD路径指令.Ardupilot负责执行这些和具体飞行器相关的命令。不被支持的命令将简单的被忽略。
  这篇文章将会列出来各种飞行器所支持的命令和相应的参数,任何灰色的参数都表示不被当前飞行器所支持,但是我们还是列出这些目的在于让人们清楚到底哪些参数虽然MAV_CMD中有,但是当前飞行器种类不支持。
  一些命令将不被某些类型飞行器所支持,举例来说MAV_CMD_NAV_TAKEOFF对于船舶来说没有任何意义,PITCH只对于飞行器有意义。
  一些参数可能非常有用,但是由于信息大小的限制而不被处理,并且我们已经做了一些优化,让更加重要的参数排在前面。

Types of commands

There are several different types of commands that can be used within missions:
1. Navigation commands are used to control the movement of the vehicle, including takeoff, moving to and around waypoints, changing altitude, and landing.
2. 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).
3. 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.

  这里有很多不同种类的命令:
  
  1. 协调指令可以用来控制飞行器的动作,包括起飞\飞行到路径点\绕路径点环绕\改变高度\降落。
  2.DO命令可以用来改变舵机的姿态,但是不会改变飞行器自身的位置。这就是我想要的
  3.Condition命令就是用来条件执行Do命令。
  在一个任务里面同时只能运行一个协调命令或者一个Con或者Do命令。举个例子:一种典型的任务将设置一个路径点,然后添加一个条件命令,添加一系列动作事件。如果该条件命令被满足,将依次执行Do命令。

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.

  协商命令具有最高优先级,任何DO或者CON命令都会在NAV命令载入时被忽略(比如,当飞行器达到一个路径点,而另一个NAV命令被加载时,那么和第一路径点相关的CO或DO命令都会被自动忽略)。

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命令能够被重复指定次数或者被无限重复。

命令 MP 描述 参数1 wp# 要跳转的命令索引号 参数2 重复# do_jump命令执行的次数,0的时候立即执行,-1无限执行

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或者NOW命令都是执行一次,和路径点有关的DO命令都是被立即执行的。
 

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.

  改变目标水平速度或者油门,这种改变立即生效直到被再次改变或者飞行器重启。

MAV_CMD_DO_SET_SERVO

Supported by: Copter, Plane, Rover.

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

命令 MP 描述 参数1 舵机号 如我前面说的舵机号 参数2 PWM PWM的值

Mission planner screenshots

这里写图片描述
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).

  上面的例子,输出通道所连接的通道8被设置为1700(舵机接收的PWM范围在1000到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.

  在给定的中间值和指定值之间以指定的速率周期输出PWM至设定的次数。

命令 MP 描述 参数1 舵机号 如我前面说的舵机号 参数2 PWM PWM的值 参数3 重复次数 让舵机输出到指定PWM值的次数 参数4 延时 每次输出PWM的间隔(以秒为单位)

这里写图片描述

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.

  在上面的例子中,8通道的舵机将输出设定值为1700的PWM,等到4秒以后,又返回到中间值,再过4秒又会到1700.再过4秒以后将会回到中间值。所以总过迭代2次。每次切换延迟4S。

  那么问题来了,我想知道如果我想要进行很准确的控制甚至是实时的控制,需要编程,那么MP会有这样的接口吗?