за что отвечает команда do set roi
Mission CommandsВ¶
This article describes the mission commands that are supported by Copter, Plane and Rover when switched into Auto mode.
This is a work-in-progress and has not been full reviewed. A better list for Copter can be found here
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 prioritize some parameters over others.
Types of commandsВ¶
There are several different types of commands that can be used within missions:
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.
CONDITION and DO commands are associated with the preceding NAV command: if the UAV reaches the next waypoint before these commands are executed, the next NAV command is loaded and they will be skipped.
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).
Plane commands can additionally use MAV_FRAME_GLOBAL_TERRAIN_ALT frame of reference. This again has the same WGS84 frame of reference for latitude/Longitude, but specifies altitude relative to ground height (as defined in a terrain database).
The other frame types defined in the MAVLink protocol (see MAV_FRAME) are not supported for mission commands.
How accurate is the information?В¶
If a command or parameter is marked as supported then it is likely (but not guaranteed) that it will behave as indicated. If a command or parameter is not listed (or marked as not supported) then it is extremely likely that it is not supported on ArduPilot.
The reason for this is that the information was predominantly inferred by inspecting the command handlers for messages:
The above checks give a very accurate picture of what commands and parameters are not supported. They gives a fairly accurate picture of what commands/parameters are likely to be supported. However this indication is not guaranteed to be accurate because a command handler could just throw away all the information (and we have not fully checked all of these).
How to interpret the commands parametersВ¶
The parameters for each command are listed in a table. The parameters that are “greyed out” are not supported. The command field column (param name) uses “bold” text to indicate those parameters that are defined in the protocol (normal text is used for “empty” parameters).
This allows users/developers to see both what is supported, and what protocol fields are not supported in ArduPilot.
Using this information with a GCSВ¶
Mission Planner (MP) exposes the full subset of commands and parameters supported by ArduPilot, filtered to display just those relevant to the currently connected vehicle. Mapping the MP commands to this documentation is easy, because it simply names commands using a cut-down version of the full command name (e.g. DO_SET_SERVO rather than the full command name: MAV_CMD_DO_SET_SERVO ). In addition, this document conveniently lists the column label used by Mission Planner alongside each of the parameters.
Other GCSs (APM Planner 2, Tower etc.) may support some other subset of commands/parameters and use alternative names/labels for them. In most cases the mapping should be obvious.
Navigation commandsВ¶
Navigation commands are used to control the movement of the vehicle, including takeoff, moving to and around waypoints, and landing.
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.
MAV_CMD_NAV_WAYPOINTВ¶
Supported by: Copter, Plane, Rover.
Navigate to the specified position.
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_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).
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.
Despite the name, this command is really a “NAV_” command rather than a “DO_” command. Conditional commands like CONDITION_DELAY don’t affect DO_JUMP (it will always perform the jump as soon as it reaches the command).
Command parameters
Mission planner screenshots
Copter: Mission Planner Settings for DO_JUMP command
In the example above the vehicle would fly back-and-forth between waypoints #1 and #2 a total of 3 times before flying on to waypoint #4.
Conditional commandsВ¶
Conditional commands control the execution of _DO_ commands. For example, a conditional command can prevent DO commands executing based on a time delay, until the vehicle is at a certain altitude, or at a specified distance from the next target position.
A conditional command may not complete before reaching the next waypoint. In this case, any unexecuted _DO_ commands associated with the last waypoint will be skipped.
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 ).
This command does not stop the vehicle. If the vehicle reaches the next waypoint before the delay timer completes, the delayed “_DO_” commands will never trigger.
Command parameters
Command Field | Mission Planner Field | Description |
---|---|---|
param1 | Time (sec) | Delay in seconds (decimal). |
param2 | Empty | |
param3 | Empty | |
param4 | Empty | |
param5 | Empty | |
param6 | Empty | |
param7 | Empty |
Mission planner screenshots
Copter: Mission Planner Settingsfor CONDITION_DELAY command
In the example above, Command #4 ( DO_SET_ROI ) is delayed so that it starts 5 seconds after the vehicle has passed Waypoint #2.
MAV_CMD_CONDITION_DISTANCEВ¶
Supported by: Copter, Plane, Rover.
Delays the start of the next “ _DO_ ” command until the vehicle is within the specified number of meters of the next waypoint.
This command does not stop the vehicle: it only affects DO commands.
Command parameters
Command Field | Mission Planner Field | Description |
---|---|---|
param1 | Dist (m) | Distance from the next waypoint before DO commands are executed (meters). |
param2 | Empty | |
param3 | Empty | |
param4 | Empty | |
param5 | Empty | |
param6 | Empty | |
param7 | Empty |
Mission planner screenshots
Copter: Mission PlannerSettings for CONDITION_DISTANCE command
In the example above, Command #4 ( DO_SET_ROI ) is delayed so that it only starts once the vehicle is within 50m of waypoint #5.
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.
MAV_CMD_DO_SET_MODEВ¶
Supported by: Copter, Plane, Rover.
Set system mode (preflight, armed, disarmed etc.)
Command parameters
MAV_CMD_DO_CHANGE_SPEEDВ¶
Supported by: Copter, Plane, Rover.
Change the target horizontal speed and/or throttle of the vehicle. In most cases, the changes will be used until they are explicitly changed again or the device is rebooted.
MAV_CMD_DO_SET_HOMEВ¶
Supported by: Copter, Plane, Rover.
Sets the home location either as the current location or at the location specified in the command.For SITL work, altitude input here needs to be with reference to absolute altitude, taking into account SRTM elevation.
Command parameters
Command Field | Mission Planner Field | Description |
---|---|---|
param1 | Current | Set home location: 1=Set home as current location. 0=Use location specified in message parameters. |
param2 | Empty | |
param3 | Empty | |
param4 | Empty | |
param5 | Lat | Target home latitude (if param1=0 ) |
param6 | Lon | Target home longitude (if param1=0 ) |
param7 | Alt | Target home altitude (if param1=0 ) |
Mission planner screenshots
Copter: Mission Planner Settings forDO_SET_HOME command
MAV_CMD_DO_SET_RELAYВ¶
Supported by: Copter, Plane, Rover.
Set a Relay pin’s voltage high (on) or low (off).
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) any other value toggles the relay |
param3 | Empty | |
param4 | Empty | |
param5 | Empty | |
param6 | Empty | |
param7 | Empty |
Mission planner screenshots
Copter: MissionPlanner Settings for DO_SET_RELAY command
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
Mission planner screenshots
Copter: Mission Planner Settingsfor DO_RELAY_REPEAT command
In the example above, assuming the relay was off to begin with, it would be set high and then after 3 seconds it would be toggled low again.
MAV_CMD_DO_SET_SERVOВ¶
Supported by: Copter, Plane, Rover.
Set a given servo pin output to a specific PWM value.
Command parameters
Mission planner screenshots
Copter: Mission Planner Settingsfor DO_SET_SERVO command
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).
as of firmware versions 4.0 and later, this command can be used on any output configured by its SERVOx_FUNCTION command as 0,1, or 51-66 (disabled or RC pass-throughs)
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
Mission planner screenshots
Copter: Mission Planner Settingsfor DO_REPEAT_SERVO command
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.
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.
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.
Trigger the camera shutter once. This command takes no additional arguments.
Command parameters
In general if a command field is set to 0 it is ignored.
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
Copter: 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.
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
Copter: Mission PlannerSettings for DO_MOUNT_CONTROL command
MAV_CMD_DO_SET_CAM_TRIGG_DISTВ¶
Supported by: Copter, Plane, Rover.
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 | ? | Trigger once instantly. One is on, zero is off. |
param4 | Empty | |
param5 | Empty | |
param6 | Empty | |
param7 | Empty |
Mission planner screenshots
Copter: 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В¶
Command parameters
Command Field | Mission Planner Field | Description |
---|---|---|
param1 | Set GeoFence enable state (0=disable, 1=enable, 2= disable only floor (Plane only)). | |
param2 | Empty | |
param3 | Empty | |
param4 | Empty | |
param5 | Empty | |
param6 | Empty | |
param7 | Empty |
MAV_CMD_DO_SET_RESUME_DISTВ¶
Supported by: Plane, Copter & Rover.
Command parameters
Command Field | Mission Planner Field | Description |
---|---|---|
param1 | ? | Rewind distance in meters |
param2 | Empty | |
param3 | Empty | |
param4 | Empty | |
param5 | Empty | |
param6 | Empty | |
param7 | Empty |
© Copyright 2021, ArduPilot Dev Team.
Команды Mission Planner
Взлет / Takeoff
Точка / Waypoint
Квадрокоптер будет лететь по прямой линии в место указанное в качестве точки ( по координатам долготы, ширины и высоты в метрах).
Параметры:
Loiter_Time
Квадрокоптер будет летать и ждать в указанном месте указанное количество секунд. Это миссия эквивалентна режиму Loiter.
Параметры:
Loiter_Turns
Выполнение этой миссии эквивалентно полетному режиму Circle. Квадрокоптер будет летать вокруг указанной точки (по координатам ширины, долготы и заданной высоты в метрах).
Радиус окружности задается параметром CIRCLE_RADIUS (т.е. не может быть установлен как часть миссии)
Параметры:
Loiter_Unlimited
Квадрокоптер будет лететь к указанной точке и ждать. Миссия не будет продолжена после этой команды.
Параметры:
Return-To-Launch
Квадрокоптер приземлится в текущем положении или в указанных координатах широты и долготы. Эта миссия эквивалентна полетному режиму LAND
Параметры:
Do-Set-ROI
Параметры:
Condition-Delay
Параметры:
Condition-Distance
Задержка следующей команды «делать» пока квадрокоптер не находиться в пределах указанного количества метров следующей точки. В приведенном выше примере команда 4 (Do-Set-ROI) задерживается так, что она начинается после того, как квадрокоптер находиться в пределах 50 метров от точки 5. Примечание: эта команда не останавливает квадрокоптер во время миссии. она только влияет на команды «Do».
Параметры:
Condition-Yaw
Эта команда направляет нос квадрокоптера на указаное направленик, когда он идет до следующей точки.
Параметры:
Do-Jump
Позволяет перейти к команде заданное число раз, прежде чем продолжить миссию. Пример выше даст квадрокоптеру команду полета обратно на точку 1 и 2 в общей сложности 3 раза, прежде чем он полетит до точки 4.
Параметры:
Примечание: эа команда не должна использоваться на прошивке 3.1.2 или ранее (она правильно работает на прошивках ArduCopter 3.2)
Do-Change-Speed
Команда позволяет изменить горизонтальную скорость (в метрах в секунду) у квадрокоптера.
Параметры:
Примечание: В конфигурации Arducopter 3.1.2 и ранее изменение скорости вступит в силу после того, когда команда навигации (т.е. команда путевой точки) завершиться. В версии 3.2 квадрокоптер сразу изменит скорость
Do-Set-Home
Эта команда изменит исходное положение, которое используется для возращения на старт («Home» так же используется оригинальное положение для всех расчетов навигации).
Параметры:
Do-Set-Cam-Trigg-Dist
Активизирование затвора камеры на основе расстояния. Например эта команда выше заставит работать затвор камеры, что бы запускать его после каждого 5м, которые летит квадрокоптер.
Параметры:
Примечание: В конфигурации ArduCopter 3.1.2 и раньше эта команда не может быть отключена. Камера будет продолжать срабатывать несколько раз даже после того, как миссия была окончена. В версии прошивки 3.2 и выше установление значение равное нулю остановит затвор камеры от ключения.
Do-Set-Relay
Установит выходы реле (relay pins) кодами LOW или HIGH.
Параметры:
Do-Repeat-Relay
Параметры:
Do-Set-Servo
Перемещение сервопривода до конктерного значения ШИМ (PWM). В приведенном выше примере сервопривод подключен к 8 каналу и будет установлен 1700 PWM (обычно значения в диапазоне от 1000 до 2000)
Параметры:
Do-Repeat-Servo
Команда позволяет многократно двигать сервоприводом назад и вперед между его средним положением и заданным значением ШИМ. В приведенном выше примере сервопривод крепиться к 8 каналу выхода APM и будет установлено значение 1700 ШИМ, после 4 секунд вернется в среднее положение (по умолчанию это 1500, который устанавливается параметром RC8_TRIM) после следующих 4 секунд он будет снова перемещен в значение 1700. В конце после 4 секунд он будет перемещен назад в среднее значение.
Параметры:
Do-Digicam-Control
Команда позволяющая активизировать затвор камеры сразу. Эта команда не принимает дополительные аргументы.
Do-Mount-Control
Не поддерживается. Эта команда ничего не делает и не принимает никаких аргументов.
В будущих версиях этой команды можно указать угол крена, тангажа и рысканья, который примет подвес камеры Это может быть полезно для наведения камеры в конкретных направлениях во время миссии.