mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-23 07:43:35 +08:00
Move PX4 Guide source into /docs (#24490)
* Add vitepress tree * Update existing workflows so they dont trigger on changes in the docs path * Add nojekyll, package.json, LICENCE etc * Add crowdin docs upload/download scripts * Add docs flaw checker workflows * Used docs prefix for docs workflows * Crowdin obvious fixes * ci: docs move to self hosted runner runs on a beefy server for faster builds Signed-off-by: Ramon Roche <mrpollo@gmail.com> * ci: don't run build action for docs or ci changes Signed-off-by: Ramon Roche <mrpollo@gmail.com> * ci: update runners Signed-off-by: Ramon Roche <mrpollo@gmail.com> * Add docs/en * Add docs assets and scripts * Fix up editlinks to point to PX4 sources * Download just the translations that are supported * Add translation sources for zh, uk, ko * Update latest tranlsation and uorb graphs * update vitepress to latest --------- Signed-off-by: Ramon Roche <mrpollo@gmail.com> Co-authored-by: Ramon Roche <mrpollo@gmail.com>
This commit is contained in:
co-authored by
Ramon Roche
parent
8e6d2ebe4a
commit
88d623bedb
@@ -0,0 +1 @@
|
||||
<Redirect to="../flight_modes_fw/acro" />
|
||||
@@ -0,0 +1 @@
|
||||
<Redirect to="../flight_modes_mc/acro" />
|
||||
@@ -0,0 +1 @@
|
||||
<Redirect to="../flight_modes_fw/altitude" />
|
||||
@@ -0,0 +1 @@
|
||||
<Redirect to="../flight_modes_mc/altitude" />
|
||||
@@ -0,0 +1 @@
|
||||
<Redirect to="../flight_modes_mc/follow_me" />
|
||||
@@ -0,0 +1 @@
|
||||
<Redirect to="../flight_modes_mc/hold" />
|
||||
@@ -0,0 +1,16 @@
|
||||
# 飞行模式
|
||||
|
||||
Flight modes provide autopilot support to make it easier to manually fly the vehicle, to automate common tasks such as takeoff and landing, to execute autonomous missions, or to defer flight control to an external system.
|
||||
|
||||
关于特定机架可用的飞行模式信息,请参阅以下章节:
|
||||
|
||||
- [Flight Modes (Multicopter)](../flight_modes_mc/index.md)
|
||||
- [Flight Modes (Fixed-Wing)](../flight_modes_fw/index.md)
|
||||
- [Flight Modes (VTOL)](../flight_modes_vtol/index.md)
|
||||
- [Drive Modes (Differential Rover)](../flight_modes_rover/differential.md)
|
||||
- [Drive Modes (Ackermann Rover)](../flight_modes_rover/ackermann.md)
|
||||
|
||||
:::info
|
||||
本节中的模式子主题包含所有机体共有的信息,但可能与正常/默认设置无关。
|
||||
一般来说,你应该首先看到特定机体的章节,并在关联导航到这些通用的章节。
|
||||
:::
|
||||
@@ -0,0 +1 @@
|
||||
<Redirect to="../flight_modes_fw/manual" />
|
||||
@@ -0,0 +1 @@
|
||||
<Redirect to="../flight_modes_mc/manual_stabilized" />
|
||||
@@ -0,0 +1 @@
|
||||
<Redirect to="../flight_modes_vtol/mission" />
|
||||
@@ -0,0 +1,288 @@
|
||||
# Offboard 模式
|
||||
|
||||
<img src="../../assets/site/position_fixed.svg" title="Position fix required (e.g. GPS)" width="30px" />
|
||||
|
||||
飞行器根据飞行控制栈外部(如机载计算机)提供的设定值控制位置、速度、加速度、姿态以及推力/力矩。
|
||||
The setpoints may be provided using MAVLink (or a MAVLink API such as [MAVSDK](https://mavsdk.mavlink.io/)) or by [ROS 2](../ros2/index.md).
|
||||
|
||||
PX4 requires that the external controller provides a continuous 2Hz "proof of life" signal, by streaming any of the supported MAVLink setpoint messages or the ROS 2 [OffboardControlMode](../msg_docs/OffboardControlMode.md) message.
|
||||
PX4只有在收到该种信号超过1秒后才有效,如果该种信号停止飞行控制栈将重新获得控制权(脱离Offboard模式)。
|
||||
|
||||
::: info
|
||||
|
||||
- 此模式需要位置或位/姿信息 - 例如 GPS、光流、视觉惯性里程计、mocap 等。
|
||||
- RC control is disabled except to change modes (you can also fly without any manual controller at all by setting the parameter [COM_RC_IN_MODE](../advanced_config/parameter_reference.md#COM_RC_IN_MODE) to 4: Stick input disabled).
|
||||
- The vehicle must be already be receiving a stream of MAVLink setpoint messages or ROS 2 [OffboardControlMode](../msg_docs/OffboardControlMode.md) messages before arming in offboard mode or switching to offboard mode when flying.
|
||||
- The vehicle will exit offboard mode if MAVLink setpoint messages or `OffboardControlMode` are not received at a rate of > 2Hz.
|
||||
- 并非所有 MAVLink 支持的坐标系和字段值都被设定值消息和飞行器支持。
|
||||
Read the sections below _carefully_ to ensure only supported values are used.
|
||||
|
||||
:::
|
||||
|
||||
## 描述
|
||||
|
||||
Offboard模式通过设置位置、速度、加速、姿态、姿态角速率或力/扭矩设定值来控制飞行器的位置和姿态。
|
||||
|
||||
PX4 must receive a stream of MAVLink setpoint messages or the ROS 2 [OffboardControlMode](../msg_docs/OffboardControlMode.md) at 2 Hz as proof that the external controller is healthy.
|
||||
该消息必须持续发送1秒以上PX4才能在Offboard模式下解锁或在飞行中切换至Offboard模式。
|
||||
If the rate falls below 2Hz while under external control PX4 will switch out of offboard mode after a timeout ([COM_OF_LOSS_T](#COM_OF_LOSS_T)), and attempt to land or perform some other failsafe action.
|
||||
The action depends on whether or not RC control is available, and is defined in the parameter [COM_OBL_RC_ACT](#COM_OBL_RC_ACT).
|
||||
|
||||
当使用 MAVLink 时,设定值消息既传达了外部控制器"正常运行"的信号也传达了设定值本身。
|
||||
Offboard模式下要保持位置,飞行器必须接收到一个包含当前位置设定值的消息指令。
|
||||
|
||||
When using ROS 2 the proof that the external source is alive is provided by a stream of [OffboardControlMode](../msg_docs/OffboardControlMode.md) messages, while the actual setpoint is provided by publishing to one of the setpoint uORB topics, such as [TrajectorySetpoint](../msg_docs/TrajectorySetpoint.md).
|
||||
In order to hold position in this case the vehicle must receive a stream of `OffboardControlMode` but would only need the `TrajectorySetpoint` once.
|
||||
|
||||
请注意,Offboard模式只支持比较有限的 MAVLink 指令和消息。
|
||||
其他操作如起飞、降落、返航,最好使用适当的模式来处理。
|
||||
像上传、下载任务这样的操作可以在任何模式下执行。
|
||||
|
||||
## ROS 2 消息
|
||||
|
||||
以下 ROS 2 消息及其特定字段和字段值在特定的框架下是允许的。
|
||||
In addition to providing heartbeat functionality, `OffboardControlMode` has two other main purposes:
|
||||
|
||||
1. Controls the level of the [PX4 control architecture](../flight_stack/controller_diagrams.md) at which offboard setpoints must be injected, and disables the bypassed controllers.
|
||||
2. 确定需要哪种有效估计(位置或速度),以及应该使用哪种设定值消息。
|
||||
|
||||
The `OffboardControlMode` message is defined as shown.
|
||||
|
||||
```sh
|
||||
# Off-board control mode
|
||||
|
||||
uint64 timestamp # time since system start (microseconds)
|
||||
|
||||
bool position
|
||||
bool velocity
|
||||
bool acceleration
|
||||
bool attitude
|
||||
bool body_rate
|
||||
bool thrust_and_torque
|
||||
bool direct_actuator
|
||||
```
|
||||
|
||||
The fields are ordered in terms of priority such that `position` takes precedence over `velocity` and later fields, `velocity` takes precedence over `acceleration`, and so on.
|
||||
第一个非零字段(从上到下) 定义了Offboard模式所需的有效估计以及可用的设定值消息。
|
||||
For example, if the `acceleration` field is the first non-zero value, then PX4 requires a valid `velocity estimate`, and the setpoint must be specified using the `TrajectorySetpoint` message.
|
||||
|
||||
| 期望控制对象 | 位置 | 速度 | 加速度 | 姿态 | 姿态角速率 | 执行器字段 | 直接给电机 | 所需状态估计 | 所需消息 |
|
||||
| ------------------------------ | --------------------------- | --------------------------- | --------------------------- | --------------------------- | --------------------------- | --------------------------- | --------------------------- | ------ | ------------------------------------------------------------------------------------------------------------------------------- |
|
||||
| 位置 (NED) | ✓ | - | - | - | - | - | - | 位置 | [TrajectorySetpoint](../msg_docs/TrajectorySetpoint.md) |
|
||||
| 速度 (NED) | ✗ | ✓ | - | - | - | - | - | 速度 | [TrajectorySetpoint](../msg_docs/TrajectorySetpoint.md) |
|
||||
| 加速度(NED) | ✗ | ✗ | ✓ | - | - | - | - | 速度 | [TrajectorySetpoint](../msg_docs/TrajectorySetpoint.md) |
|
||||
| 姿态(FRD) | ✗ | ✗ | ✗ | ✓ | - | - | - | 无 | [VehicleAttitudeSetpoint](../msg_docs/VehicleAttitudeSetpoint.md) |
|
||||
| 体轴角速率 (FRD) | ✗ | ✗ | ✗ | ✗ | ✓ | - | - | 无 | [VehicleRatesSetpoint](../msg_docs/VehicleRatesSetpoint.md) |
|
||||
| 推力和力矩(FRD) | ✗ | ✗ | ✗ | ✗ | ✗ | ✓ | - | 无 | [VehicleThrustSetpoint](../msg_docs/VehicleThrustSetpoint.md) and [VehicleTorqueSetpoint](../msg_docs/VehicleTorqueSetpoint.md) |
|
||||
| 直接给电机和舵机 | ✗ | ✗ | ✗ | ✗ | ✗ | ✗ | ✓ | 无 | [ActuatorMotors](../msg_docs/ActuatorMotors.md) and [ActuatorServos](../msg_docs/ActuatorServos.md) |
|
||||
|
||||
where ✓ means that the bit is set, ✘ means that the bit is not set and `-` means that the bit is value is irrelevant.
|
||||
|
||||
:::info
|
||||
Before using offboard mode with ROS 2, please spend a few minutes understanding the different [frame conventions](../ros2/user_guide.md#ros-2-px4-frame-conventions) that PX4 and ROS 2 use.
|
||||
:::
|
||||
|
||||
### 旋翼机
|
||||
|
||||
- [px4_msgs::msg::TrajectorySetpoint](https://github.com/PX4/PX4-Autopilot/blob/main/msg/TrajectorySetpoint.msg)
|
||||
|
||||
- 支持以下输入组合:
|
||||
|
||||
- Position setpoint (`position` different from `NaN`). Non-`NaN` values of velocity and acceleration are used as feedforward terms for the inner loop controllers.
|
||||
- Velocity setpoint (`velocity` different from `NaN` and `position` set to `NaN`). Non-`NaN` values acceleration are used as feedforward terms for the inner loop controllers.
|
||||
- Acceleration setpoint (`acceleration` different from `NaN` and `position` and `velocity` set to `NaN`)
|
||||
|
||||
- 所有值都是基于NED(北, 东, 地)坐标系,位置、速度和加速的单位分别为\[m\], \[m/s\] 和\[m/s^2\] 。
|
||||
|
||||
- [px4_msgs::msg::VehicleAttitudeSetpoint](https://github.com/PX4/PX4-Autopilot/blob/main/msg/VehicleAttitudeSetpoint.msg)
|
||||
|
||||
- 支持以下输入组合:
|
||||
|
||||
- quaternion `q_d` + thrust setpoint `thrust_body`.
|
||||
Non-`NaN` values of `yaw_sp_move_rate` are used as feedforward terms expressed in Earth frame and in \[rad/s\].
|
||||
|
||||
- 姿态四元数表示无人机机体坐标系FRD(前、右、下) 与NED坐标系之间的旋转。 这个推力是在无人机体轴FRD坐标系下,并归一化为 \[-1, 1\] 。
|
||||
|
||||
- [px4_msgs::msg::VehicleRatesSetpoint](https://github.com/PX4/PX4-Autopilot/blob/main/msg/VehicleRatesSetpoint.msg)
|
||||
|
||||
- 支持以下输入组合:
|
||||
|
||||
- `roll`, `pitch`, `yaw` and `thrust_body`.
|
||||
|
||||
- 所有值都表示在无人机体轴FRD坐标系下。 角速率(roll, pitch, yaw) 单位为\[rad/s\] ,thrust_body归一化为 \[-1, 1\]。
|
||||
|
||||
### Generic Vehicle
|
||||
|
||||
下面的offboard控制模式会绕过所有PX4内部的控制环,应当非常谨慎地使用。
|
||||
|
||||
- [px4_msgs::msg::VehicleThrustSetpoint](https://github.com/PX4/PX4-Autopilot/blob/main/msg/VehicleThrustSetpoint.msg) + [px4_msgs::msg::VehicleTorqueSetpoint](https://github.com/PX4/PX4-Autopilot/blob/main/msg/VehicleTorqueSetpoint.msg)
|
||||
|
||||
- 支持以下输入组合:
|
||||
- `xyz` for thrust and `xyz` for torque.
|
||||
- 所有值都在无人机体轴 FRD 坐标系中表示,并且归一化为\[-1, 1\]。
|
||||
|
||||
- [px4_msgs::msg::ActuatorMotors](https://github.com/PX4/PX4-Autopilot/blob/main/msg/ActuatorMotors.msg) + [px4_msgs::msg::ActuatorServos](https://github.com/PX4/PX4-Autopilot/blob/main/msg/ActuatorServos.msg)
|
||||
- 直接控制电机输出和/或伺服系统(舵机)输出。
|
||||
- Currently works at lower level than then `control_allocator` module. Do not publish these messages when not in offboard mode.
|
||||
- 所有值归一化为\[-1, 1\]。 For outputs that do not support negative values, negative entries map to `NaN`.
|
||||
- `NaN` maps to disarmed.
|
||||
|
||||
## MAVLink 消息
|
||||
|
||||
下面的 MAVLink 消息及其特定字段和字段值在特定的帧下是允许的。
|
||||
|
||||
### 直升机/垂直起降
|
||||
|
||||
- [SET_POSITION_TARGET_LOCAL_NED](https://mavlink.io/en/messages/common.html#SET_POSITION_TARGET_LOCAL_NED)
|
||||
|
||||
- The following input combinations are supported: <!-- https://github.com/PX4/PX4-Autopilot/blob/main/src/lib/FlightTasks/tasks/Offboard/FlightTaskOffboard.cpp#L166-L170 -->
|
||||
|
||||
- Position setpoint (only `x`, `y`, `z`)
|
||||
- Velocity setpoint (only `vx`, `vy`, `vz`)
|
||||
- Acceleration setpoint (only `afx`, `afy`, `afz`)
|
||||
- Position setpoint **and** velocity setpoint (the velocity setpoint is used as feedforward; it is added to the output of the position controller and the result is used as the input to the velocity controller).
|
||||
- Position setpoint **and** velocity setpoint **and** acceleration (the velocity and the acceleration setpoints are used as feedforwards; the velocity setpoint is added to the output of the position controller and the result is used as the input to the velocity controller; the acceleration setpoint is added to the output of the velocity controller and the result used to compute the thrust vector).
|
||||
|
||||
- PX4 supports the following `coordinate_frame` values (only): [MAV_FRAME_LOCAL_NED](https://mavlink.io/en/messages/common.html#MAV_FRAME_LOCAL_NED) and [MAV_FRAME_BODY_NED](https://mavlink.io/en/messages/common.html#MAV_FRAME_BODY_NED).
|
||||
|
||||
- [SET_POSITION_TARGET_GLOBAL_INT](https://mavlink.io/en/messages/common.html#SET_POSITION_TARGET_GLOBAL_INT)
|
||||
|
||||
- The following input combinations are supported: <!-- https://github.com/PX4/PX4-Autopilot/blob/main/src/lib/FlightTasks/tasks/Offboard/FlightTaskOffboard.cpp#L166-L170 -->
|
||||
|
||||
- Position setpoint (only `lat_int`, `lon_int`, `alt`)
|
||||
|
||||
- Velocity setpoint (only `vx`, `vy`, `vz`)
|
||||
|
||||
- _Thrust_ setpoint (only `afx`, `afy`, `afz`)
|
||||
|
||||
::: info
|
||||
Acceleration setpoint values are mapped to create a normalized thrust setpoint (i.e. acceleration setpoints are not "properly" supported).
|
||||
|
||||
:::
|
||||
|
||||
- Position setpoint **and** velocity setpoint (the velocity setpoint is used as feedforward; it is added to the output of the position controller and the result is used as the input to the velocity controller).
|
||||
|
||||
- PX4 supports the following `coordinate_frame` values (only): [MAV_FRAME_GLOBAL](https://mavlink.io/en/messages/common.html#MAV_FRAME_GLOBAL).
|
||||
|
||||
- [SET_ATTITUDE_TARGET](https://mavlink.io/en/messages/common.html#SET_ATTITUDE_TARGET)
|
||||
- 支持以下输入组合:
|
||||
- Attitude/orientation (`SET_ATTITUDE_TARGET.q`) with thrust setpoint (`SET_ATTITUDE_TARGET.thrust`).
|
||||
- Body rate (`SET_ATTITUDE_TARGET` `.body_roll_rate` ,`.body_pitch_rate`, `.body_yaw_rate`) with thrust setpoint (`SET_ATTITUDE_TARGET.thrust`).
|
||||
|
||||
### Fixed-wing
|
||||
|
||||
- [SET_POSITION_TARGET_LOCAL_NED](https://mavlink.io/en/messages/common.html#SET_POSITION_TARGET_LOCAL_NED)
|
||||
|
||||
- The following input combinations are supported (via `type_mask`): <!-- https://github.com/PX4/PX4-Autopilot/blob/main/src/lib/FlightTasks/tasks/Offboard/FlightTaskOffboard.cpp#L166-L170 -->
|
||||
|
||||
- Position setpoint (`x`, `y`, `z` only; velocity and acceleration setpoints are ignored).
|
||||
|
||||
- Specify the _type_ of the setpoint in `type_mask` (if these bits are not set the vehicle will fly in a flower-like pattern):
|
||||
::: info
|
||||
Some of the _setpoint type_ values below are not part of the MAVLink standard for the `type_mask` field.
|
||||
|
||||
:::
|
||||
|
||||
值为:
|
||||
|
||||
- 292:滑动设定值。
|
||||
这会将 TECS 配置为空速优先于高度,以便在没有推力时使无人机滑行(即控制俯仰以调节空速)。
|
||||
It is equivalent to setting `type_mask` as `POSITION_TARGET_TYPEMASK_Z_IGNORE`, `POSITION_TARGET_TYPEMASK_VZ_IGNORE`, `POSITION_TARGET_TYPEMASK_AZ_IGNORE`.
|
||||
- 4096:起飞设定值。
|
||||
- 8192:降落设定值。
|
||||
- 12288:悬停设定值(以设定值为中心绕圈飞行)。
|
||||
- 16384:空闲设定值(油门为0, 横滚 / 俯仰为0)。
|
||||
|
||||
- PX4 supports the coordinate frames (`coordinate_frame` field): [MAV_FRAME_LOCAL_NED](https://mavlink.io/en/messages/common.html#MAV_FRAME_LOCAL_NED) and [MAV_FRAME_BODY_NED](https://mavlink.io/en/messages/common.html#MAV_FRAME_BODY_NED).
|
||||
|
||||
- [SET_POSITION_TARGET_GLOBAL_INT](https://mavlink.io/en/messages/common.html#SET_POSITION_TARGET_GLOBAL_INT)
|
||||
|
||||
- The following input combinations are supported (via `type_mask`): <!-- https://github.com/PX4/PX4-Autopilot/blob/main/src/lib/FlightTasks/tasks/Offboard/FlightTaskOffboard.cpp#L166-L170 -->
|
||||
|
||||
- Position setpoint (only `lat_int`, `lon_int`, `alt`)
|
||||
|
||||
- Specify the _type_ of the setpoint in `type_mask` (if these bits are not set the vehicle will fly in a flower-like pattern):
|
||||
|
||||
::: info
|
||||
The _setpoint type_ values below are not part of the MAVLink standard for the `type_mask` field.
|
||||
|
||||
:::
|
||||
|
||||
值为:
|
||||
|
||||
- 4096:起飞设定值。
|
||||
- 8192:降落设定值。
|
||||
- 12288:悬停设定值(以设定值为中心绕圈飞行)。
|
||||
- 16384:空闲设定值(油门为0, 横滚 / 俯仰为0)。
|
||||
|
||||
- PX4 supports the following `coordinate_frame` values (only): [MAV_FRAME_GLOBAL](https://mavlink.io/en/messages/common.html#MAV_FRAME_GLOBAL).
|
||||
|
||||
- [SET_ATTITUDE_TARGET](https://mavlink.io/en/messages/common.html#SET_ATTITUDE_TARGET)
|
||||
- 支持以下输入组合:
|
||||
- Attitude/orientation (`SET_ATTITUDE_TARGET.q`) with thrust setpoint (`SET_ATTITUDE_TARGET.thrust`).
|
||||
- Body rate (`SET_ATTITUDE_TARGET` `.body_roll_rate` ,`.body_pitch_rate`, `.body_yaw_rate`) with thrust setpoint (`SET_ATTITUDE_TARGET.thrust`).
|
||||
|
||||
### 无人车
|
||||
|
||||
- [SET_POSITION_TARGET_LOCAL_NED](https://mavlink.io/en/messages/common.html#SET_POSITION_TARGET_LOCAL_NED)
|
||||
|
||||
- The following input combinations are supported (in `type_mask`): <!-- https://github.com/PX4/PX4-Autopilot/blob/main/src/lib/FlightTasks/tasks/Offboard/FlightTaskOffboard.cpp#L166-L170 -->
|
||||
|
||||
- Position setpoint (only `x`, `y`, `z`)
|
||||
|
||||
- Specify the _type_ of the setpoint in `type_mask`:
|
||||
|
||||
::: info
|
||||
The _setpoint type_ values below are not part of the MAVLink standard for the `type_mask` field.
|
||||
::
|
||||
|
||||
值为:
|
||||
|
||||
- 12288:悬停设定值(无人机足够接近设定值时会停止)。
|
||||
|
||||
- Velocity setpoint (only `vx`, `vy`, `vz`)
|
||||
|
||||
- PX4 supports the coordinate frames (`coordinate_frame` field): [MAV_FRAME_LOCAL_NED](https://mavlink.io/en/messages/common.html#MAV_FRAME_LOCAL_NED) and [MAV_FRAME_BODY_NED](https://mavlink.io/en/messages/common.html#MAV_FRAME_BODY_NED).
|
||||
|
||||
- [SET_POSITION_TARGET_GLOBAL_INT](https://mavlink.io/en/messages/common.html#SET_POSITION_TARGET_GLOBAL_INT)
|
||||
|
||||
- The following input combinations are supported (in `type_mask`): <!-- https://github.com/PX4/PX4-Autopilot/blob/main/src/lib/FlightTasks/tasks/Offboard/FlightTaskOffboard.cpp#L166-L170 -->
|
||||
- Position setpoint (only `lat_int`, `lon_int`, `alt`)
|
||||
|
||||
- Specify the _type_ of the setpoint in `type_mask` (not part of the MAVLink standard).
|
||||
值为:
|
||||
|
||||
- 下面的比特位没有置位,是正常表现。
|
||||
- 12288:悬停设定值(无人机足够接近设定值时会停止)。
|
||||
|
||||
- PX4 supports the coordinate frames (`coordinate_frame` field): [MAV_FRAME_GLOBAL](https://mavlink.io/en/messages/common.html#MAV_FRAME_GLOBAL).
|
||||
|
||||
- [SET_ATTITUDE_TARGET](https://mavlink.io/en/messages/common.html#SET_ATTITUDE_TARGET)
|
||||
- 支持以下输入组合:
|
||||
- Attitude/orientation (`SET_ATTITUDE_TARGET.q`) with thrust setpoint (`SET_ATTITUDE_TARGET.thrust`).
|
||||
::: info
|
||||
Only the yaw setting is actually used/extracted.
|
||||
|
||||
:::
|
||||
|
||||
## Offboard参数
|
||||
|
||||
_Offboard mode_ is affected by the following parameters:
|
||||
|
||||
| 参数 | 描述 |
|
||||
| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||
| <a id="COM_OF_LOSS_T"></a>[COM_OF_LOSS_T](../advanced_config/parameter_reference.md#COM_OF_LOSS_T) | Time-out (in seconds) to wait when offboard connection is lost before triggering offboard lost failsafe (`COM_OBL_RC_ACT`) |
|
||||
| <a id="COM_OBL_RC_ACT"></a>[COM_OBL_RC_ACT](../advanced_config/parameter_reference.md#COM_OBL_RC_ACT) | Flight mode to switch to if offboard control is lost (Values are - `0`: _Position_, `1`: _Altitude_, `2`: _Manual_, `3`: \*Return, `4`: \*Land\*). |
|
||||
| <a id="COM_RC_OVERRIDE"></a>[COM_RC_OVERRIDE](../advanced_config/parameter_reference.md#COM_RC_OVERRIDE) | Controls whether stick movement on a multicopter (or VTOL in MC mode) causes a mode change to [Position mode](../flight_modes_mc/position.md). 默认情况下未启用此功能。 |
|
||||
| <a id="COM_RC_STICK_OV"></a>[COM_RC_STICK_OV](../advanced_config/parameter_reference.md#COM_RC_STICK_OV) | The amount of stick movement that causes a transition to [Position mode](../flight_modes_mc/position.md) (if [COM_RC_OVERRIDE](#COM_RC_OVERRIDE) is enabled). |
|
||||
| <a id="COM_RCL_EXCEPT"></a>[COM_RCL_EXCEPT](../advanced_config/parameter_reference.md#COM_RCL_EXCEPT) | 该参数指定一种模式,在该模式下将忽略RC丢失及不会触发RC丢失的失效保护动作。 Set bit `2` to ignore RC loss in Offboard mode. |
|
||||
|
||||
## 开发者资源
|
||||
|
||||
Typically developers do not directly work at the MAVLink layer, but instead use a robotics API like [MAVSDK](https://mavsdk.mavlink.io/) or [ROS](http://www.ros.org/) (these provide a developer friendly API, and take care of managing and maintaining connections, sending messages and monitoring responses - the minutiae of working with _Offboard mode_ and MAVLink).
|
||||
|
||||
以下资源可能对开发者有用:
|
||||
|
||||
- [Offboard Control from Linux](../ros/offboard_control.md)
|
||||
- [ROS/MAVROS Offboard Example (C++)](../ros/mavros_offboard_cpp.md)
|
||||
- [ROS/MAVROS Offboard Example (Python)](../ros/mavros_offboard_python.md)
|
||||
@@ -0,0 +1 @@
|
||||
<Redirect to="../flight_modes_mc/orbit" />
|
||||
@@ -0,0 +1 @@
|
||||
<Redirect to="../flight_modes_fw/position" />
|
||||
@@ -0,0 +1 @@
|
||||
<Redirect to="../flight_modes_mc/position" />
|
||||
@@ -0,0 +1,219 @@
|
||||
# 返航模式
|
||||
|
||||
<img src="../../assets/site/position_fixed.svg" title="Position fix required (e.g. GPS)" width="30px" />
|
||||
|
||||
The _Return_ flight mode is used to _fly a vehicle to safety_ on an unobstructed path to a safe destination, where it should land.
|
||||
|
||||
PX4 提供了几种机制来选择安全的返航路径,返航目的地和着陆,包括使用其实位置,集结(“安全”)点,任务路径和任务着陆顺序。
|
||||
|
||||
- [Multicopter](../flight_modes_mc/return.md)
|
||||
- [Fixed-wing (Plane)](../flight_modes_fw/return.md)
|
||||
- [VTOL](../flight_modes_vtol/return.md)
|
||||
|
||||
::: info
|
||||
|
||||
- Mode is automatic - no user intervention is _required_ to control the vehicle.
|
||||
- Mode requires a global 3d position estimate (from GPS or inferred from a [local position](../ros/external_position_estimation.md#enabling-auto-modes-with-a-local-position)).
|
||||
- Flying vehicles can't switch to this mode without global position.
|
||||
- Flying vehicles will failsafe if they lose the position estimate.
|
||||
- Mode requires home position is set.
|
||||
- Mode prevents arming (vehicle must be armed when switching to this mode).
|
||||
- 遥控开关可以在任何无人机上更改飞行模式。
|
||||
- RC stick movement in a multicopter (or VTOL in multicopter mode) will [by default](#COM_RC_OVERRIDE) change the vehicle to [Position mode](../flight_modes_mc/position.md) unless handling a critical battery failsafe.
|
||||
- A VTOL will return as MC or FW based on its mode at the point the return mode was triggered.
|
||||
In MC mode it will respect multicopter parameters, such as the landing "cone".
|
||||
In FW mode it will respect fixed-wing parameters (ignore the cone), but unless using a mission landing, will transition to MC mode and land at the destination after loitering at the descent altitude.
|
||||
|
||||
<!-- https://github.com/PX4/PX4-Autopilot/blob/main/src/modules/commander/ModeUtil/mode_requirements.cpp -->
|
||||
|
||||
:::
|
||||
|
||||
## 综述
|
||||
|
||||
PX4 provides several mechanisms for choosing a safe return path, destination and landing, including using home location, rally ("safe") points, mission paths, and landing sequences defined in a mission.
|
||||
|
||||
All vehicles _nominally_ support all of these mechanisms, but not all of them make as much sense for particular vehicles.
|
||||
For example, a multicopter can land virtually anywhere, so it doesn't make sense for it to use a landing sequence except in rare cases.
|
||||
Similarly, a fixed-wing vehicle needs to fly a safe landing path: it can use the home location as a return point, but it won't try and land on it by default.
|
||||
|
||||
This topic covers all the possible return types that any vehicle _might_ be configured to use — the vehicle-specific return mode topics cover the default/recommended return type and configuration for each vehicle.
|
||||
|
||||
The following sections explain how to configure the [return type](#return_types), [minimum return altitude](#minimum-return-altitude) and [landing/arrival behaviour](#loiter-landing-at-destination).
|
||||
|
||||
<a id="return_types"></a>
|
||||
|
||||
## 返航类型(RTL_TYPE)
|
||||
|
||||
PX4 provides four alternative approaches for finding an unobstructed path to a safe destination and/or landing, which are set using the [RTL_TYPE](#RTL_TYPE) parameter.
|
||||
|
||||
At high level these are:
|
||||
|
||||
- [Home/rally point return](#home_return) (`RTL_TYPE=0`): Ascend to safe altitude and return via a direct path to the closest rally point or home location.
|
||||
- [Mission landing/rally point return](#mission-landing-rally-point-return-type-rtl-type-1) (`RTL_TYPE=1`): Ascend to a safe altitude, fly direct to the closest destination _other than home_: rally point or start of mission landing.
|
||||
如果未定义任务着陆点或集结点,请通过直接路径返回起始位置。
|
||||
- [Mission path return](#mission-path-return-type-rtl-type-2) (`RTL_TYPE=2`): Use mission path and fast-continue to mission landing (if defined).
|
||||
If no mission _landing_ defined, fast-reverse mission to home.
|
||||
If no _mission_ defined, return direct to home (rally points are ignored).
|
||||
- [Closest safe destination return](#closest-safe-destination-return-type-rtl-type-3) (`RTL_TYPE=3`): Ascend to a safe altitude and return via direct path to closest destination: home, start of mission landing pattern, or rally point.
|
||||
如果目的地是飞行任务着陆模式,则按照该模式降落。
|
||||
|
||||
以下各节提供了每种类型的更详细说明。
|
||||
|
||||
<a id="home_return"></a>
|
||||
|
||||
### 起始位置/集结点返航类型(RTL_TYPE=0)
|
||||
|
||||
This is the default return type for a [multicopter](../flight_modes_mc/return.md) (see topic for more information).
|
||||
|
||||
无人机在该返航类型中:
|
||||
|
||||
- Ascends to a safe [minimum return altitude](#minimum-return-altitude) (above any expected obstacles).
|
||||
- 通过直接路径飞往起始位置或集结点(以最近者为准)。
|
||||
- On [arrival](#loiter-landing-at-destination) descends to "descent altitude" and waits for a configurable time.
|
||||
This time may be used to deploy landing gear.
|
||||
- Lands or waits (this depends on landing parameters),
|
||||
By default an MC or VTOL in MC mode will land and a fixed-wing vehicle circles at the descent altitude.
|
||||
A VTOL in FW mode aligns its heading to the destination point, transitions to MC mode, and then lands.
|
||||
|
||||
:::info
|
||||
If no rally points are defined, this is the same as a _Return to Launch_ (RTL)/_Return to Home_ (RTH).
|
||||
:::
|
||||
|
||||
### 任务着陆/集结点返航类型 (RTL_TYPE=1)
|
||||
|
||||
This is the default return type for a [fixed-wing](../flight_modes_fw/return.md) or [VTOL](../flight_modes_vtol/return.md) vehicle (see topics for more information).
|
||||
|
||||
无人机在该返航类型中:
|
||||
|
||||
- Ascends to a safe [minimum return altitude](#minimum-return-altitude) (above any expected obstacles) if needed.
|
||||
The vehicle maintains its initial altitude if that is higher than the minimum return altitude.
|
||||
- Flies via direct constant-altitude path to a rally point or the start of a [mission landing pattern](#mission-landing-pattern) (whichever is closest).
|
||||
如果未定义任务降落或集结点,无人机通过直接路径返回到起始位置。
|
||||
- 如果目的地是飞行任务着陆模式,则按照该模式降落。
|
||||
- If the destination is a rally point or home it will [land or wait](#loiter-landing-at-destination) at descent altitude (depending on landing parameters).
|
||||
By default an MC or VTOL in MC mode will land, and a fixed-wing vehicle circles at the descent altitude.
|
||||
A VTOL in FW mode aligns its heading to the destination point, transitions to MC mode, and then lands.
|
||||
|
||||
:::info
|
||||
Fixed wing vehicles commonly also set [MIS_TKO_LAND_REQ](#MIS_TKO_LAND_REQ) to _require_ a mission landing pattern.
|
||||
:::
|
||||
|
||||
### 任务路径返航类型(RTL_TYPE=2)
|
||||
|
||||
This return type uses the mission (if defined) to provide a safe return _path_, and the [mission landing pattern](#mission-landing-pattern) (if defined) to provide landing behaviour.
|
||||
If there is a mission but no mission landing pattern, the mission is flown _in reverse_.
|
||||
集结点,如果有的话,将被忽略。
|
||||
|
||||
:::info
|
||||
The behaviour is fairly complex because it depends on the flight mode, and whether a mission and mission landing are defined.
|
||||
:::
|
||||
|
||||
Mission _with_ landing pattern:
|
||||
|
||||
- **Mission mode:** Mission is continued in "fast-forward mode" (jumps, delay and any other non-position commands ignored, loiter and other position waypoints converted to simple waypoints) and then lands.
|
||||
- **Auto mode other than mission mode:**
|
||||
- Ascend to a safe [minimum return altitude](#minimum-return-altitude) above any expected obstacles.
|
||||
- 直接飞到最近的航点(对固定翼而言,不是着陆航点),然后降落到航点高度。
|
||||
- 从该航点以快速模式继续执行任务。
|
||||
- **Manual modes:**
|
||||
- Ascend to a safe [minimum return altitude](#minimum-return-altitude) above any expected obstacles.
|
||||
- 直接飞到降落序列位置并下降到航点高度。
|
||||
- 使用任务降落模式着陆。
|
||||
|
||||
Mission _without_ landing pattern defined:
|
||||
|
||||
- **Mission mode:**
|
||||
- 从上一个航点开始以“快退”(反向)飞行的任务
|
||||
- 跳,延迟和其他任何非定位命令都会被忽略,悬停和其他位置航点将转换为简单航点。
|
||||
- VTOL 无人机在反向飞行任务之前切换到固定翼模式(如果需要)。
|
||||
- On reaching waypoint 1, the vehicle ascends to the [minimum return altitude](#minimum-return-altitude) and flies to the home position (where it [lands or waits](#loiter-landing-at-destination)).
|
||||
- **Auto mode other than mission mode:**
|
||||
- 直接飞到最近的航点(对固定翼而言,不是着陆航点),然后降落到航点高度。
|
||||
- 反向执行任务,就像在任务模式中触发返航模式一样(上图)。
|
||||
- **Manual modes:** Fly directly to home location and land.
|
||||
|
||||
如果未定义任务,PX4 将直接飞回起始位置并着陆(集结点将被忽略)。
|
||||
|
||||
如果任务在返航模式期间发生更改,则将按照与上述相同的规则根据新任务重新评估行为(例如,如果新任务没有降落顺序并且你在一个任务中,则任务将被逆转)。
|
||||
|
||||
### 最近的安全目的地返回类型(RTL_TYPE=3)
|
||||
|
||||
无人机在该返航类型中:
|
||||
|
||||
- Ascends to a safe [minimum return altitude](#minimum-return-altitude) (above any expected obstacles).
|
||||
- 飞到最近目的地的直接路径:起始位置,任务着陆模式或集结点。
|
||||
- If the destination is a [mission landing pattern](#mission-landing-pattern) the vehicle will follow the pattern to land.
|
||||
- If the destination is a home location or rally point, the vehicle will descend to the descent altitude ([RTL_DESCEND_ALT](#RTL_DESCEND_ALT)) and then [lands or waits](#loiter-landing-at-destination).
|
||||
By default an MC or VTOL in MC mode will land, and a fixed-wing vehicle circles at the descent altitude.
|
||||
A VTOL in FW mode aligns its heading to the destination point, transitions to MC mode, and then lands.
|
||||
|
||||
## 悬停/降落在目的地
|
||||
|
||||
For most [return types](#return_types) a vehicle will ascend to a _minimum safe altitude_ before returning (unless already above that altitude), in order to avoid any obstacles between it and the destination.
|
||||
|
||||
:::info
|
||||
The exception is when executing a [mission path return](#mission-path-return-type-rtl-type-2) from _within a mission_.
|
||||
In this case the vehicle follows mission waypoints, which we assume are planned to avoid any obstacles.
|
||||
:::
|
||||
|
||||
The return altitude for a fixed-wing vehicle or a VTOL in fixed-wing mode is configured using the parameter [RTL_RETURN_ALT](#RTL_RETURN_ALT) (does not use the code described in the next paragraph).
|
||||
|
||||
The return altitude for a multicopter or a VTOL vehicles in MC mode is configured using the parameters [RTL_RETURN_ALT](#RTL_RETURN_ALT) and [RTL_CONE_ANG](#RTL_CONE_ANG), which define a half cone centered around the destination (home location or safety point).
|
||||
|
||||

|
||||
|
||||
<!-- Original draw.io diagram can be found here: https://drive.google.com/file/d/1W72XeZYSOkRlBSbPXCCiam9NMAyAWSg-/view?usp=sharing -->
|
||||
|
||||
如果无人机是:
|
||||
|
||||
- Above [RTL_RETURN_ALT](#RTL_RETURN_ALT) (1) it will return at its current altitude.
|
||||
- Below the cone it will return where it intersects the cone (2) or [RTL_DESCEND_ALT](#RTL_DESCEND_ALT) (whichever is higher).
|
||||
- Outside the cone (3) it will first climb until it reaches [RTL_RETURN_ALT](#RTL_RETURN_ALT).
|
||||
- 在圆锥内:
|
||||
- Above [RTL_DESCEND_ALT](#RTL_DESCEND_ALT) (4) it will return at its current altitude.
|
||||
- Below [RTL_DESCEND_ALT](#RTL_DESCEND_ALT) (5) it will first ascend to `RTL_DESCEND_ALT`.
|
||||
|
||||
注意:
|
||||
|
||||
- If [RTL_CONE_ANG](#RTL_CONE_ANG) is 0 degrees there is no "cone":
|
||||
- the vehicle returns at `RTL_RETURN_ALT` (or above).
|
||||
- If [RTL_CONE_ANG](#RTL_CONE_ANG) is 90 degrees the vehicle will return at the greater of `RTL_DESCEND_ALT` and the current altitude.
|
||||
- The vehicle will always ascend at least [RTL_DESCEND_ALT](#RTL_DESCEND_ALT) for the return.
|
||||
|
||||
## 无人机默认行为
|
||||
|
||||
Unless executing a [mission landing pattern](#mission-landing-pattern) as part of the return mode, the vehicle will arrive at its destination, and rapidly descend to the [RTL_DESCEND_ALT](#RTL_DESCEND_ALT) altitude, where it will loiter for [RTL_LAND_DELAY](#RTL_LAND_DELAY) before landing.
|
||||
If `RTL_LAND_DELAY=-1` it will loiter indefinitely.
|
||||
|
||||
The default landing configuration is vehicle dependent:
|
||||
|
||||
- 如果定义了任务降落,直接飞往任务降落起点,然后着陆。
|
||||
- Fixed-wing vehicles use a return mode with a [mission landing pattern](#mission-landing-pattern), as this enables automated landing.
|
||||
If not using a mission landing, the default configuration is to loiter indefinitely, so the user can take over and manually land.
|
||||
- VTOLs in MC mode fly and land exactly as a multicopter.
|
||||
- VTOLS in FW mode head towards the landing point, transition to MC mode, and then land on the destination.
|
||||
|
||||
## Mission Landing Pattern
|
||||
|
||||
A mission landing pattern is a landing pattern defined as part of a mission plan.
|
||||
This consists of a [MAV_CMD_DO_LAND_START](https://mavlink.io/en/messages/common.html#MAV_CMD_DO_LAND_START), one or more position waypoints, and a [MAV_CMD_NAV_LAND](https://mavlink.io/en/messages/common.html#MAV_CMD_NAV_LAND) (or [MAV_CMD_NAV_VTOL_LAND](https://mavlink.io/en/messages/common.html#MAV_CMD_NAV_VTOL_LAND) for a VTOL Vehicle).
|
||||
|
||||
Landing patterns defined in missions are the safest way to automatically land a _fixed-wing_ vehicle on PX4.
|
||||
For this reason fixed-wing vehicles are configured to use [Mission landing/really point return](#mission-landing-rally-point-return-type-rtl-type-1) by default.
|
||||
|
||||
## 参数
|
||||
|
||||
The RTL parameters are listed in [Parameter Reference > Return Mode](../advanced_config/parameter_reference.md#return-mode) (and summarised below).
|
||||
|
||||
| 参数 | 描述 |
|
||||
| -------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||
| <a id="RTL_TYPE"></a>[RTL_TYPE](../advanced_config/parameter_reference.md#RTL_TYPE) | Return mechanism (path and destination).<br>`0`: Return to a rally point or home (whichever is closest) via direct path.<br>`1`: Return to a rally point or the mission landing pattern start point (whichever is closest), via direct path. 如果未定义任务着陆点或集结点,通过直接路径返回起始位置。 If the destination is a mission landing pattern, follow the pattern to land.<br>`2`: Use mission path fast-forward to landing if a landing pattern is defined, otherwise fast-reverse to home. 忽略集结点。 Fly direct to home if no mission plan is defined.<br>`3`: Return via direct path to closest destination: home, start of mission landing pattern or safe point. 如果目的地是飞行任务着陆模式,则按照该模式降落。 |
|
||||
| <a id="RTL_RETURN_ALT"></a>[RTL_RETURN_ALT](../advanced_config/parameter_reference.md#RTL_RETURN_ALT) | Return altitude in meters (default: 60m) when [RTL_CONE_ANG](../advanced_config/parameter_reference.md#RTL_CONE_ANG) is 0. 如果已经超过这个值, 飞机将返回当前的高度。 |
|
||||
| <a id="RTL_DESCEND_ALT"></a>[RTL_DESCEND_ALT](../advanced_config/parameter_reference.md#RTL_DESCEND_ALT) | 最小返航高度和无人机从较高的返航高度到减速或者停止的初始下降高度(默认: 30米)。 |
|
||||
| <a id="RTL_LAND_DELAY"></a>[RTL_LAND_DELAY](../advanced_config/parameter_reference.md#RTL_LAND_DELAY) | Time to wait at `RTL_DESCEND_ALT` before landing (default: 0.5s) -by default this period is short so that the vehicle will simply slow and then land immediately. If set to -1 the system will loiter at `RTL_DESCEND_ALT` rather than landing. 延迟能够使你为起落架的展开部署配置时间(自动触发)。 |
|
||||
| <a id="RTL_MIN_DIST"></a>[RTL_MIN_DIST](../advanced_config/parameter_reference.md#RTL_MIN_DIST) | 能够触发无人机上升到返航高度,距离起始位置的最小水平距离由那个"锥形"指定。 If the vehicle is horizontally closer than this distance to home, it will return at its current altitude or `RTL_DESCEND_ALT` (whichever is higher) instead of first ascending to RTL_RETURN_ALT. |
|
||||
| <a id="RTL_CONE_ANG"></a>[RTL_CONE_ANG](../advanced_config/parameter_reference.md#RTL_CONE_ANG) | 圆锥半角决定无人机的 RTL 返航高度。 数值(度数):0、25、45、65、80、90。 Note that 0 is "no cone" (always return at `RTL_RETURN_ALT` or higher), while 90 indicates that the vehicle must return at the current altitude or `RTL_DESCEND_ALT` (whichever is higher). |
|
||||
| <a id="COM_RC_OVERRIDE"></a>[COM_RC_OVERRIDE](../advanced_config/parameter_reference.md#COM_RC_OVERRIDE) | Controls whether stick movement on a multicopter (or VTOL in MC mode) causes a mode change to [Position mode](../flight_modes_mc/position.md) (except when vehicle is handling a critical battery failsafe). 可以分别为自动模式和 offboard 模式启用此功能,默认情况下在自动模式下启用此功能。 |
|
||||
| <a id="COM_RC_STICK_OV"></a>[COM_RC_STICK_OV](../advanced_config/parameter_reference.md#COM_RC_STICK_OV) | The amount of stick movement that causes a transition to [Position mode](../flight_modes_mc/position.md) (if [COM_RC_OVERRIDE](#COM_RC_OVERRIDE) is enabled). |
|
||||
| <a id="RTL_LOITER_RAD"></a>[RTL_LOITER_RAD](../advanced_config/parameter_reference.md#RTL_LOITER_RAD) | [Fixed-wing Only] The radius of the loiter circle (at [RTL_LAND_DELAY](#RTL_LAND_DELAY)). |
|
||||
| <a id="MIS_TKO_LAND_REQ"></a>[MIS_TKO_LAND_REQ](../advanced_config/parameter_reference.md#MIS_TKO_LAND_REQ) | Specify whether a mission landing or takeoff pattern is _required_. Generally fixed-wing vehicles set this to require a landing pattern but VTOL do not. |
|
||||
@@ -0,0 +1 @@
|
||||
<Redirect to="../flight_modes_fw/stabilized" />
|
||||
@@ -0,0 +1 @@
|
||||
<Redirect to="../flight_modes_mc/takeoff" />
|
||||
Reference in New Issue
Block a user