diff --git a/docs/zh/SUMMARY.md b/docs/zh/SUMMARY.md
index 048ee16c6b..ce8bb6cae4 100644
--- a/docs/zh/SUMMARY.md
+++ b/docs/zh/SUMMARY.md
@@ -7,6 +7,7 @@
- [位置模式(多旋翼)](flight_modes_mc/position.md)
- [Position Slow Mode (MC)](flight_modes_mc/position_slow.md)
- [高度模式(多旋翼)](flight_modes_mc/altitude.md)
+ - [Altitude Cruise Mode (MC)](flight_modes_mc/altitude_cruise.md)
- [Stabilized Mode (MC)](flight_modes_mc/manual_stabilized.md)
- [特技模式(多旋翼)](flight_modes_mc/acro.md)
- [环绕模式(多旋翼)](flight_modes_mc/orbit.md)
diff --git a/docs/zh/advanced_config/tuning_the_ecl_ekf.md b/docs/zh/advanced_config/tuning_the_ecl_ekf.md
index 4f91ebfd61..6fcdfeb902 100644
--- a/docs/zh/advanced_config/tuning_the_ecl_ekf.md
+++ b/docs/zh/advanced_config/tuning_the_ecl_ekf.md
@@ -481,11 +481,11 @@ Position, velocity or orientation measurements from an external vision system, e
The measurements that are fused are configured by setting the appropriate bits of [EKF2_EV_CTRL](../advanced_config/parameter_reference.md#EKF2_EV_CTRL) to `true`:
-- `0`: Horizontal position data
+- `0`: 水平位置数据
- `1`: Vertical position data.
Height sources may additionally be configured using [EKF2_HGT_REF](../advanced_config/parameter_reference.md#EKF2_HGT_REF) (see section [Height](#height)).
-- `2`: Velocity data
-- `3`: Yaw data
+- `2`:速度数据
+- `3`:偏航角数据
Note that if yaw data is used (bit 3) the heading is with respect to the external vision frame; otherwise the heading is relative to North.
diff --git a/docs/zh/assembly/_assembly.md b/docs/zh/assembly/_assembly.md
index 15e97dc7ed..19062417ac 100644
--- a/docs/zh/assembly/_assembly.md
+++ b/docs/zh/assembly/_assembly.md
@@ -72,7 +72,7 @@ The FCs have much the same ports with similar names, and core peripherals are co
| Full GPS plus Safety Switch | GPS1 | GPS&SAFETY | Primary GNSS module (GPS, compass, safety switch, buzzer, LED) |
| Basic GPS | GPS2 | GPS2 | Secondary GNSS module (GNSS/compass) |
| CAN | CAN1/CAN2 | CAN1/CAN2 | DroneCAN devices, such as GNSS modules, motors, etc |
-| Telemetry | TELEM (1,2,3) | TELEM (1,2,3) | Telemetry radios, companion computers, MAVLink cameras, etc. |
+| 数传 | TELEM (1,2,3) | TELEM (1,2,3) | Telemetry radios, companion computers, MAVLink cameras, etc. |
| Analog Power | POWER (1,2) | POWER (1,2) | SMbus (I2C) power modules |
| I2C | I2C | None | Other I2C peripherals |
| SPI | SPI | SPI6 | SPI devices (note: 11 pin, not 6 as in standard) |
diff --git a/docs/zh/camera/fc_connected_camera.md b/docs/zh/camera/fc_connected_camera.md
index f6254eb86b..ea9e1e0164 100644
--- a/docs/zh/camera/fc_connected_camera.md
+++ b/docs/zh/camera/fc_connected_camera.md
@@ -97,13 +97,13 @@ For more information see [Finding/Updating Parameters > Parameters Not In Firmwa
Four different modes are supported, controlled by the [TRIG_MODE](../advanced_config/parameter_reference.md#TRIG_MODE) parameter:
-| Mode | 描述 |
-| ---- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
-| 0 | Camera triggering is disabled. |
-| 1 | Works like a basic intervalometer that can be enabled and disabled by using the MAVLink command `MAV_CMD_DO_TRIGGER_CONTROL`. See [command interface](#mavlink-command-interface) for more details. |
-| 2 | Switches the intervalometer constantly on. |
-| 3 | Triggers based on distance. A shot is taken every time the set horizontal distance is exceeded. The minimum time interval between two shots is however limited by the set triggering interval. |
-| 4 | Triggers automatically when flying a survey in Mission mode. |
+| 模式 | 描述 |
+| -- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
+| 0 | Camera triggering is disabled. |
+| 1 | Works like a basic intervalometer that can be enabled and disabled by using the MAVLink command `MAV_CMD_DO_TRIGGER_CONTROL`. See [command interface](#mavlink-command-interface) for more details. |
+| 2 | Switches the intervalometer constantly on. |
+| 3 | Triggers based on distance. A shot is taken every time the set horizontal distance is exceeded. The minimum time interval between two shots is however limited by the set triggering interval. |
+| 4 | Triggers automatically when flying a survey in Mission mode. |
:::info
If it is your first time enabling the camera trigger app, remember to reboot after changing the `TRIG_MODE` parameter.
diff --git a/docs/zh/concept/flight_modes.md b/docs/zh/concept/flight_modes.md
index 02213e41b4..66a4e79841 100644
--- a/docs/zh/concept/flight_modes.md
+++ b/docs/zh/concept/flight_modes.md
@@ -95,9 +95,9 @@ mode_req_other # other requirements, not covered above (for external
If the condition of restriction is not met:
-- arming is not allowed, while the mode is selected
-- when already armed, the mode cannot be selected
-- when armed and the mode is selected, the relevant failsafe is triggered (e.g. RC loss for the manual control requirement).
+- 在选定模式时不允许进行解锁操作
+- 当已处于武装状态时,该模式无法被选择。
+- 当载具已解锁且该模式被选中时,相关的故障保护机制会被触发(例如,针对手动控制需求的遥控器信号丢失故障保护)。
Check [Safety (Failsafe) Configuration](../config/safety.md) for how to configure failsafe behaviour.
This is the corresponding flow diagram for the manual control flag (`mode_req_manual_control`):
diff --git a/docs/zh/dev_setup/vscode.md b/docs/zh/dev_setup/vscode.md
index 4b699c246b..27d65694fb 100644
--- a/docs/zh/dev_setup/vscode.md
+++ b/docs/zh/dev_setup/vscode.md
@@ -19,7 +19,7 @@ With _VScode_, configuration is stored in the PX4/PX4-Autopilot tree ([PX4-Autop
You must already have installed the command line [PX4 developer environment](../dev_setup/dev_env.md) for your platform and downloaded the _Firmware_ source code repo.
-## Installation & Setup
+## 安装与设置
1. [Download and install VSCode](https://code.visualstudio.com/) (you will be offered the correct version for your OS).
diff --git a/docs/zh/dronecan/ark_rtk_gps.md b/docs/zh/dronecan/ark_rtk_gps.md
index fdecdc4b08..75064c1780 100644
--- a/docs/zh/dronecan/ark_rtk_gps.md
+++ b/docs/zh/dronecan/ark_rtk_gps.md
@@ -27,7 +27,7 @@ Order this module from:
- Safety Button
- 蜂鸣器
- Two Pixhawk Standard CAN Connectors (4 Pin JST GH)
-- F9P “UART 2” Connector
+- F9P `UART 2` Connector
- 3 Pin JST GH
- TX, RX, GND
- Pixhawk Standard Debug Connector (6 Pin JST SH)
@@ -87,6 +87,25 @@ You need to set necessary [DroneCAN](index.md) parameters and define offsets if
- The parameters [EKF2_GPS_POS_X](../advanced_config/parameter_reference.md#EKF2_GPS_POS_X), [EKF2_GPS_POS_Y](../advanced_config/parameter_reference.md#EKF2_GPS_POS_Y) and [EKF2_GPS_POS_Z](../advanced_config/parameter_reference.md#EKF2_GPS_POS_Z) can be set to account for the offset of the ARK RTK GPS from the vehicles centre of gravity.
- Set [CANNODE_TERM](../advanced_config/parameter_reference.md#CANNODE_TERM) to `1` on the GPS if this it that last node on the CAN bus.
+### Setting Up Rover and Fixed Base
+
+Position of the rover is established using RTCM messages from the RTK base module (the base module is connected to QGC, which sends the RTCM information to PX4 via MAVLink).
+
+PX4 DroneCAN parameters:
+
+- [UAVCAN_PUB_RTCM](../advanced_config/parameter_reference.md#UAVCAN_PUB_RTCM):
+ - Makes PX4 publish RTCM messages ([RTCMStream](https://dronecan.github.io/Specification/7._List_of_standard_data_types/#rtcmstream)) to the bus (which it gets from the RTK base module via QGC).
+
+Rover module parameters (also [set using QGC](../dronecan/index.md#qgc-cannode-parameter-configuration)):
+
+- [CANNODE_SUB_RTCM](../advanced_config/parameter_reference.md#CANNODE_SUB_RTCM) tells the rover that it should subscribe to [RTCMStream](https://dronecan.github.io/Specification/7._List_of_standard_data_types/#rtcmstream) RTCM messages on the bus (from the moving base).
+
+:::info
+Use [UAVCAN_PUB_MBD](../advanced_config/parameter_reference.md#UAVCAN_PUB_MBD) and [CANNODE_SUB_MBD](../advanced_config/parameter_reference.md#CANNODE_SUB_MBD) instead if you want to implement moving base (see below) at the same time.
+:::
+
+For more information see [Rover and Fixed Base](../dronecan/index.md#rover-and-fixed-base) in the DroneCAN guide.
+
### Setting Up Moving Baseline & GPS Heading
The simplest way to set up moving baseline and GPS heading with two ARK RTK GPS modules is via CAN, though it can be done via UART to reduce traffic on the CAN bus if desired.
@@ -128,10 +147,11 @@ Setup via UART:
- On the _Moving Base_, set the following:
- [GPS_UBX_MODE](../advanced_config/parameter_reference.md#GPS_UBX_MODE) to `2`.
+For more information see [Rover and Moving Base](../dronecan/index.md#rover-and-moving-base) in the DroneCAN guide.
+
## LED含义
- The GPS status lights are located to the right of the connectors
-
- Blinking green is GPS fix
- Blinking blue is received corrections and RTK Float
- Solid blue is RTK Fixed
diff --git a/docs/zh/dronecan/escs.md b/docs/zh/dronecan/escs.md
index 9742e3739e..547208bf30 100644
--- a/docs/zh/dronecan/escs.md
+++ b/docs/zh/dronecan/escs.md
@@ -9,3 +9,18 @@ For more information, see the following articles for specific hardware/firmware:
- [Vertiq](../peripherals/vertiq.md) (larger modules)
- [VESC Project](../peripherals/vesc.md)
- [RaccoonLab Cyphal and DroneCAN PWM nodes](raccoonlab_nodes.md)
+
+## 硬件配置
+
+General DroneCAN hardware configuration is covered in [DroneCAN > Hardware Setup](../dronecan/index.md#hardware-setup).
+
+DroneCAN ESCs should be on their own dedicated CAN interface(s) because ESC messages can saturate the bus and starve other nodes of bandwidth.
+
+## PX4 配置
+
+DroneCAN peripherals are configured by following the procedure outlined in [DroneCAN](../dronecan/index.md).
+
+In addition to the general setup, such as setting `UAVCAN_ENABLE` to `3`:
+
+- Select the specific CAN interface(s) used for ESC data output using the [UAVCAN_ESC_IFACE](../advanced_config/parameter_reference.md#UAVCAN_ESC_IFACE) parameter (all that all interfaces are selected by default).
+- Configure the [motor order and servo outputs](../config/actuators.md).
diff --git a/docs/zh/dronecan/index.md b/docs/zh/dronecan/index.md
index 7e056d7be2..16915394f8 100644
--- a/docs/zh/dronecan/index.md
+++ b/docs/zh/dronecan/index.md
@@ -276,6 +276,9 @@ PX4 DroneCAN parameters:
[DroneCAN ESCs and servos](../dronecan/escs.md) require the [motor order and servo outputs](../config/actuators.md) to be configured.
+Select the specific CAN interface(s) used for ESC data output using the [UAVCAN_ESC_IFACE](../advanced_config/parameter_reference.md#UAVCAN_ESC_IFACE) parameter (all that all interfaces are selected by default).
+Note that DroneCAN ESCs should be on their own dedicated CAN interface(s) because ESC messages can saturate the bus and starve other nodes of bandwidth.
+
## QGC CANNODE Parameter Configuration
QGroundControl can inspect and modify parameters belonging to CAN devices attached to the flight controller, provided the device are connected to the flight controller before QGC is started.
@@ -313,7 +316,10 @@ If successful, the firmware binary will be removed from the root directory and t
**Q**: The motors aren't spinning when armed.
-**A**: Make sure `UAVCAN_ENABLE` is set to `3` to enable DroneCAN ESC output.
+**A**:
+
+- Make sure `UAVCAN_ENABLE` is set to `3` to enable DroneCAN ESC output.
+- Make sure `UAVCAN_ESC_IFACE` is set to enable the CAN interface(s) used for ESCs.
---
diff --git a/docs/zh/flight_controller/mindracer.md b/docs/zh/flight_controller/mindracer.md
index 14aedd78c0..a520ffd967 100644
--- a/docs/zh/flight_controller/mindracer.md
+++ b/docs/zh/flight_controller/mindracer.md
@@ -44,7 +44,7 @@ The main hardware documentation is [here](http://mindpx.net/assets/accessories/m
| IMU | 10DOF |
| IMU isolation | YES/Optional |
| Radio Receiver | S.BUS/PPM/DSM/DSM2/DSMX/SUMD |
-| Telemetry | FrSky® D.Port, S.Port, Wifi, 3DR radio |
+| 数传 | FrSky® D.Port, S.Port, Wifi, 3DR radio |
| On board TF card for flight data recording | YES |
| OneShot ESC Support | YES |
| Expansion Slots | 2x7(pin)x2 |
diff --git a/docs/zh/flight_controller/modalai_fc_v1.md b/docs/zh/flight_controller/modalai_fc_v1.md
index 1b8239b84d..1e9562b83d 100644
--- a/docs/zh/flight_controller/modalai_fc_v1.md
+++ b/docs/zh/flight_controller/modalai_fc_v1.md
@@ -40,7 +40,7 @@ This flight controller is [manufacturer supported](../flight_controller/autopilo
| microSD Card | [Information on supported cards](../dev_log/logging.md#sd-cards) |
| 输入 | GPS/Mag |
| | Spektrum |
-| | Telemetry |
+| | 数传 |
| | CAN bus |
| | PPM |
| Outputs | 6 LEDs (2xRGB) |
diff --git a/docs/zh/flight_controller/modalai_voxl_flight.md b/docs/zh/flight_controller/modalai_voxl_flight.md
index c77e143538..352fd22892 100644
--- a/docs/zh/flight_controller/modalai_voxl_flight.md
+++ b/docs/zh/flight_controller/modalai_voxl_flight.md
@@ -67,7 +67,7 @@ This flight controller is [manufacturer supported](../flight_controller/autopilo
| microSD Card | [Information on supported cards](../dev_log/logging.md#sd-cards) |
| 输入 | GPS/Mag |
| | Spektrum |
-| | Telemetry |
+| | 数传 |
| | CAN bus |
| | PPM |
| Outputs | 6 LEDs (2xRGB) |
diff --git a/docs/zh/flight_modes_fw/index.md b/docs/zh/flight_modes_fw/index.md
index d6fd66e2f5..0c9f655ad4 100644
--- a/docs/zh/flight_modes_fw/index.md
+++ b/docs/zh/flight_modes_fw/index.md
@@ -17,6 +17,8 @@ Manual-Easy:
Airspeed is actively controlled if an airspeed sensor is installed.
- [Altitude](../flight_modes_fw/altitude.md) — Easiest and safest _non-GPS_ manual mode.
The only difference compared to _Position mode_ is that the pilot always directly controls the roll angle of the plane and there is no automatic course holding.
+- Altitude Cruise mode — It behaves exactly like _Altitude mode_, with the only difference being that the manual control failsafe can be disabled. This is done by setting the corresponding flag in [COM_RCL_EXCEPT](../advanced_config/parameter_reference.md#COM_RCL_EXCEPT). In that case the current altitude, airspeed and heading (by leveling out the roll angle) are kept until the manual control link is regained or the mode is exited.
+ It is highly recommended to only disable the manual control loss failsafe for this mode if there is a stable data link connection to the vehicle at all times, or to enable the data link loss failsafe through [NAV_DLL_ACT](../advanced_config/parameter_reference.md#NAV_DLL_ACT).
- [Stabilized mode](../flight_modes_fw/stabilized.md) — The pilot directly commands the roll and pitch angle and the vehicle keeps the setpoint until the sticks are moved again.
Thrust is directly set by the pilot.
Turn coordination is still handled by the controller.
diff --git a/docs/zh/flight_modes_mc/altitude.md b/docs/zh/flight_modes_mc/altitude.md
index 3e1af11c58..e7ce6d130e 100644
--- a/docs/zh/flight_modes_mc/altitude.md
+++ b/docs/zh/flight_modes_mc/altitude.md
@@ -21,7 +21,7 @@ The diagram below shows the mode behaviour visually (for a [mode 2 transmitter](
RC/manual mode like [Stabilized mode](../flight_modes_mc/manual_stabilized.md) but with _altitude stabilization_ (centred sticks level vehicle and hold it to fixed altitude).
The horizontal position of the vehicle can move due to wind (or pre-existing momentum).
-- 回正摇杆(内带死区):
+- Centered sticks:
- RPY摇杆使飞机水平。
- 油门(~50%)抗风保持当前姿态。
- 外部中心:
diff --git a/docs/zh/flight_modes_mc/altitude_cruise.md b/docs/zh/flight_modes_mc/altitude_cruise.md
new file mode 100644
index 0000000000..eda1cf30ce
--- /dev/null
+++ b/docs/zh/flight_modes_mc/altitude_cruise.md
@@ -0,0 +1,45 @@
+# Altitude Cruise Mode (Multicopter)
+
+
+
+_Altitude Cruise mode_ is a _relatively_ easy-to-fly manual control mode in which roll and pitch sticks control vehicle movement in the left-right and forward-back directions (relative to the "front" of the vehicle), yaw stick controls rate of rotation over the horizontal plane, and throttle controls speed of ascent-descent.
+
+When the sticks are released/centered the vehicle will keep the current tilt and heading angle and maintain the current _altitude_.
+If moving in the horizontal plane the vehicle will accelerate until the wind resistance equals the acceleration caused by the set tilt angle.
+The vehicle will then continue to move with a constant velocity (unlike for Altitude mode, in which the vehicle will eventually slow down and stop).
+If the wind blows the aircraft will drift in the direction of the wind even if flying perfectly level.
+
+:::tip
+_Altitude Cruise mode_ is intended for long distance flights where the same tilt angle is kept for a long period of time. It is just like [Altitude](../flight_modes_mc/altitude.md) mode but does not go back to level tilt when the sticks are released.
+:::
+
+The diagram below shows the mode behaviour visually (for a [mode 2 transmitter](../getting_started/rc_transmitter_receiver.md#transmitter_modes)).
+
+
+
+## 技术总结
+
+A manual mode that is similar to [Altitude mode](../flight_modes_mc/altitude.md) but with different interpretation of roll and pitch sticks.
+
+- Centered sticks:
+ - Roll/Pitch sticks: the current tilt is kept.
+ - Yaw: the current heading is kept.
+ - Throttle (~50%) holds current altitude.
+- 外部中心:
+ - Roll/Pitch sticks control the rate of change of the tilt angle, resulting in corresponding left-right and forward-back movement. A maximum stick deflection results in a tilting rate setpoint to go from level to max tilt within 0.5 seconds.
+ - Yaw stick deflection rotates the tilt angle either left or right, causing the vehicle to change course. It is _not_ causing a direct rotation around the body yaw axis like in [Acro mode](../flight_modes_mc/acro.md).
+ - 油门摇杆以预定的最大速率(和其他轴上的移动速度)控制上升速度。
+- 起飞:
+ - 降落时,如果将油门杆抬高至 62.5%(从油门杆最低开始的整个范围),无人机将起飞。
+- Manual control input is required (such as RC control, joystick) to enter this mode. Other than in all other manual modes, it's though possible to disable the manual control loss failsafe by setting the corresponding flag in [COM_RCL_EXCEPT](../advanced_config/parameter_reference.md#COM_RCL_EXCEPT). In that case the current altitude, tilt and heading are kept until the manual control link is regained or the mode is exited.
+ It is highly recommended to only disable the manual control loss failsafe for this mode if there is a stable data link connection to the vehicle at all times, and to enable the data link loss failsafe through [NAV_DLL_ACT](../advanced_config/parameter_reference.md#NAV_DLL_ACT).
+
+## 参数
+
+Most of the relevant parameters are already covered in the corresponding section in the [Altitude mode](../flight_modes_mc/altitude.md). Here a list of parameters of particular importance for Altitude Cruise.
+
+| 参数 | 描述 |
+| -------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
+| [COM_RCL_EXCEPT](../advanced_config/parameter_reference.md#COM_RCL_EXCEPT) | The manual control failsafe can be disabled for Altitude Cruise by setting the corresponding bit in this parameter. |
+| [NAV_DLL_ACT](../advanced_config/parameter_reference.md#NAV_DLL_ACT) | Data link lost failsafe action. Recommended to set if the manual control failsafe is disabled to avoid fly-aways. |
+| [MPC_MAN_TILT_MAX](../advanced_config/parameter_reference.md#MPC_MAN_TILT_MAX) | The maximum tilt angle the vehicle will go to. At max stick deflection, it will take 0.5 seconds from level flight to this tilt angle. |
diff --git a/docs/zh/flight_modes_mc/index.md b/docs/zh/flight_modes_mc/index.md
index 806046c6e7..1b407d6239 100644
--- a/docs/zh/flight_modes_mc/index.md
+++ b/docs/zh/flight_modes_mc/index.md
@@ -21,10 +21,12 @@ Manual-Easy:
- [Stabilized mode](../flight_modes_mc/manual_stabilized.md) — Releasing the sticks levels and maintains the vehicle horizontal posture (but not altitude or position).
The vehicle will continue to move with momentum, and both altitude and horizontal position may be affected by wind.
This mode is also used if "Manual mode" is selected in a ground station.
+- [Altitude Cruise mode](../flight_modes_mc/altitude_cruise.md) — Very similar to _Altitude mode_, with the difference that when the roll and pitch sticks are released the vehicle does not level out but keeps the tilt until further inputs are given.
+ Additionally it is possible to disable the manual control failsafe for this mode, having the vehicle continue on it's set path even if there are no new control inputs.
Manual-Acrobatic
-- [Acro](../flight_modes_mc/acro.md) — Manual mode for performing acrobatic maneuvers, such as rolls and loops.
+- [Acro](../flight_modes_mc/acro.md) — Manual mode for performing acrobatic manoeuvrers, such as rolls and loops.
Releasing the sticks stops the vehicle rotating in the roll, pitch, yaw axes, but does not otherwise stabilise the vehicle.
Autonomous:
diff --git a/docs/zh/flight_modes_mc/manual_stabilized.md b/docs/zh/flight_modes_mc/manual_stabilized.md
index 671368ee82..b1f9de1f78 100644
--- a/docs/zh/flight_modes_mc/manual_stabilized.md
+++ b/docs/zh/flight_modes_mc/manual_stabilized.md
@@ -31,7 +31,7 @@ Throttle is rescaled (see [below](#params)) and passed directly to control alloc
自动驾驶仪控制着飞机的姿态角,这意味着当 RC 摇杆居中时自驾仪调整飞机的滚转和俯仰角为零(从而实现飞机姿态的改平)。
自动驾驶仪不能补偿由于风(或其他来源)引起的漂移。
-- 回正摇杆(内带死区):
+- Centered sticks:
- Roll/Pitch sticks level vehicle.
- 外部中心:
- Roll/Pitch sticks control tilt angle in those orientations, resulting in corresponding left-right and forward-back movement.
diff --git a/docs/zh/flight_modes_mc/position.md b/docs/zh/flight_modes_mc/position.md
index fa70ad7997..b35ce39d7b 100644
--- a/docs/zh/flight_modes_mc/position.md
+++ b/docs/zh/flight_modes_mc/position.md
@@ -43,7 +43,7 @@ While very rare on a well calibrated vehicle, sometimes there may be problems wi
遥控模式下,横滚、俯仰、油门 (RPT) 杆控制相应轴/方向的运动。
摇杆居中使机体水平并将其保持在固定的高度和位置并抗风。
-- Centered roll, pitch, throttle sticks (within RC deadzone [MPC_HOLD_DZ](../advanced_config/parameter_reference.md#MPC_HOLD_DZ)) hold x, y, z position steady against any disturbance like wind.
+- Centered roll, pitch, throttle sticks (within RC deadzone [MAN_DEADZONE](#MAN_DEADZONE)) hold x, y, z position steady against any disturbance like wind.
- 外部中心:
- Roll/Pitch sticks control horizontal acceleration over ground in the vehicle's left-right and forward-back directions (respectively).
- Throttle stick controls speed of ascent-descent.
@@ -62,7 +62,7 @@ All the parameters in the [Multicopter Position Control](../advanced_config/para
| 参数 | 描述 |
| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
-| [MPC_HOLD_DZ](../advanced_config/parameter_reference.md#MPC_HOLD_DZ) | 启用位置保持的摇杆死区。 默认值:0.1(摇杆全行程的 10%)。 |
+| [MAN_DEADZONE](../advanced_config/parameter_reference.md#MAN_DEADZONE) | 启用位置保持的摇杆死区。 默认值:0.1(摇杆全行程的 10%)。 |
| [MPC_Z_VEL_MAX_UP](../advanced_config/parameter_reference.md#MPC_Z_VEL_MAX_UP) | 最大垂直上升速度。 默认:3m/s。 |
| [MPC_Z_VEL_MAX_DN](../advanced_config/parameter_reference.md#MPC_Z_VEL_MAX_DN) | 最大垂直下降速度。 默认:1m/s。 |
| [MPC_LAND_ALT1](../advanced_config/parameter_reference.md#MPC_LAND_ALT1) | 触发第一阶段降速的高度。 Below this altitude descending velocity gets limited to a value between [MPC_Z_VEL_MAX_DN](#MPC_Z_VEL_MAX_DN) (or `MPC_Z_V_AUTO_DN`) and [MPC_LAND_SPEED](#MPC_LAND_SPEED). Value needs to be higher than [MPC_LAND_ALT2](#MPC_LAND_ALT2). Default 10m. |
diff --git a/docs/zh/flight_modes_rover/index.md b/docs/zh/flight_modes_rover/index.md
index 38f185f784..567fb20460 100644
--- a/docs/zh/flight_modes_rover/index.md
+++ b/docs/zh/flight_modes_rover/index.md
@@ -12,7 +12,7 @@ Selecting any other mode than those listed below will either stop the rover or c
## Manual Modes
-| Mode | 描述 |
+| 模式 | 描述 |
| --------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| [Manual](manual.md#manual-mode) | No autopilot support. User is responsible for keeping the rover on the desired course and maintaining speed and rate of turn. |
| [Acro](manual.md#acro-mode) | + Maintains the yaw rate (feels more like driving a car than manual mode).
+ Allows maximum yaw rate to be limited (protects against roll over). |
@@ -21,7 +21,7 @@ Selecting any other mode than those listed below will either stop the rover or c
## Auto Modes
-| Mode | 描述 |
+| 模式 | 描述 |
| ------------------------------- | --------------------------------------------------------------------------------------- |
| [Mission](auto.md#mission-mode) | Automatic mode that causes the vehicle to execute a predefined mission. |
| [Return](auto.md#return-mode) | Automatic mode that returns the vehicle to the launch position. |
diff --git a/docs/zh/flight_modes_rover/manual.md b/docs/zh/flight_modes_rover/manual.md
index 6363cd9baf..2f0cecdf04 100644
--- a/docs/zh/flight_modes_rover/manual.md
+++ b/docs/zh/flight_modes_rover/manual.md
@@ -14,7 +14,7 @@ The sticks provide the same "high level" control effects over direction and rate
The manual modes provide progressively increasing levels of autopilot support for maintaining a course, speed, and rate of turn, compensating for external factors such as slopes or uneven terrain.
-| Mode | 描述 |
+| 模式 | 描述 |
| --------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| [Manual](manual.md#manual-mode) | No autopilot support. User is responsible for keeping the rover on the desired course and maintaining speed and rate of turn. |
| [Acro](manual.md#acro-mode) | + Maintains the yaw rate (feels more like driving a car than manual mode).
+ Allows maximum yaw rate to be limited (protects against roll over). |
@@ -24,7 +24,7 @@ The manual modes provide progressively increasing levels of autopilot support fo
:::details
Overview mode mapping to control effect
-| Mode | Speed | Turning | Required measurements |
+| 模式 | Speed | Turning | Required measurements |
| ------------------------------ | ---------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- |
| [Manual](#manual-mode) | Directly map stick input to motor command. | Directly map stick input to steering angle/speed difference. | None. |
| [Acro](#acro-mode) | Directly map stick input to motor command. | Stick input creates a yaw rate setpoint for the control system to regulate. | yaw rate. |
diff --git a/docs/zh/frames_rover/index.md b/docs/zh/frames_rover/index.md
index 59537ab34e..79d212bdca 100644
--- a/docs/zh/frames_rover/index.md
+++ b/docs/zh/frames_rover/index.md
@@ -21,7 +21,7 @@ The supported frames can be seen in [Airframes Reference > Rover](../airframes/a
## Ackermann
-
+<0/> <1/>
An Ackermann rover controls its direction by pointing the front wheels in the direction of travel — the [Ackermann steering geometry](https://en.wikipedia.org/wiki/Ackermann_steering_geometry) compensates for the fact that wheels on the inside and outside of the turn move at different rates.
This kind of steering is used on most commercial vehicles, including cars, trucks etc.
@@ -34,7 +34,7 @@ PX4 does not require that the vehicle uses the Ackermann geometry and will work
## Differential
-
+<0/> <1/>
A differential rover's motion is controlled using a differential drive mechanism, where the left and right wheel speeds are adjusted independently to achieve the desired forward speed and yaw rate.
Forward motion is achieved by driving both wheels at the same speed in the same direction.
@@ -48,7 +48,7 @@ The differential setup also work for rovers with skid or tank steering.
## Mecanum
-
+<0/> <1/>
A Mecanum rover is a type of mobile robot that uses Mecanum wheels to achieve omnidirectional movement. These wheels are unique because they have rollers mounted at a 45-degree angle around their circumference, allowing the rover to move not only forward and backward but also side-to-side and diagonally without needing to rotate first.
Each wheel is driven by its own motor, and by controlling the speed and direction of each motor, the rover can move in any direction or spin in place.
diff --git a/docs/zh/middleware/uxrce_dds.md b/docs/zh/middleware/uxrce_dds.md
index 3a6ad2baf6..8d04eb706f 100644
--- a/docs/zh/middleware/uxrce_dds.md
+++ b/docs/zh/middleware/uxrce_dds.md
@@ -65,7 +65,7 @@ PX4 Micro XRCE-DDS Client is based on version `v2.x` which is not compatible wit
On Ubuntu you can build from source and install the Agent standalone using the following commands:
```sh
-git clone -b v2.4.2 https://github.com/eProsima/Micro-XRCE-DDS-Agent.git
+git clone -b v2.4.3 https://github.com/eProsima/Micro-XRCE-DDS-Agent.git
cd Micro-XRCE-DDS-Agent
mkdir build
cd build
@@ -126,7 +126,7 @@ To build the agent within ROS:
```sh
cd ~/px4_ros_uxrce_dds_ws/src
- git clone -b v2.4.2 https://github.com/eProsima/Micro-XRCE-DDS-Agent.git
+ git clone -b v2.4.3 https://github.com/eProsima/Micro-XRCE-DDS-Agent.git
```
3. Source the ROS 2 development environment, and compile the workspace using `colcon`:
@@ -279,6 +279,9 @@ The configuration can be done using the [UXRCE-DDS parameters](../advanced_confi
- [UXRCE_DDS_SYNCT](../advanced_config/parameter_reference.md#UXRCE_DDS_SYNCT): Bridge time synchronization enable.
The uXRCE-DDS client module can synchronize the timestamp of the messages exchanged over the bridge.
This is the default configuration. In certain situations, for example during [simulations](../ros2/user_guide.md#ros-gazebo-and-px4-time-synchronization), this feature may be disabled.
+ - [`UXRCE_DDS_NS_IDX`](../advanced_config/parameter_reference.md#UXRCE_DDS_NS_IDX): Index-based namespace definition
+ Setting this parameter to any value other than `-1` creates a namespace with the prefix `uav_` and the specified value, e.g. `uav_0`, `uav_1`, etc.
+ See [namespace](#customizing-the-namespace) for methods to define richer or arbitrary namespaces.
:::info
Many ports are already have a default configuration.
@@ -354,7 +357,7 @@ Therefore,
## Customizing the Namespace
-Custom topic and service namespaces can be applied at build time (changing [dds_topics.yaml](../middleware/dds_topics.md)) or at runtime (which is useful for multi vehicle operations):
+Custom topic and service namespaces can be applied at build time (changing [dds_topics.yaml](../middleware/dds_topics.md)), at runtime, or through a parameter (which is useful for multi vehicle operations):
- One possibility is to use the `-n` option when starting the [uxrce_dds_client](../modules/modules_system.md#uxrce-dds-client) from command line.
This technique can be used both in simulation and real vehicles.
@@ -383,6 +386,22 @@ will generate topics under the namespaces:
:::
+- A simple index-based namespace can be applied by setting the parameter [`UXRCE_DDS_NS_IDX`](../advanced_config/parameter_reference.md#UXRCE_DDS_NS_IDX) to a value between 0 and 9999.
+ This will generate a namespace such as `/uav_0`, `/uav_1`, and so on.
+ This technique is ideal if vehicles must be persistently associated with namespaces because their clients are automatically started through PX4.
+
+:::info
+PX4 parameters cannot carry rich text strings.
+Therefore, you cannot use [`UXRCE_DDS_NS_IDX`](../advanced_config/parameter_reference.md#UXRCE_DDS_NS_IDX) to automatically start a client with an arbitrary message namespace through PX4.
+You can however specify a namespace when starting the client, using the `-n` argument:
+
+```sh
+# In etc/extras.txt on the MicroSD card
+uxrce_dds_client start -n fancy_uav
+```
+
+This can be included in `etc/extras.txt` as part of a custom [System Startup](../concept/system_startup.md).
+
## PX4 ROS 2 QoS Settings
PX4 QoS settings for publishers are incompatible with the default QoS settings for ROS 2 subscribers.
@@ -516,7 +535,7 @@ For a list of services, details and examples see the [service documentation](../
These guidelines explain how to migrate from using PX4 v1.13 [Fast-RTPS](../middleware/micrortps.md) middleware to PX4 v1.14 `uXRCE-DDS` middleware.
These are useful if you have [ROS 2 applications written for PX4 v1.13](https://docs.px4.io/v1.13/en/ros/ros2_comm.html), or you have used Fast-RTPS to interface your applications to PX4 [directly](https://docs.px4.io/v1.13/en/middleware/micrortps.html#agent-in-an-offboard-fast-dds-interface-ros-independent).
-:::info
+::: info
This section contains migration-specific information.
You should also read the rest of this page to properly understand uXRCE-DDS.
:::
diff --git a/docs/zh/modules/modules_driver_ins.md b/docs/zh/modules/modules_driver_ins.md
index d52df4c6a6..6d023b4d31 100644
--- a/docs/zh/modules/modules_driver_ins.md
+++ b/docs/zh/modules/modules_driver_ins.md
@@ -125,6 +125,31 @@ ilabs [arguments...]
status Print driver status
```
+## sbgecom
+
+Source: [drivers/ins/sbgecom](https://github.com/PX4/PX4-Autopilot/tree/main/src/drivers/ins/sbgecom)
+
+Description du module
+
+### Usage {#sbgecom_usage}
+
+```
+sbgecom [arguments...]
+ Commands:
+ start Start driver
+ [-d ] Serial device
+ default: /dev/ttyS0
+ [-b ] Baudrate device
+ default: 921600
+ [-f ] Config JSON file path
+ default: /etc/extras/sbg_settings\.json
+ [-s ] Config JSON string
+
+ status Driver status
+
+ stop Stop driver
+```
+
## vectornav
Source: [drivers/ins/vectornav](https://github.com/PX4/PX4-Autopilot/tree/main/src/drivers/ins/vectornav)
diff --git a/docs/zh/modules/modules_system.md b/docs/zh/modules/modules_system.md
index 24246827fe..a1b139322d 100644
--- a/docs/zh/modules/modules_system.md
+++ b/docs/zh/modules/modules_system.md
@@ -140,9 +140,9 @@ commander [arguments...]
transition VTOL transition
mode Change flight mode
- manual|acro|offboard|stabilized|altctl|posctl|position:slow|auto:mission|au
- to:loiter|auto:rtl|auto:takeoff|auto:land|auto:precland|ext1
- Flight mode
+ manual|acro|offboard|stabilized|altctl|posctl|altitude_cruise|position:slow
+ |auto:mission|auto:loiter|auto:rtl|auto:takeoff|auto:land|auto:
+ precland|ext1 Flight mode
pair
@@ -154,6 +154,9 @@ commander [arguments...]
lat|lon|alt Origin latitude longitude altitude
+ set_heading Set current heading
+ heading degrees from True North [0 360]
+
poweroff Power off board (if supported)
stop
@@ -1062,7 +1065,9 @@ uxrce_dds_client [arguments...]
values:
[-p ] Agent listening port. If not provided, defaults to
UXRCE_DDS_PRT
- [-n ] Client DDS namespace
+ [-n ] Client DDS namespace. If not provided but UXRCE_DDS_NS_IDX is
+ between 0 and 9999 inclusive, then uav_ + UXRCE_DDS_NS_IDX will
+ be used
stop
diff --git a/docs/zh/msg_docs/ActuatorMotors.md b/docs/zh/msg_docs/ActuatorMotors.md
index ca739f6c22..701465d6ea 100644
--- a/docs/zh/msg_docs/ActuatorMotors.md
+++ b/docs/zh/msg_docs/ActuatorMotors.md
@@ -18,11 +18,11 @@ uint32 MESSAGE_VERSION = 0
uint64 timestamp # [us] Time since system start
uint64 timestamp_sample # [us] Sampling timestamp of the data this control response is based on
-uint16 reversible_flags # Bitset indicating which motors are configured to be reversible
+uint16 reversible_flags # [-] Bitset indicating which motors are configured to be reversible
uint8 ACTUATOR_FUNCTION_MOTOR1 = 101 #
uint8 NUM_CONTROLS = 12 #
-float32[12] control # [@range -1, 1] Normalized thrust. where 1 means maximum positive thrust, -1 maximum negative (if not supported by the output, <0 maps to NaN). NaN maps to disarmed (stop the motors)
+float32[12] control # [@range -1, 1] Normalized thrust. where 1 means maximum positive thrust, -1 maximum negative (if not supported by the output, <0 maps to NaN). NaN maps to disarmed (stop the motors)
```
diff --git a/docs/zh/msg_docs/ActuatorServos.md b/docs/zh/msg_docs/ActuatorServos.md
index 6f0a677dbf..ea053f67a3 100644
--- a/docs/zh/msg_docs/ActuatorServos.md
+++ b/docs/zh/msg_docs/ActuatorServos.md
@@ -19,6 +19,6 @@ uint64 timestamp # [us] Time since system start
uint64 timestamp_sample # [us] Sampling timestamp of the data this control response is based on
uint8 NUM_CONTROLS = 8 #
-float32[8] control # [@range -1, 1] Normalized output. 1 means maximum positive position. -1 maximum negative position (if not supported by the output, <0 maps to NaN). NaN maps to disarmed.
+float32[8] control # [-] [@range -1, 1] Normalized output. 1 means maximum positive position. -1 maximum negative position (if not supported by the output, <0 maps to NaN). NaN maps to disarmed.
```
diff --git a/docs/zh/msg_docs/ArmingCheckReply.md b/docs/zh/msg_docs/ArmingCheckReply.md
index 8d619f5aaf..14af54f0d1 100644
--- a/docs/zh/msg_docs/ArmingCheckReply.md
+++ b/docs/zh/msg_docs/ArmingCheckReply.md
@@ -1,6 +1,6 @@
# ArmingCheckReply (UORB message)
-Arming check reply.
+Arming check reply
This is a response to an ArmingCheckRequest message sent by the FMU to an external component, such as a ROS 2 navigation mode.
The response contains the current set of external mode requirements, and a queue of events indicating recent failures to set the mode (which the FMU may then forward to a ground station).
@@ -12,7 +12,7 @@ The message is not used by internal/FMU components, as their mode requirements a
[source file](https://github.com/PX4/PX4-Autopilot/blob/main/msg/versioned/ArmingCheckReply.msg)
```c
-# Arming check reply.
+# Arming check reply
#
# This is a response to an ArmingCheckRequest message sent by the FMU to an external component, such as a ROS 2 navigation mode.
# The response contains the current set of external mode requirements, and a queue of events indicating recent failures to set the mode (which the FMU may then forward to a ground station).
@@ -25,33 +25,33 @@ uint32 MESSAGE_VERSION = 1
uint64 timestamp # [us] Time since system start.
-uint8 request_id # Id of ArmingCheckRequest for which this is a response.
-uint8 registration_id # Id of external component emitting this response.
+uint8 request_id # [-] Id of ArmingCheckRequest for which this is a response
+uint8 registration_id # [-] Id of external component emitting this response
-uint8 HEALTH_COMPONENT_INDEX_NONE = 0 # Index of health component for which this response applies.
+uint8 HEALTH_COMPONENT_INDEX_NONE = 0 # Index of health component for which this response applies
uint8 health_component_index # [@enum HEALTH_COMPONENT_INDEX]
-bool health_component_is_present # Unused. Intended for use with health events interface (health_component_t in events.json).
-bool health_component_warning # Unused. Intended for use with health events interface (health_component_t in events.json).
-bool health_component_error # Unused. Intended for use with health events interface (health_component_t in events.json).
+bool health_component_is_present # Unused. Intended for use with health events interface (health_component_t in events.json)
+bool health_component_warning # Unused. Intended for use with health events interface (health_component_t in events.json)
+bool health_component_error # Unused. Intended for use with health events interface (health_component_t in events.json)
-bool can_arm_and_run # True if the component can arm. For navigation mode components, true if the component can arm in the mode or switch to the mode when already armed.
+bool can_arm_and_run # True if the component can arm. For navigation mode components, true if the component can arm in the mode or switch to the mode when already armed
-uint8 num_events # Number of queued failure messages (Event) in the events field.
+uint8 num_events # Number of queued failure messages (Event) in the events field
-Event[5] events # Arming failure reasons (Queue of events to report to GCS).
+Event[5] events # Arming failure reasons (Queue of events to report to GCS)
# Mode requirements
-bool mode_req_angular_velocity # Requires angular velocity estimate (e.g. from gyroscope).
-bool mode_req_attitude # Requires an attitude estimate.
-bool mode_req_local_alt # Requires a local altitude estimate.
-bool mode_req_local_position # Requires a local position estimate.
-bool mode_req_local_position_relaxed # Requires a more relaxed global position estimate.
-bool mode_req_global_position # Requires a global position estimate.
-bool mode_req_global_position_relaxed # Requires a relaxed global position estimate.
-bool mode_req_mission # Requires an uploaded mission.
-bool mode_req_home_position # Requires a home position (such as RTL/Return mode).
-bool mode_req_prevent_arming # Prevent arming (such as in Land mode).
+bool mode_req_angular_velocity # Requires angular velocity estimate (e.g. from gyroscope)
+bool mode_req_attitude # Requires an attitude estimate
+bool mode_req_local_alt # Requires a local altitude estimate
+bool mode_req_local_position # Requires a local position estimate
+bool mode_req_local_position_relaxed # Requires a more relaxed global position estimate
+bool mode_req_global_position # Requires a global position estimate
+bool mode_req_global_position_relaxed # Requires a relaxed global position estimate
+bool mode_req_mission # Requires an uploaded mission
+bool mode_req_home_position # Requires a home position (such as RTL/Return mode)
+bool mode_req_prevent_arming # Prevent arming (such as in Land mode)
bool mode_req_manual_control # Requires a manual controller
uint8 ORB_QUEUE_LENGTH = 4
diff --git a/docs/zh/msg_docs/ArmingCheckRequest.md b/docs/zh/msg_docs/ArmingCheckRequest.md
index 653d58d2d2..d093dfb5e1 100644
--- a/docs/zh/msg_docs/ArmingCheckRequest.md
+++ b/docs/zh/msg_docs/ArmingCheckRequest.md
@@ -1,6 +1,6 @@
# ArmingCheckRequest (UORB message)
-Arming check request.
+Arming check request
Broadcast message to request arming checks be reported by all registered components, such as external ROS 2 navigation modes.
All registered components should respond with an ArmingCheckReply message that indicates their current mode requirements, and any arming failure information.
@@ -12,7 +12,7 @@ The reply will also include the registration_id for each external component, pro
[source file](https://github.com/PX4/PX4-Autopilot/blob/main/msg/versioned/ArmingCheckRequest.msg)
```c
-# Arming check request.
+# Arming check request
#
# Broadcast message to request arming checks be reported by all registered components, such as external ROS 2 navigation modes.
# All registered components should respond with an ArmingCheckReply message that indicates their current mode requirements, and any arming failure information.
@@ -23,10 +23,10 @@ The reply will also include the registration_id for each external component, pro
uint32 MESSAGE_VERSION = 1
-uint64 timestamp # [us] Time since system start.
+uint64 timestamp # [us] Time since system start
-uint8 request_id # Id of this request. Allows correlation with associated ArmingCheckReply messages.
+uint8 request_id # [-] Id of this request. Allows correlation with associated ArmingCheckReply messages.
-uint32 valid_registrations_mask # Bitmask of valid registration ID's (the bit is also cleared if flagged as unresponsive)
+uint32 valid_registrations_mask # [-] Bitmask of valid registration ID's (the bit is also cleared if flagged as unresponsive)
```
diff --git a/docs/zh/msg_docs/BatteryStatus.md b/docs/zh/msg_docs/BatteryStatus.md
index 7204a2a12f..addd1ae524 100644
--- a/docs/zh/msg_docs/BatteryStatus.md
+++ b/docs/zh/msg_docs/BatteryStatus.md
@@ -16,76 +16,77 @@ Battery instance information is also logged and streamed in MAVLink telemetry.
# Battery instance information is also logged and streamed in MAVLink telemetry.
uint32 MESSAGE_VERSION = 1
-uint8 MAX_INSTANCES = 4
+uint8 MAX_INSTANCES = 3
-uint64 timestamp # [us] Time since system start
-bool connected # Whether or not a battery is connected. For power modules this is based on a voltage threshold.
-float32 voltage_v # [V] [@invalid 0] Battery voltage
-float32 current_a # [A] [@invalid -1] Battery current
-float32 current_average_a # [A] [@invalid -1] Battery current average (for FW average in level flight)
-float32 discharged_mah # [mAh] [@invalid -1] Discharged amount
-float32 remaining # [@range 0,1] [@invalid -1] Remaining capacity
-float32 scale # [@range 1,] [@invalid -1] Scaling factor to compensate for lower actuation power caused by voltage sag
-float32 time_remaining_s # [s] [@invalid NaN] Predicted time remaining until battery is empty under previous averaged load
-float32 temperature # [°C] [@invalid NaN] Temperature of the battery
-uint8 cell_count # [@invalid 0] Number of cells
+uint64 timestamp # [us] Time since system start
+
+bool connected # Whether or not a battery is connected. For power modules this is based on a voltage threshold.
+float32 voltage_v # [V] [@invalid 0] Battery voltage
+float32 current_a # [A] [@invalid -1] Battery current
+float32 current_average_a # [A] [@invalid -1] Battery current average (for FW average in level flight)
+float32 discharged_mah # [mAh] [@invalid -1] Discharged amount
+float32 remaining # [@range 0,1] [@invalid -1] Remaining capacity
+float32 scale # [-] [@range 1,] [@invalid -1] Scaling factor to compensate for lower actuation power caused by voltage sag
+float32 time_remaining_s # [s] [@invalid NaN] Predicted time remaining until battery is empty under previous averaged load
+float32 temperature # [°C] [@invalid NaN] Temperature of the battery
+uint8 cell_count # [-] [@invalid 0] Number of cells
-uint8 source # [@enum SOURCE] Battery source
-uint8 SOURCE_POWER_MODULE = 0 # Power module
-uint8 SOURCE_EXTERNAL = 1 # External
-uint8 SOURCE_ESCS = 2 # ESCs
+uint8 source # [@enum SOURCE] Battery source
+uint8 SOURCE_POWER_MODULE = 0 # Power module
+uint8 SOURCE_EXTERNAL = 1 # External
+uint8 SOURCE_ESCS = 2 # ESCs
-uint8 priority # Zero based priority is the connection on the Power Controller V1..Vn AKA BrickN-1
-uint16 capacity # [mAh] Capacity of the battery when fully charged
-uint16 cycle_count # Number of discharge cycles the battery has experienced
-uint16 average_time_to_empty # [minutes] Predicted remaining battery capacity based on the average rate of discharge
-uint16 manufacture_date # Manufacture date, part of serial number of the battery pack. Formatted as: Day + Month×32 + (Year–1980)×512
-uint16 state_of_health # [%] [@range 0, 100] State of health. FullChargeCapacity/DesignCapacity
-uint16 max_error # [%] [@range 1, 100] Max error, expected margin of error in the state-of-charge calculation
-uint8 id # ID number of a battery. Should be unique and consistent for the lifetime of a vehicle. 1-indexed
-uint16 interface_error # Interface error counter
+uint8 priority # [-] Zero based priority is the connection on the Power Controller V1..Vn AKA BrickN-1
+uint16 capacity # [mAh] Capacity of the battery when fully charged
+uint16 cycle_count # [-] Number of discharge cycles the battery has experienced
+uint16 average_time_to_empty # [minutes] Predicted remaining battery capacity based on the average rate of discharge
+uint16 manufacture_date # [-] Manufacture date, part of serial number of the battery pack. Formatted as: Day + Month×32 + (Year–1980)×512
+uint16 state_of_health # [%] [@range 0, 100] State of health. FullChargeCapacity/DesignCapacity
+uint16 max_error # [%] [@range 1, 100] Max error, expected margin of error in the state-of-charge calculation
+uint8 id # [-] ID number of a battery. Should be unique and consistent for the lifetime of a vehicle. 1-indexed
+uint16 interface_error # [-] Interface error counter
-float32[14] voltage_cell_v # [V] [@invalid 0] Battery individual cell voltages
-float32 max_cell_voltage_delta # Max difference between individual cell voltages
+float32[14] voltage_cell_v # [V] [@invalid 0] Battery individual cell voltages
+float32 max_cell_voltage_delta # [V] Max difference between individual cell voltages
-bool is_powering_off # Power off event imminent indication, false if unknown
-bool is_required # Set if the battery is explicitly required before arming
+bool is_powering_off # Power off event imminent indication, false if unknown
+bool is_required # Set if the battery is explicitly required before arming
-uint8 warning # [@enum WARNING STATE] Current battery warning
-uint8 WARNING_NONE = 0 # No battery low voltage warning active
-uint8 WARNING_LOW = 1 # Low voltage warning
-uint8 WARNING_CRITICAL = 2 # Critical voltage, return / abort immediately
-uint8 WARNING_EMERGENCY = 3 # Immediate landing required
-uint8 WARNING_FAILED = 4 # Battery has failed completely
-uint8 STATE_UNHEALTHY = 6 # Battery is diagnosed to be defective or an error occurred, usage is discouraged / prohibited. Possible causes (faults) are listed in faults field
-uint8 STATE_CHARGING = 7 # Battery is charging
+uint8 warning # [@enum WARNING STATE] Current battery warning
+uint8 WARNING_NONE = 0 # No battery low voltage warning active
+uint8 WARNING_LOW = 1 # Low voltage warning
+uint8 WARNING_CRITICAL = 2 # Critical voltage, return / abort immediately
+uint8 WARNING_EMERGENCY = 3 # Immediate landing required
+uint8 WARNING_FAILED = 4 # Battery has failed completely
+uint8 STATE_UNHEALTHY = 6 # Battery is diagnosed to be defective or an error occurred, usage is discouraged / prohibited. Possible causes (faults) are listed in faults field
+uint8 STATE_CHARGING = 7 # Battery is charging
-uint16 faults # [@enum FAULT] Smart battery supply status/fault flags (bitmask) for health indication
-uint8 FAULT_DEEP_DISCHARGE = 0 # Battery has deep discharged
-uint8 FAULT_SPIKES = 1 # Voltage spikes
-uint8 FAULT_CELL_FAIL= 2 # One or more cells have failed
-uint8 FAULT_OVER_CURRENT = 3 # Over-current
-uint8 FAULT_OVER_TEMPERATURE = 4 # Over-temperature
-uint8 FAULT_UNDER_TEMPERATURE = 5 # Under-temperature fault
-uint8 FAULT_INCOMPATIBLE_VOLTAGE = 6 # Vehicle voltage is not compatible with this battery (batteries on same power rail should have similar voltage)
-uint8 FAULT_INCOMPATIBLE_FIRMWARE = 7 # Battery firmware is not compatible with current autopilot firmware
-uint8 FAULT_INCOMPATIBLE_MODEL = 8 # Battery model is not supported by the system
-uint8 FAULT_HARDWARE_FAILURE = 9 # Hardware problem
-uint8 FAULT_FAILED_TO_ARM = 10 # Battery had a problem while arming
-uint8 FAULT_COUNT = 11 # Counter. Keep this as last element
+uint16 faults # [@enum FAULT] Smart battery supply status/fault flags (bitmask) for health indication
+uint8 FAULT_DEEP_DISCHARGE = 0 # Battery has deep discharged
+uint8 FAULT_SPIKES = 1 # Voltage spikes
+uint8 FAULT_CELL_FAIL= 2 # One or more cells have failed
+uint8 FAULT_OVER_CURRENT = 3 # Over-current
+uint8 FAULT_OVER_TEMPERATURE = 4 # Over-temperature
+uint8 FAULT_UNDER_TEMPERATURE = 5 # Under-temperature fault
+uint8 FAULT_INCOMPATIBLE_VOLTAGE = 6 # Vehicle voltage is not compatible with this battery (batteries on same power rail should have similar voltage)
+uint8 FAULT_INCOMPATIBLE_FIRMWARE = 7 # Battery firmware is not compatible with current autopilot firmware
+uint8 FAULT_INCOMPATIBLE_MODEL = 8 # Battery model is not supported by the system
+uint8 FAULT_HARDWARE_FAILURE = 9 # Hardware problem
+uint8 FAULT_FAILED_TO_ARM = 10 # Battery had a problem while arming
+uint8 FAULT_COUNT = 11 # Counter. Keep this as last element
-float32 full_charge_capacity_wh # [Wh] Compensated battery capacity
-float32 remaining_capacity_wh # [Wh] Compensated battery capacity remaining
-uint16 over_discharge_count # Number of battery overdischarge
-float32 nominal_voltage # [V] Nominal voltage of the battery pack
+float32 full_charge_capacity_wh # [Wh] Compensated battery capacity
+float32 remaining_capacity_wh # [Wh] Compensated battery capacity remaining
+uint16 over_discharge_count # [-] Number of battery overdischarge
+float32 nominal_voltage # [V] Nominal voltage of the battery pack
-float32 internal_resistance_estimate # [Ohm] Internal resistance per cell estimate
-float32 ocv_estimate # [V] Open circuit voltage estimate
-float32 ocv_estimate_filtered # [V] Filtered open circuit voltage estimate
-float32 volt_based_soc_estimate # [@range 0, 1] Normalized volt based state of charge estimate
-float32 voltage_prediction # [V] Predicted voltage
-float32 prediction_error # [V] Prediction error
-float32 estimation_covariance_norm # Norm of the covariance matrix
+float32 internal_resistance_estimate # [Ohm] Internal resistance per cell estimate
+float32 ocv_estimate # [V] Open circuit voltage estimate
+float32 ocv_estimate_filtered # [V] Filtered open circuit voltage estimate
+float32 volt_based_soc_estimate # [-] [@range 0, 1] Normalized volt based state of charge estimate
+float32 voltage_prediction # [V] Predicted voltage
+float32 prediction_error # [V] Prediction error
+float32 estimation_covariance_norm # [-] Norm of the covariance matrix
```
diff --git a/docs/zh/msg_docs/EstimatorStatus.md b/docs/zh/msg_docs/EstimatorStatus.md
index e36871df1a..9c24221691 100644
--- a/docs/zh/msg_docs/EstimatorStatus.md
+++ b/docs/zh/msg_docs/EstimatorStatus.md
@@ -52,7 +52,9 @@ uint8 CS_SYNTHETIC_MAG_Z = 25 # 25 - true when we are using a synthesized measur
uint8 CS_VEHICLE_AT_REST = 26 # 26 - true when the vehicle is at rest
uint8 CS_GPS_YAW_FAULT = 27 # 27 - true when the GNSS heading has been declared faulty and is no longer being used
uint8 CS_RNG_FAULT = 28 # 28 - true when the range finder has been declared faulty and is no longer being used
-uint8 CS_GNSS_VEL = 44 # 44 - true if GNSS velocity measurements are being fused
+uint8 CS_GNSS_VEL = 44 # 44 - true if GNSS velocity measurement fusion is intended
+uint8 CS_GNSS_FAULT = 45 # 45 - true if GNSS measurements have been declared faulty and are no longer used
+uint8 CS_YAW_MANUAL = 46 # 46 - true if yaw has been set manually
uint32 filter_fault_flags # Bitmask to indicate EKF internal faults
# 0 - true if the fusion of the magnetometer X-axis has encountered a numerical error
diff --git a/docs/zh/msg_docs/EstimatorStatusFlags.md b/docs/zh/msg_docs/EstimatorStatusFlags.md
index e3e33c6a39..0ac832817d 100644
--- a/docs/zh/msg_docs/EstimatorStatusFlags.md
+++ b/docs/zh/msg_docs/EstimatorStatusFlags.md
@@ -54,7 +54,8 @@ bool cs_valid_fake_pos # 41 - true if a valid constant position is bein
bool cs_constant_pos # 42 - true if the vehicle is at a constant position
bool cs_baro_fault # 43 - true when the current baro has been declared faulty and is no longer being used
bool cs_gnss_vel # 44 - true if GNSS velocity measurement fusion is intended
-bool cs_yaw_manual # 45 - true if yaw has been set manually
+bool cs_gnss_fault # 45 - true if GNSS measurements have been declared faulty and are no longer used
+bool cs_yaw_manual # 46 - true if yaw has been set manually
# fault status
uint32 fault_status_changes # number of filter fault status (fs) changes
diff --git a/docs/zh/msg_docs/PurePursuitStatus.md b/docs/zh/msg_docs/PurePursuitStatus.md
index 96577a0220..8d54ba473e 100644
--- a/docs/zh/msg_docs/PurePursuitStatus.md
+++ b/docs/zh/msg_docs/PurePursuitStatus.md
@@ -7,11 +7,11 @@ Pure pursuit status
```c
# Pure pursuit status
-uint64 timestamp # [us] Time since system start
-float32 lookahead_distance # [m] [@range 0, inf] Lookahead distance of pure the pursuit controller
-float32 target_bearing # [rad] [@range -pi, pi] [@frame NED] Target bearing calculated by the pure pursuit controller
-float32 crosstrack_error # [m] [@range -inf (Left of the path), inf (Right of the path)] Shortest distance from the vehicle to the path
-float32 distance_to_waypoint # [m] [@range -inf, inf]Distance from the vehicle to the current waypoint
-float32 bearing_to_waypoint # [rad] [@range -pi, pi] [@frame NED]Bearing towards current waypoint
+uint64 timestamp # [us] Time since system start
+float32 lookahead_distance # [m] [@range 0, inf] Lookahead distance of pure the pursuit controller
+float32 target_bearing # [rad] [@range -pi, pi] [@frame NED] Target bearing calculated by the pure pursuit controller
+float32 crosstrack_error # [m] [@range -inf (Left of the path), inf (Right of the path)] Shortest distance from the vehicle to the path
+float32 distance_to_waypoint # [m] [@range -inf, inf]Distance from the vehicle to the current waypoint
+float32 bearing_to_waypoint # [rad] [@range -pi, pi] [@frame NED]Bearing towards current waypoint
```
diff --git a/docs/zh/msg_docs/RoverAttitudeSetpoint.md b/docs/zh/msg_docs/RoverAttitudeSetpoint.md
index bd436278ca..ca75a6e3e2 100644
--- a/docs/zh/msg_docs/RoverAttitudeSetpoint.md
+++ b/docs/zh/msg_docs/RoverAttitudeSetpoint.md
@@ -7,7 +7,7 @@ Rover Attitude Setpoint
```c
# Rover Attitude Setpoint
-uint64 timestamp # [us] Time since system start
-float32 yaw_setpoint # [rad] [@range -inf, inf] [@frame NED] Yaw setpoint
+uint64 timestamp # [us] Time since system start
+float32 yaw_setpoint # [rad] [@range -inf, inf] [@frame NED] Yaw setpoint
```
diff --git a/docs/zh/msg_docs/RoverAttitudeStatus.md b/docs/zh/msg_docs/RoverAttitudeStatus.md
index e6df929abd..f5a9ce1f02 100644
--- a/docs/zh/msg_docs/RoverAttitudeStatus.md
+++ b/docs/zh/msg_docs/RoverAttitudeStatus.md
@@ -7,8 +7,8 @@ Rover Attitude Status
```c
# Rover Attitude Status
-uint64 timestamp # [us] Time since system start
-float32 measured_yaw # [rad] [@range -pi, pi] [@frame NED]Measured yaw
-float32 adjusted_yaw_setpoint # [rad] [@range -pi, pi] [@frame NED] Yaw setpoint that is being tracked (Applied slew rates)
+uint64 timestamp # [us] Time since system start
+float32 measured_yaw # [rad] [@range -pi, pi] [@frame NED]Measured yaw
+float32 adjusted_yaw_setpoint # [rad] [@range -pi, pi] [@frame NED] Yaw setpoint that is being tracked (Applied slew rates)
```
diff --git a/docs/zh/msg_docs/RoverPositionSetpoint.md b/docs/zh/msg_docs/RoverPositionSetpoint.md
index b45aa0515f..751536e7f9 100644
--- a/docs/zh/msg_docs/RoverPositionSetpoint.md
+++ b/docs/zh/msg_docs/RoverPositionSetpoint.md
@@ -7,11 +7,11 @@ Rover Position Setpoint
```c
# Rover Position Setpoint
-uint64 timestamp # [us] Time since system start
-float32[2] position_ned # [m] [@range -inf, inf] [@frame NED] Target position
-float32[2] start_ned # [m] [@range -inf, inf] [@frame NED] [@invalid NaN Defaults to vehicle position] Start position which specifies a line for the rover to track
-float32 cruising_speed # [m/s] [@range 0, inf] [@invalid NaN Defaults to maximum speed] Cruising speed
-float32 arrival_speed # [m/s] [@range 0, inf] [@invalid NaN Defaults to 0] Speed the rover should arrive at the target with
-float32 yaw # [rad] [@range -pi,pi] [@frame NED] [@invalid NaN Defaults to vehicle yaw] Mecanum only: Specify vehicle yaw during travel
+uint64 timestamp # [us] Time since system start
+float32[2] position_ned # [m] [@range -inf, inf] [@frame NED] Target position
+float32[2] start_ned # [m] [@range -inf, inf] [@frame NED] [@invalid NaN Defaults to vehicle position] Start position which specifies a line for the rover to track
+float32 cruising_speed # [m/s] [@range 0, inf] [@invalid NaN Defaults to maximum speed] Cruising speed
+float32 arrival_speed # [m/s] [@range 0, inf] [@invalid NaN Defaults to 0] Speed the rover should arrive at the target with
+float32 yaw # [rad] [@range -pi,pi] [@frame NED] [@invalid NaN Defaults to vehicle yaw] Mecanum only: Specify vehicle yaw during travel
```
diff --git a/docs/zh/msg_docs/RoverRateSetpoint.md b/docs/zh/msg_docs/RoverRateSetpoint.md
index 9bffa41b80..9bb844e802 100644
--- a/docs/zh/msg_docs/RoverRateSetpoint.md
+++ b/docs/zh/msg_docs/RoverRateSetpoint.md
@@ -7,7 +7,7 @@ Rover Rate setpoint
```c
# Rover Rate setpoint
-uint64 timestamp # [us] Time since system start
-float32 yaw_rate_setpoint # [rad/s] [@range -inf, inf] [@frame NED] Yaw rate setpoint
+uint64 timestamp # [us] Time since system start
+float32 yaw_rate_setpoint # [rad/s] [@range -inf, inf] [@frame NED] Yaw rate setpoint
```
diff --git a/docs/zh/msg_docs/RoverRateStatus.md b/docs/zh/msg_docs/RoverRateStatus.md
index 684e4c458a..70345fe315 100644
--- a/docs/zh/msg_docs/RoverRateStatus.md
+++ b/docs/zh/msg_docs/RoverRateStatus.md
@@ -7,9 +7,9 @@ Rover Rate Status
```c
# Rover Rate Status
-uint64 timestamp # [us] Time since system start
-float32 measured_yaw_rate # [rad/s] [@range -inf, inf] [@frame NED] Measured yaw rate
-float32 adjusted_yaw_rate_setpoint # [rad/s] [@range -inf, inf] [@frame NED] Yaw rate setpoint that is being tracked (Applied slew rates)
-float32 pid_yaw_rate_integral # [] [@range -1, 1] Integral of the PID for the closed loop yaw rate controller
+uint64 timestamp # [us] Time since system start
+float32 measured_yaw_rate # [rad/s] [@range -inf, inf] [@frame NED] Measured yaw rate
+float32 adjusted_yaw_rate_setpoint # [rad/s] [@range -inf, inf] [@frame NED] Yaw rate setpoint that is being tracked (Applied slew rates)
+float32 pid_yaw_rate_integral # [-] [@range -1, 1] Integral of the PID for the closed loop yaw rate controller
```
diff --git a/docs/zh/msg_docs/RoverSpeedSetpoint.md b/docs/zh/msg_docs/RoverSpeedSetpoint.md
index 9eea46e60f..84176cd1c3 100644
--- a/docs/zh/msg_docs/RoverSpeedSetpoint.md
+++ b/docs/zh/msg_docs/RoverSpeedSetpoint.md
@@ -7,8 +7,8 @@ Rover Speed Setpoint
```c
# Rover Speed Setpoint
-uint64 timestamp # [us] Time since system start
-float32 speed_body_x # [m/s] [@range -inf (Backwards), inf (Forwards)] [@frame Body] Speed setpoint in body x direction
-float32 speed_body_y # [m/s] [@range -inf (Left), inf (Right)] [@frame Body] [@invalid NaN If not mecanum] Mecanum only: Speed setpoint in body y direction
+uint64 timestamp # [us] Time since system start
+float32 speed_body_x # [m/s] [@range -inf (Backwards), inf (Forwards)] [@frame Body] Speed setpoint in body x direction
+float32 speed_body_y # [m/s] [@range -inf (Left), inf (Right)] [@frame Body] [@invalid NaN If not mecanum] Mecanum only: Speed setpoint in body y direction
```
diff --git a/docs/zh/msg_docs/RoverSpeedStatus.md b/docs/zh/msg_docs/RoverSpeedStatus.md
index 8c212e2b0f..4213e1e5df 100644
--- a/docs/zh/msg_docs/RoverSpeedStatus.md
+++ b/docs/zh/msg_docs/RoverSpeedStatus.md
@@ -7,12 +7,12 @@ Rover Velocity Status
```c
# Rover Velocity Status
-uint64 timestamp # [us] Time since system start
-float32 measured_speed_body_x # [m/s] [@range -inf (Backwards), inf (Forwards)] [@frame Body] Measured speed in body x direction
-float32 adjusted_speed_body_x_setpoint # [m/s] [@range -inf (Backwards), inf (Forwards)] [@frame Body] Speed setpoint in body x direction that is being tracked (Applied slew rates)
-float32 pid_throttle_body_x_integral # [] [@range -1, 1] Integral of the PID for the closed loop controller of the speed in body x direction
-float32 measured_speed_body_y # [m/s] [@range -inf (Left), inf (Right)] [@frame Body] [@invalid NaN If not mecanum] Mecanum only: Measured speed in body y direction
-float32 adjusted_speed_body_y_setpoint # [m/s] [@range -inf (Left), inf (Right)] [@frame Body] [@invalid NaN If not mecanum] Mecanum only: Speed setpoint in body y direction that is being tracked (Applied slew rates)
-float32 pid_throttle_body_y_integral # [] [@range -1, 1] [@invalid NaN If not mecanum] Mecanum only: Integral of the PID for the closed loop controller of the speed in body y direction
+uint64 timestamp # [us] Time since system start
+float32 measured_speed_body_x # [m/s] [@range -inf (Backwards), inf (Forwards)] [@frame Body] Measured speed in body x direction
+float32 adjusted_speed_body_x_setpoint # [m/s] [@range -inf (Backwards), inf (Forwards)] [@frame Body] Speed setpoint in body x direction that is being tracked (Applied slew rates)
+float32 pid_throttle_body_x_integral # [-] [@range -1, 1] Integral of the PID for the closed loop controller of the speed in body x direction
+float32 measured_speed_body_y # [m/s] [@range -inf (Left), inf (Right)] [@frame Body] [@invalid NaN If not mecanum] Mecanum only: Measured speed in body y direction
+float32 adjusted_speed_body_y_setpoint # [m/s] [@range -inf (Left), inf (Right)] [@frame Body] [@invalid NaN If not mecanum] Mecanum only: Speed setpoint in body y direction that is being tracked (Applied slew rates)
+float32 pid_throttle_body_y_integral # [-] [@range -1, 1] [@invalid NaN If not mecanum] Mecanum only: Integral of the PID for the closed loop controller of the speed in body y direction
```
diff --git a/docs/zh/msg_docs/RoverSteeringSetpoint.md b/docs/zh/msg_docs/RoverSteeringSetpoint.md
index 3e40a3986b..974f3fc4c9 100644
--- a/docs/zh/msg_docs/RoverSteeringSetpoint.md
+++ b/docs/zh/msg_docs/RoverSteeringSetpoint.md
@@ -7,7 +7,7 @@ Rover Steering setpoint
```c
# Rover Steering setpoint
-uint64 timestamp # [us] Time since system start
-float32 normalized_steering_setpoint # [@range -1 (Left), 1 (Right)] [@frame Body] Ackermann: Normalized steering angle, Differential/Mecanum: Normalized speed difference between the left and right wheels
+uint64 timestamp # [us] Time since system start
+float32 normalized_steering_setpoint # [-] [@range -1 (Left), 1 (Right)] [@frame Body] Ackermann: Normalized steering angle, Differential/Mecanum: Normalized speed difference between the left and right wheels
```
diff --git a/docs/zh/msg_docs/RoverThrottleSetpoint.md b/docs/zh/msg_docs/RoverThrottleSetpoint.md
index f1c4f7f653..bd5ee93d55 100644
--- a/docs/zh/msg_docs/RoverThrottleSetpoint.md
+++ b/docs/zh/msg_docs/RoverThrottleSetpoint.md
@@ -7,8 +7,8 @@ Rover Throttle setpoint
```c
# Rover Throttle setpoint
-uint64 timestamp # [us] Time since system start
-float32 throttle_body_x # [] [@range -1 (Backwards), 1 (Forwards)] [@frame Body] Throttle setpoint along body X axis
-float32 throttle_body_y # [] [@range -1 (Left), 1 (Right)] [@frame Body] [@invalid NaN If not mecanum] Mecanum only: Throttle setpoint along body Y axis
+uint64 timestamp # [us] Time since system start
+float32 throttle_body_x # [-] [@range -1 (Backwards), 1 (Forwards)] [@frame Body] Throttle setpoint along body X axis
+float32 throttle_body_y # [-] [@range -1 (Left), 1 (Right)] [@frame Body] [@invalid NaN If not mecanum] Mecanum only: Throttle setpoint along body Y axis
```
diff --git a/docs/zh/msg_docs/VehicleCommand.md b/docs/zh/msg_docs/VehicleCommand.md
index 19557cf496..6c5e87ff5b 100644
--- a/docs/zh/msg_docs/VehicleCommand.md
+++ b/docs/zh/msg_docs/VehicleCommand.md
@@ -96,6 +96,7 @@ uint16 VEHICLE_CMD_REQUEST_CAMERA_INFORMATION = 521 # Request camera information
uint16 VEHICLE_CMD_SET_CAMERA_MODE = 530 # Set camera capture mode (photo, video, etc.).
uint16 VEHICLE_CMD_SET_CAMERA_ZOOM = 531 # Set camera zoom.
uint16 VEHICLE_CMD_SET_CAMERA_FOCUS = 532
+uint16 VEHICLE_CMD_EXTERNAL_ATTITUDE_ESTIMATE = 620 # Set an external estimate of vehicle attitude in degrees.
uint16 VEHICLE_CMD_DO_GIMBAL_MANAGER_PITCHYAW = 1000 # Setpoint to be sent to a gimbal manager to set a gimbal pitch and yaw.
uint16 VEHICLE_CMD_DO_GIMBAL_MANAGER_CONFIGURE = 1001 # Gimbal configuration to set which sysid/compid is in primary and secondary control.
uint16 VEHICLE_CMD_IMAGE_START_CAPTURE = 2000 # Start image capture sequence.
diff --git a/docs/zh/msg_docs/VehicleStatus.md b/docs/zh/msg_docs/VehicleStatus.md
index d1deeb0500..9d46e42cb3 100644
--- a/docs/zh/msg_docs/VehicleStatus.md
+++ b/docs/zh/msg_docs/VehicleStatus.md
@@ -48,7 +48,7 @@ uint8 NAVIGATION_STATE_AUTO_LOITER = 4 # Auto loiter mode
uint8 NAVIGATION_STATE_AUTO_RTL = 5 # Auto return to launch mode
uint8 NAVIGATION_STATE_POSITION_SLOW = 6
uint8 NAVIGATION_STATE_FREE5 = 7
-uint8 NAVIGATION_STATE_FREE4 = 8
+uint8 NAVIGATION_STATE_ALTITUDE_CRUISE = 8 # Altitude with Cruise mode
uint8 NAVIGATION_STATE_FREE3 = 9
uint8 NAVIGATION_STATE_ACRO = 10 # Acro mode
uint8 NAVIGATION_STATE_FREE2 = 11
diff --git a/docs/zh/msg_docs/index.md b/docs/zh/msg_docs/index.md
index 9e80e1af98..7b76ddabbf 100644
--- a/docs/zh/msg_docs/index.md
+++ b/docs/zh/msg_docs/index.md
@@ -16,8 +16,8 @@ Graphs showing how these are used [can be found here](../middleware/uorb_graph.m
- [ActuatorMotors](ActuatorMotors.md) — Motor control message
- [ActuatorServos](ActuatorServos.md) — Servo control message
- [AirspeedValidated](AirspeedValidated.md)
-- [ArmingCheckReply](ArmingCheckReply.md) — Arming check reply.
-- [ArmingCheckRequest](ArmingCheckRequest.md) — Arming check request.
+- [ArmingCheckReply](ArmingCheckReply.md) — Arming check reply
+- [ArmingCheckRequest](ArmingCheckRequest.md) — Arming check request
- [BatteryStatus](BatteryStatus.md) — Battery status
- [ConfigOverrides](ConfigOverrides.md) — Configurable overrides by (external) modes or mode executors
- [Event](Event.md) — Events interface
diff --git a/docs/zh/releases/main.md b/docs/zh/releases/main.md
index ce9b6b6e95..6166e251c5 100644
--- a/docs/zh/releases/main.md
+++ b/docs/zh/releases/main.md
@@ -44,7 +44,9 @@ Please continue reading for [upgrade instructions](#upgrade-guide).
### Control
-- TBD
+- Added new flight mode(s): [Altitude Cruise (MC)](../flight_modes_mc/altitude_cruise.md), Altitude Cruise (FW).
+ For fixed-wing the mode behaves the same as Altitude mode but you can disable the manual control loss failsafe. (PX4-Autopilot#25435: Add new flight mode: Altitude Cruise
+ ).
### Estimation
@@ -72,7 +74,8 @@ Please continue reading for [upgrade instructions](#upgrade-guide).
### Multi-Rotor
-- TBD
+- Removed parameters `MPC_{XY/Z/YAW}_MAN_EXPO` and use default value instead, as they were not deemed necessary anymore. ([PX4-Autopilot#25435: Add new flight mode: Altitude Cruise](https://github.com/PX4/PX4-Autopilot/pull/25435)).
+- Renamed `MPC_HOLD_DZ` to `MAN_DEADZONE` to have it globally available in modes that allow for a dead zone. ([PX4-Autopilot#25435: Add new flight mode: Altitude Cruise](https://github.com/PX4/PX4-Autopilot/pull/25435)).
### 垂直起降
diff --git a/docs/zh/ros2/index.md b/docs/zh/ros2/index.md
index bf9ad53aa0..435dd9cfa0 100644
--- a/docs/zh/ros2/index.md
+++ b/docs/zh/ros2/index.md
@@ -7,13 +7,13 @@ ROS 2 是ROS (机器人操作系统)最新版本 , 一个通用的机器人库
PX4开发团队强烈建议您使用/迁移到此版本的 ROS!
这是最新版本的 [ROS](https://www.ros.org/) (机器人操作系统)。
-它大大改进了外空军备竞赛“1”,尤其是允许与PX4更深、更低的延迟结合。
+它大大改进了ROS1,特别是允许与PX4更深、更低的延迟结合。
:::
-ROS得益于一个活跃的生态系统,在这个生态系统里,开发者会解决常见的机器人问题,他们也有权使用为Linux编写的其他软件库。
-例如,它可以用于[计算机视图](../computer_vision/index.md)解决方案。
+ROS得益于一个活跃的生态系统,在这个生态系统里,开发者会解决常见的机器人问题,他们也为Linux编写软件库。
+例如,它可以用于[计算机视觉](../computer_vision/index.md)解决方案。
-ROS 2能够非常深入地与 PX4 集成 只要你可以在交战规则2中创建无法与内部的 PX4 模式区分的飞行模式, 并以高费率直接读取内部uORB主题。
+ROS 2深度与 PX4 集成, 在某种程度上,您能够在 ROS 2 中创建与内部 PX4 模式无法区分的飞行模式, 并高效率的直接订阅uORB内部的话题。
建议(尤其是)从同伴计算机进行控制和通信,因为这种计算机的延迟率很低。 当利用来自Linux的现有库时,或在编写新的高层飞行模式时。
ROS 2 和 PX4 之间的通信使用中间件实现[XRCE-DDS] (../middleware/uxrce_dds.md)。
diff --git a/docs/zh/ros2/multi_vehicle.md b/docs/zh/ros2/multi_vehicle.md
index ab366b4a5a..a525a32445 100644
--- a/docs/zh/ros2/multi_vehicle.md
+++ b/docs/zh/ros2/multi_vehicle.md
@@ -1,4 +1,4 @@
-# 使用 ROS 2 进行多车辆仿真
+# 使用 ROS 2 进行多车辆模拟
[XRCE-DDS](../middleware/uxrce_dds.md) 支持多个客户端通过 UDP 协议连接到同一个代理。
这在模拟中特别有用,因为只有一个代理需要启动。
@@ -8,7 +8,7 @@
唯一的要求是
- 能够在不依赖 ROS 2 的情况下,使用所需的仿真器([Gazebo](../sim_gazebo_gz/multi_vehicle_simulation.md), [Gazebo Classic](../sim_gazebo_classic/multi_vehicle_simulation.md#multiple-vehicle-with-gazebo-classic), [FlightGear](../sim_flightgear/multi_vehicle.md) 和 [JMAVSim](../sim_jmavsim/multi_vehicle.md))运行多车辆仿真[multi-vehicle simulation](../simulation/multi-vehicle-simulation.md)。
-- 能够在单车辆仿真中使用ROS 2(机器人操作系统 2)
+- 能够在单一车辆仿真中使用ROS 2(机器人操作系统 2)
## 工作原理
@@ -51,4 +51,4 @@ PX4 只在他们的 `target_system` 字段为 0 (路由通信) 或与 `MAV_SYS_I
在所有其他情况下,信息都被忽视。
因此,当 ROS 2 节点需向 PX4 发送 VehicleCommand(载具指令)消息时,必须确保消息中填写了合适的 target_system(目标系统)字段值。
-For example, if you want to send a command to your third vehicle, which has `px4_instance=2`, you need to set `target_system=3` in all your `VehicleCommand` messages.
+例如,若你想向 px4_instance=2 的第三台飞行器发送指令,则需要在所有 VehicleCommand消息中设置 target_system=3。
diff --git a/docs/zh/ros2/offboard_control.md b/docs/zh/ros2/offboard_control.md
index 12c4217bf7..910eccde12 100644
--- a/docs/zh/ros2/offboard_control.md
+++ b/docs/zh/ros2/offboard_control.md
@@ -5,7 +5,7 @@
示例将首先发送设置点、进入offboard模式、解锁、起飞至5米,并悬停等待。
虽然简单,但它显示了如何使用offboard控制以及如何向无人机发送指令。
-It has been tested on Ubuntu 20.04 with ROS 2 Foxy and PX4 v1.14.
+该内容已在搭载 ROS 2 Foxy 与 PX4 v1.14 的 Ubuntu 20.04 系统上完成测试。
:::warning
_Offboard_ control is dangerous.
@@ -13,22 +13,22 @@ _Offboard_ control is dangerous.
:::
:::info
-ROS and PX4 make a number of different assumptions, in particular with respect to [frame conventions](../ros/external_position_estimation.md#reference-frames-and-ros).
+ROS 与 PX4 存在若干不同的预设(假设),尤其是在坐标系约定([frame conventions])方面../ros/external_position_estimation.md#reference-frames-and-ros
当主题发布或订阅时,坐标系类型之间没有隐含转换!
-这个例子按照PX4的定义在NED坐标系下发布位置。
-To subscribe to data coming from nodes that publish in a different frame (for example the ENU, which is the standard frame of reference in ROS/ROS 2), use the helper functions in the [frame_transforms](https://github.com/PX4/px4_ros_com/blob/main/src/lib/frame_transforms.cpp) library.
+这个例子按照PX4的预期在NED坐标系下发布位置。
+若要订阅来自在不同框架内发布的节点的数据(例如ENU, 这是ROS/ROS 2中的标准参考框架,使用 [frame_transforms](https://github.com/PX4/px4_ros_com/blob/main/src/lib/frame_transforms.cpp)库中的辅助函数。
:::
-## 尝试一下
+## 小試身手
-Follow the instructions in [ROS 2 User Guide](../ros2/user_guide.md) to install PX and run the simulator, install ROS 2, and start the XRCE-DDS Agent.
+请遵循 ROS 2 用户指南 (../ros2/user_guide.md)中的说明,完成安装 PX4和运行模拟器,安装 ROS 2和启动 XRCE-DDS 代理(Agent)。
-After that we can follow a similar set of steps to those in [ROS 2 User Guide > Build ROS 2 Workspace](../ros2/user_guide.md#build-ros-2-workspace) to run the example.
+之后,我们可参照 ROS 2 用户指南 > 构建 ROS 2 工作空间 (../ros2/user_guide.md#build-ros-2-workspace)中的相似的步骤来运行这个例子。
:::tip
-Make sure that QGC is connected to PX4 before running the ROS 2 node.
-This is needed because, by default, you cannot arm a vehicle without a connection to ground station (QGC) or an established RC connection (this ensures there is always the option to regain manual control).
+运行 ROS 2 节点前,请确保 QGC已连接到 PX4。
+之所以需要这样做,是因为默认情况下,若未连接地面控制站(QGC)或已建立的RC连接,飞行器无法解锁(这一机制可确保始终存在重新获得手动控制权的途径)。
:::
构建并运行示例:
@@ -42,14 +42,14 @@ This is needed because, by default, you cannot arm a vehicle without a connectio
cd ~/ws_offboard_control/src/
```
-3. Clone the [px4_msgs](https://github.com/PX4/px4_msgs) repo to the `/src` directory (this repo is needed in every ROS 2 PX4 workspace!):
+3. 将 px4_msgs 代码仓库克隆到 /src 目录下(每个 ROS 2 PX4 工作空间都需要该仓库!):
```sh
git clone https://github.com/PX4/px4_msgs.git
- # checkout the matching release branch if not using PX4 main.
+ #若未使用 PX4 的 main 分支,请切换到对应的发布分支
```
-4. Clone the example repository [px4_ros_com](https://github.com/PX4/px4_ros_com) to the `/src` directory:
+4. 将示例代码仓库 px4_ros_com (https://github.com/PX4/px4_ros_com)克隆到 /src 目录下:
```sh
git clone https://github.com/PX4/px4_ros_com.git
@@ -83,7 +83,7 @@ This is needed because, by default, you cannot arm a vehicle without a connectio
::::
-6. Source the `local_setup.bash`:
+6. 来源 `local_setup.bash`:
```sh
source install/local_setup.bash
@@ -99,81 +99,81 @@ This is needed because, by default, you cannot arm a vehicle without a connectio
## 实现
-The source code of the offboard control example can be found in [PX4/px4_ros_com](https://github.com/PX4/px4_ros_com) in the directory [/src/examples/offboard/offboard_control.cpp](https://github.com/PX4/px4_ros_com/blob/main/src/examples/offboard/offboard_control.cpp).
+离板控制示例的源代码可以在[ PX4/px4_ros_com ]目录里 [/src/examples/offboard/offboard_control.cpp](https://github.com/PX4/px4_ros_com/blob/main/src/examples/offboard/offboard_control.cpp)中找到 [X4/px4_ros_com](https://github.com/PX4/px4_ros_com)。
:::info
-PX4 publishes all the messages used in this example as ROS topics by default (see [dds_topics.yaml](https://github.com/PX4/PX4-Autopilot/blob/main/src/modules/uxrce_dds_client/dds_topics.yaml)).
+PX4 默认情况下将此示例中使用的所有消息以ROS为话题发布(详见 [dds_topics.yaml](https://github.com/PX4/PX4-Autopilot/blob/main/src/modules/uxrce_dds_client/dds_topics.yaml))。
:::
-PX4 requires that the vehicle is already receiving `OffboardControlMode` messages before it will arm in offboard mode, or before it will switch to offboard mode when flying.
-In addition, PX4 will switch out of offboard mode if the stream rate of `OffboardControlMode` messages drops below approximately 2Hz.
+PX4 要求,飞行器需先持续接收 OffboardControlMode(离板控制模式)消息,之后才能在离板模式下解锁(arm),或在飞行过程中切换至离板模式。
+此外,若 OffboardControlMode(离板控制模式)消息的数据流速率降至约 2Hz 以下,PX4 将会退出离板模式。
该行为在ROS 2 节点的主循环中实现的,如下所示:
```cpp
-auto timer_callback = [this]() -> void {
+auto timer_callback = [this]() -> void {
- if (offboard_setpoint_counter_ == 10) {
- // Change to Offboard mode after 10 setpoints
- this->publish_vehicle_command(VehicleCommand::VEHICLE_CMD_DO_SET_MODE, 1, 6);
+ if (offboard_setpoint_counter_ == 10) {
+ // Change to Offboard mode after 10 setpoints
+ this->publish_vehicle_command(VehicleCommand::VEHICLE_CMD_DO_SET_MODE, 1, 6);
- // Arm the vehicle
- this->arm();
- }
+ // Arm the vehicle
+ this->arm();
+ }
- // OffboardControlMode needs to be paired with TrajectorySetpoint
- publish_offboard_control_mode();
- publish_trajectory_setpoint();
+ // OffboardControlMode needs to be paired with TrajectorySetpoint
+ publish_offboard_control_mode();
+ publish_trajectory_setpoint();
- // stop the counter after reaching 11
- if (offboard_setpoint_counter_ < 11) {
- offboard_setpoint_counter_++;
- }
+ // stop the counter after reaching 11
+ if (offboard_setpoint_counter_ < 11) {
+ offboard_setpoint_counter_++;
+ }
};
-timer_ = this->create_wall_timer(100ms, timer_callback);
+timer_ = this->create_wall_timer(100ms, timer_callback);
```
循环运行在一个100毫秒计时器。
-For the first 10 cycles it calls `publish_offboard_control_mode()` and `publish_trajectory_setpoint()` to send [OffboardControlMode](../msg_docs/OffboardControlMode.md) and [TrajectorySetpoint](../msg_docs/TrajectorySetpoint.md) messages to PX4.
-The `OffboardControlMode` messages are streamed so that PX4 will allow arming once it switches to offboard mode, while the `TrajectorySetpoint` messages are ignored (until the vehicle is in offboard mode).
+在最初的 10 个循环中,它会调用 publish_offboard_control_mode() 和 publish_trajectory_setpoint() 这两个函数,向 PX4 发送 OffboardControlMode(离板控制模式)(../msg_docs/OffboardControlMode.md) 和 TrajectorySetpoint(轨迹设定点)(../msg_docs/TrajectorySetpoint.md) 消息。
+OffboardControlMode消息会持续发送,以便 PX4 切换到离板模式后允许解锁;而 TrajectorySetpoint消息会被忽略(直到载具处于离板模式)
-After 10 cycles `publish_vehicle_command()` is called to change to offboard mode, and `arm()` is called to arm the vehicle.
-在飞行器解锁并和切换模式后,它将开始跟踪位置设定值。
-在每个周期内仍然发送设定值,确保飞行器不会切换出offboard模式。
+10 个循环后,会调用 publish_vehicle_command() 函数切换至离板模式,并调用 arm() 函数对载具进行解锁。
+在载具解锁并和切换模式后,它将开始跟踪位置设定值。
+在每个周期内仍然发送设定值,确保载具不会切换出offboard模式。
-The implementations of the `publish_offboard_control_mode()` and `publish_trajectory_setpoint()` methods are shown below.
-These publish the [OffboardControlMode](../msg_docs/OffboardControlMode.md) and [TrajectorySetpoint](../msg_docs/TrajectorySetpoint.md) messages to PX4 (respectively).
+publish_offboard_control_mode() 和 publish_trajectory_setpoint() 这两个方法的实现代码如下所示。
+这些方法会分别发布到 PX4 的 [OffboardControlMode](../msg_docs/OffboardControlMode.md和 [TrajectorySetpoint](../msg_docs/TrajectorySetpoint.md) 消息。
-The `OffboardControlMode` is required in order to inform PX4 of the _type_ of offboard control behing used.
-Here we're only using _position control_, so the `position` field is set to `true` and all the other fields are set to `false`.
+OffboardControlMode(离板控制模式)消息是必需的,其作用是告知 PX4 当前所使用的离板控制类型。
+此处我们仅使用位置控制,因此将 `position` 字段设为`true`,而所有其他字段均设为 `false`。
```cpp
/**
- * @brief Publish the offboard control mode.
- * For this example, only position and altitude controls are active.
+ * @short 发布离板控制模式。
+ *在本示例中,仅位置控制和高度控制处于激活状态
*/
-void OffboardControl::publish_offboard_control_mode()
-{
- OffboardControlMode msg{};
- msg.position = true;
- msg.velocity = false;
- msg.acceleration = false;
+无效的离板控制::publish_offboard_control_mode()
+Power
+ OffboardControlModel msg{};
+ msg.position = true;
+ msg.veocity = false;
+ msg. cceleration = false;
msg.attitude = false;
msg.body_rate = false;
- msg.thrust_and_torque = false;
- msg.direct_actuator = false;
- msg.timestamp = this->get_clock()->now().nanoseconds() / 1000;
+ msg.subust_and_torque = false;
+ msg. irect_actuator = false;
+ msg.timestamp = this->get_clock()->now ().nanoseconds() / 1000;
offboard_control_mode_publisher_->publish(msg);
}
```
-`TrajectorySetpoint` provides the position setpoint.
-In this case, the `x`, `y`, `z` and `yaw` fields are hardcoded to certain values, but they can be updated dynamically according to an algorithm or even by a subscription callback for messages coming from another node.
+`TrattorySettpoint` 提供了位置设定点。
+在这种情况下,`x`、`y`、`z`和`yaw`字段的值是硬编码为特定数值的。 但它们可以根据算法动态更新,甚至可以通过订阅回调函数来从另一个节点进行更新。
```cpp
/**
- * @brief Publish a trajectory setpoint
- * For this example, it sends a trajectory setpoint to make the
- * vehicle hover at 5 meters with a yaw angle of 180 degrees.
+ *@brief 发布轨迹设定点
+
+ 在本示例中,该函数会发送一个轨迹设定点,使载具在 5 米高度悬停,并保持 180 度的偏航角。
*/
void OffboardControl::publish_trajectory_setpoint()
{
@@ -185,9 +185,9 @@ void OffboardControl::publish_trajectory_setpoint()
}
```
-The `publish_vehicle_command()` sends [VehicleCommand](../msg_docs/VehicleCommand.md) messages with commands to the flight controller.
-We use it above to change the mode to offboard mode, and also in `arm()` to arm the vehicle.
-While we don't call `disarm()` in this example, it is also used in the implementation of that function.
+`publish_vehicle_command()` 将带有命令的 [VehicleCommand](../msg_docs/VehicleCommand.md)消息发送给载具。
+我们使用上面的方法将模式切换为 offboard 模式,同时也在 arm() 函数中用它来对载具进行解锁。
+我们在此示例中不调用 `disarm()` ,但它也用于执行此功能。
```cpp
/**
@@ -198,23 +198,23 @@ While we don't call `disarm()` in this example, it is also used in the implement
*/
void OffboardControl::publish_vehicle_command(uint16_t command, float param1, float param2)
{
- VehicleCommand msg{};
- msg.param1 = param1;
- msg.param2 = param2;
- msg.command = command;
- msg.target_system = 1;
- msg.target_component = 1;
- msg.source_system = 1;
- msg.source_component = 1;
- msg.from_external = true;
- msg.timestamp = this->get_clock()->now().nanoseconds() / 1000;
- vehicle_command_publisher_->publish(msg);
+ VehicleCommand msg{};
+ msg.param1 = param1;
+ msg.param2 = param2;
+ msg.command = command;
+ msg.target_system = 1;
+ msg.target_component = 1;
+ msg.source_system = 1;
+ msg.source_component = 1;
+ msg.from_external = true;
+ msg.timestamp = this->get_clock()->now().nanoseconds() / 1000;
+ vehicle_command_publisher_->publish(msg);
}
```
:::info
-[VehicleCommand](../msg_docs/VehicleCommand.md) is one of the simplest and most powerful ways to command PX4, and by subscribing to [VehicleCommandAck](../msg_docs/VehicleCommandAck.md) you can also confirm that setting a particular command was successful.
-The param and command fields map to [MAVLink commands](https://mavlink.io/en/messages/common.html#mav_commands) and their parameter values.
+[VehicleCommand](../msg_docs/VehicleCommand.md是命令PX4的最简单和最高效的方式之一。 通过订阅 [VehicleCommandAck](../msg_docs/VehicleCommandAck.md),您也可以确认设置特定命令是否成功。
+参数字段和 指令字段对应于 [MAVLink commands](https://mavlink.io/en/messages/common.html#mav_commands)以及他们的参数值
:::
## See Also
diff --git a/docs/zh/ros2/px4_ros2_control_interface.md b/docs/zh/ros2/px4_ros2_control_interface.md
index cc1e139124..7aea8b7b58 100644
--- a/docs/zh/ros2/px4_ros2_control_interface.md
+++ b/docs/zh/ros2/px4_ros2_control_interface.md
@@ -1,108 +1,108 @@
-# PX4 ROS 2 Control Interface
+# PX4 ROS 2 控制接口
<0/> <1/>
:::warning
Experimental
-At the time of writing, parts of the PX4 ROS 2 Control Interface are experimental, and hence subject to change:
+在撰写本文时,PX4 ROS 2 控制接口的部分内容仍处于实验阶段,因此可能会发生变动:
-- The architecture and core interfaces for defining modes in ROS 2 modes are largely stable, and are tested in CI.
- The library offers significant benefits over using offboard mode in its current state.
-- Only a few setpoint types have settled (the others are still under development).
- You may need to use internal PX4 topics which may not remain backwards-compatible over time.
-- The API is not fully documented.
+- ROS 2 模式中用于定义模式的架构及核心接口在很大程度上已趋于稳定,且会在CI中进行测试
+ 相比当前状态下的离板模式,该代码库具有显著优势
+- 仅有少数几种设定点类型已趋于稳定。(其余设定点类型仍在开发中)
+ 您可能需要使用内部的 PX4 主题,这些主题可能不会随着时间的推移而保持与后方兼容。
+- 该 API没有完整的文档
:::
-The [PX4 ROS 2 Interface Library](../ros2/px4_ros2_interface_lib.md) is a C++ library that simplifies controlling PX4 from ROS 2.
+这[PX4 ROS 2接口库](../ros2/px4_ros2_interface_lib.md)是一个 C++ 库,可简化从 ROS 2 控制 PX4 的操作。
-Developers use the library to create and dynamically register modes written using ROS 2.
-These modes are dynamically registered with PX4, and appear to be part of PX4 to a ground station or other external system.
-They can even replace the default modes in PX4 with enhanced ROS 2 versions, falling back to the original version if the ROS2 mode fails.
+开发者可使用该库创建并动态注册以 ROS 2 编写的模式。
+这些模式会动态注册到 PX4 中,并且对于地面站或其他外部系统而言,它们看起来就像是 PX4 的一部分。
+开发者甚至可以用功能增强的 ROS 2 版本模式替换 PX4 中的默认模式,且若 ROS 2 模式失效,系统会回退到原始版本的模式。
-The library also provides classes for sending different types of setpoints, ranging from high-level navigation tasks all the way down to direct actuator controls.
-These classes abstract the internal setpoints used by PX4, and that can therefore be used to provide a consistent ROS 2 interface for future PX4 and ROS releases.
+该库还提供了用于发送不同类型设定点的类,其涵盖范围从高层级的导航任务一直到直接的执行器控制。
+这些类对 PX4 所使用的内部设定点进行了抽象处理,因此可用于为未来的 PX4 和 ROS 版本提供统一的 ROS 2 接口。
-PX4 ROS 2 modes are easier to implement and maintain than PX4 internal modes, and provide more resources for developers in terms of processing power and pre-existing libraries.
-Unless the mode is safety-critical, requires strict timing or very high update rates, or your vehicle doesn't have a companion computer, you should [consider using PX4 ROS 2 modes in preference to PX4 internal modes](../concept/flight_modes.md#internal-vs-external-modes).
+PX4 ROS 2 模式相较于 PX4 内部模式,更易于实现和维护,并且在处理能力与既有代码库资源方面,能为开发者提供更丰富的支持。
+除非该模式属于安全关键型、对时序有严格要求或需要极高的更新速率,或者你的飞行器没有搭载伴随计算机,否则你应优先[考虑使用 PX4 ROS 2 模式,而非 PX4 内部模式](参考链接:../concept/flight_modes.md#internal-vs-external-modes)。
## 综述
-This diagram provides a conceptual overview of how the control interface modes and mode executors interact with PX4.
+该图从概念层面概述了控制接口模式与模式执行器如何与 PX4 进行交互。
-
+
-The following sections define and explain the terms used in the diagram.
+以下章节对图表中使用的术语进行定义和解释。
-### Definitions
+### 定义
-#### Mode
+#### 模式
-A mode defined using the interface library has the following properties:
+使用接口库定义的模式具有以下特性:
-- A mode is a component that can send setpoints to the vehicle in order to control its motion (such as velocity or direct actuator commands).
-- A mode selects a setpoint type and sends it while it is active.
- It can switch between multiple setpoint types.
-- A mode can't activate other modes, and must be activated by the user (through RC/GCS), the flight controller in a failsafe situation, a _mode executor_, or some other external system.
-- Has a name displayed by the GCS.
-- Can configure its mode requirements (for example that it requires a valid position estimate).
-- A mode can perform different tasks, such as flying to a target, lowering a winch, releasing a payload and then fly back.
-- A mode can replace a mode defined in PX4.
+- 模式是一种组件,它可以向载具发送设定值以控制其运动(例如速度指令或直接执行器指令)。
+- 模式在激活状态下会选择一种设定值类型并发送该设定值。
+ 它能够在多种设定值类型之间进行切换。
+- 一种模式无法激活其他模式,其必须由以下对象激活:用户(通过RC/GCS)、处于故障保护状态下的飞控、mode executor_,或其他某种外部系统。
+- 具有一个由GCS显示的名称。
+- 可配置其模式要求(例如,要求具备有效的位置估算值)
+- 一种模式可执行不同任务,例如飞往目标点、下放绞盘、释放有效载荷,之后返航。
+- 一种模式可替换 PX4 中已定义的模式。
-#### Mode Executor
+#### 模式执行器
-A mode executor is an optional component for scheduling modes.
-For example, the mode executor for a custom payload delivery or survey mode might first trigger a take-off, then switch to the custom mode, and when that completes trigger an RTL.
+模式执行器是用于调度模式的可选组件。
+例如,用于自定义有效载荷投放或测绘模式的模式执行器,可能会先触发起飞,随后切换至该自定义模式,待模式完成后再触发RTL。
-Specifically, it has the following properties:
+具体而言,它具有以下特性:
-- A mode executor is an optional component one level higher than a mode.
- It is a state machine that can activate modes, and wait for their completion.
-- It can only do so while it is in charge.
- For that, an executor has exactly one _owned mode_ (and a mode can be owned by at most one executor).
- This mode serves as activation for the executor: when the user selects the mode, the owning executor gets activated and can select any mode.
- It stays in charge until the user switches modes (by RC or from a GCS), or a failsafe triggers a mode switch.
- Should the failsafe clear, the executor gets reactivated.
-- This allows multiple executors to coexist.
-- Executors cannot activate other executors.
-- Within the library, a mode executor is always implemented in combination with a custom mode.
+- 模式执行器是一种可选组件,其层级比模式高一级。
+ 它是一种状态机,能够激活模式并等待模式完成。
+- 它仅能在负责状态下执行此操作。
+ 为此,一个执行器恰好拥有一个_owned mode_(且一个模式最多只能被一个执行器拥有)。
+ 该模式可作为执行器的激活触发条件:当用户选择此模式时,其所属的执行器会被激活,进而能够选择任意模式。
+ 它会一直处于管控状态,直至用户(通过遥控器或从地面控制站)切换模式,或故障保护机制触发模式切换。
+ 若故障保护状态解除,执行器将重新激活。
+- 这允许多个执行器共存。
+- 执行器无法激活其他执行器。
+- 在该库中,模式执行器始终需结合自定义模式来实现。
::: info
-- These definitions guarantee that a user can take away control from a custom mode or executor at any point in time by commanding a mode switch through RC or a GCS.
-- A mode executor is transparent to the user.
- It gets indirectly selected and activated through the owning mode, and thus the mode should be named accordingly.
+- 这些定义确保用户可在任意时刻通过RC或GCS发送模式切换指令,从而夺回对自定义模式或执行器的控制权。
+- 模式执行器对用户而言是透明的。
+ 它通过所属模式被间接选择并激活,因此该模式应相应地命名。
:::
-#### Configuration Overrides
+#### 配置覆盖
-Both modes and executors can define configuration overrides, allowing customisation of certain behaviors while the mode or executor is active.
+模式和执行器均可定义配置覆盖,从而能在模式或执行器处于激活状态时,对特定行为进行自定义设置。
-These are currently implemented:
+这些措施目前正在实施:
- _Disabling auto-disarm_.
- This permits landing and then taking off again (e.g. to release a payload).
+ 这允许着陆,然后再次起飞(例如释放有效载荷)。
- _Ability to defer non-essential failsafes_.
- This allows an executor to run an action without being interrupted by non-critical failsafe.
- For example, ignoring a low-battery failsafe so that a winch operation can complete.
+ 这使得执行器能够执行某项操作,且不会被非关键故障保护中断。
+ 例如,忽略低电量故障保护(机制),以便绞车操作能够完成。
-### Comparison to Offboard Control
+### 与离板控制的比较
-The above concepts provide a number of advantages over traditional [offboard control](../ros/offboard_control.md):
+上述概念提供了一些优点,而不是传统的[离板控制](../ros/offboard_control.md):
-- Multiple nodes or applications can coexist and even run at the same time.
- But only one node can _control the vehicle_ at a given time, and this node is well defined.
-- Modes have a distinct name and be displayed/selected in the GCS.
-- Modes are integrated with the failsafe state machine and arming checks.
-- The setpoint types that can be sent are well defined.
-- ROS 2 modes can replace flight controller internal modes (such as [Return mode](../flight_modes/return.md)).
+- 多个节点或应用程序可以共存,甚至能同时运行。
+ 但在特定时刻,仅能有一个节点对载具进行控制,且该节点的定义是明确的。
+- 模式具有独特的名称,并且可在GCS中显示 / 选择。
+- 模式与故障保护状态机及解锁检查功能相集成。
+- 可发送的设定值类型定义明确。
+- ROS 2 模式可以替换飞行控制器内部模式(如[返回模式](../flight_modes/return.md))。
-## Installation and First Test
+## 安装与首次测试
-The following steps are required to get started:
+开始使用前,需完成以下步骤:
1. 请确保您在 ROS 2 工作区中有 [ROS 2 设置](../ros2/user_guide.md) 与 [`px4_msgs`](https://github.com/PX4/px4_msgs]。
@@ -127,35 +127,35 @@ The following steps are required to get started:
source install/setup.bash
```
-4. In a different shell, start PX4 SITL:
+4. 在另一个外壳中,启动 PX4 SITL:
```sh
cd $px4-autopilot
make px4_sitl gazebo-classic
```
- (here we use Gazebo-Classic, but you can use any model or simulator)
+ (这里我们使用Gazebo-Classic,但你可以使用任何模型或模拟器)
-5. Run the micro XRCE agent in a new shell (you can keep it running afterward):
+5. 在新的 shell 中运行微XRCE 代理 (您可以在以后继续运行):
```sh
MicroXRCEAgent udp4 -p 8888
```
-6. Start QGroundControl.
+6. 启动QGroundControl。
::: info
Use QGroundControl Daily, which supports dynamically updating the list of modes.
:::
-7. Back in the ROS 2 terminal, run one of the example modes:
+7. 回到ROS2终端,运行一个示例模式:
```sh
- ros2 run example_mode_manual_cpp example_mode_manual
+ ros2 运行 example_mode_manual_cpp example_mode_manual
```
- You should get an output like this showing 'My Manual Mode' mode being registered:
+ 你应会看到类似如下的输出,其中显示 “我的手动模式"已注册:
```sh
[DEBUG] [example_mode_manual]: Checking message compatibility...
@@ -168,13 +168,13 @@ The following steps are required to get started:
[DEBUG] [example_mode_manual]: Arming check request (id=1, only printed once)
```
-8. On the PX4 shell, you can check that PX4 registered the new mode:
+8. 在 PX4 外壳上,您可以检查 PX4 是否注册了新模式:
```sh
- commander status
+ 指挥官状态
```
- The output should contain:
+ 输出应包含:
```plain
INFO [commander] Disarmed
@@ -184,29 +184,29 @@ The following steps are required to get started:
INFO [commander] External Mode 1: nav_state: 23, name: My Manual Mode
```
-9. At this point you should be able to see the mode in QGroundControl as well:
+9. 在这一点上,您也应该能够在 QGroundControl 中看到模式:

-10. Select the mode, make sure you have a manual control source (physical or virtual joystick), and arm the vehicle.
- The mode will then activate, and it should print the following output:
+10. 选择该模式,确保你拥有手动控制源(物理或虚拟操纵杆),并为载具解锁
+ 然后模式将激活,它将打印以下输出:
```sh
- [DEBUG] [example_mode_manual]: Mode 'My Manual Mode' activated
+ [DEBUG] [example_mode_manual]: 模式“我的手动模式” 已激活
```
-11. Now you are ready to create your own mode.
+11. 现在您已准备好创建自己的模式。
-## How to use the Library
+## 如何使用代码库
-The following sections describe specific functionality provided by this library.
-In addition, any other PX4 topic can be subscribed or published.
+以下各节介绍该库提供的特定功能。
+此外,任何其他PX4主题都可以订阅或发布。
-### Mode Class Definition
+### 模式类定义
-This section steps through an example of how to create a class for a custom mode.
+此部分通过如何为自定义模式创建类的示例。
-For a complete application, check out the [examples in the `Auterion/px4-ros2-interface-lib` repository](https://github.com/Auterion/px4-ros2-interface-lib/tree/main/examples/cpp), such as [examples/cpp/modes/manual](https://github.com/Auterion/px4-ros2-interface-lib/blob/main/examples/cpp/modes/manual/include/mode.hpp).
+若要完整的应用程序,请查看[示例在 `Auterion/px4-ros2-interfacee-lib` 仓库中](https://github.com/Auterion/px4-ros2-interface-lib/tree/main/examples/cpp),例如[示例/cpp/mod/manual](https://github.com/Auterion/px4-ros2-interface-lib/blob/main/examples/cpp/modes/manual/include/mode.hpp)。
```cpp{1,5,7-9,24-31}
class MyMode : public px4_ros2::ModeBase // [1]
@@ -248,19 +248,19 @@ private:
};
```
-- `[1]`: First we create a class that inherits from [`px4_ros2::ModeBase`](https://auterion.github.io/px4-ros2-interface-lib/classpx4__ros2_1_1ModeBase.html).
-- `[2]`: In the constructor, we pass the mode name. This also allows us to configure some other things, like replacing a flight controller internal mode.
-- `[3]`: This is where we create all objects that we want to use later on.
- This can be RC input, setpoint type(s), or telemetry. `*this` is passed as a `Context` to each object, which associates the object with the mode.
-- `[4]`: Whenever the mode is active, this method gets called regularly (the update rate depends on the setpoint type).
- Here is where we can do our work and generate a new setpoint.
+- [1]`: 首先创建一个从 [`px4_ros2:::ModeBase\` ](https://auterion.github.io/px4-ros2-interface-lib/classpx4__ros2_1_1ModeBase.html )继承的类。
+- [2]\`: 在构造函数中,我们传递模式名称。 这也使我们能够配置一些其他内容,例如替换飞行控制器的内置模式。
+- [3]:我们在此处创建后续想要使用的所有对象。
+ 这可以是 RC 输入、设置点类型(s)或遥测数据。 `*this` 作为`Context`传递给每个对象,将对象与模式联系起来。
+- [4]:每当该模式处于激活状态时,此方法会定期被调用(更新频率取决于设定值类型)。
+ 我们可以在这里开展工作并产生一个新的设定点。
-After creating an instance of that mode, `mode->doRegister()` must be called which does the actual registration with the flight controller and returns `false` if it fails.
-In case a mode executor is used, `doRegister()` must be called on the mode executor, instead of for the mode.
+创建此模式的实例后, `mode->doRegister()` 必须被调用,在飞行控制器中进行实际注册,如果失败则返回 `false` 。
+如果使用模式执行器,`doRegister()`必须调用模式执行器而不是模式。
-### Mode Executor Class Definition
+### 模式执行器类定义
-This section steps through an example of how to create a mode executor class.
+本节逐步讲解如何创建模式执行器类的示例。
```cpp{1,4-5,9-16,20,33-57}
class MyModeExecutor : public px4_ros2::ModeExecutorBase // [1]
@@ -327,74 +327,74 @@ private:
};
```
-- `[1]`: First we create a class that inherits from [`px4_ros2::ModeExecutorBase`](https://auterion.github.io/px4-ros2-interface-lib/classpx4__ros2_1_1ModeExecutorBase.html).
-- `[2]`: The constructor takes our custom mode that is associated with the executor and passes it to the constructor of `ModeExecutorBase`.
-- `[3]`: We define an enum for the states we want to run through.
-- `[4]`: `onActivate` gets called when the executor becomes active. At this point we can start to run through our states.
- How you do this is up to you, in this example a method `runState` is used to execute the next state.
-- `[5]`: On switching to a state we call an asynchronous method from `ModeExecutorBase` to start the desired mode: `run`, `takeoff`, `rtl`, and so on.
- These methods are passed a function that is called on completion; the callback provides a `Result` argument that tells you whether the operation succeeded or not.
- The callback runs the next state on success.
-- `[6]`: We use the `scheduleMode()` method to start the executor's "owned mode", following the same pattern as the other state handlers.
+- [1]`: 首先创建一个从 [`px4_ros2:::ModeExecutorBase\` ](https://auterion.github.io/px4-ros2-interface-lib/classpx4__ros2_1_1ModeExecutorBase.html ) 继承的类。
+- [2]`: 构造函数采用与执行器相关联的自定义模式,并传递给`ModeExecutorBase\`的构造函数。
+- [3]\`: 我们为想要运行的状态定义一个枚举。
+- [4]`: `onActivate`在执行器激活时被调用。 此时,我们可以开始遍历这些状态了。
+ 你是如何操作的,在这个示例中使用`runState\` 方法来执行下一个状态。
+- [5]`: 在切换到状态时,我们会调用 `ModeExecutorBase` 中的异步方法来启动所需的模式:`run`, “eff”、“rtl”、“等等”。
+ 这些方法被传递了一个被要求完成的函数; 回调提供一个 `Result\` 参数,告诉您操作是否成功。
+ 回调运行下一个成功状态。
+- [6]`: 我们使用 `scheduleMode()\` 方法来启动执行者"拥有模式", 遵循与其他状态处理器相同的模式。
-### Setpoint Types
+### 设置点类型
-A mode can choose its setpoint type(s) it wants to use to control the vehicle.
-The used types also define the compatibility with different vehicle types.
+模式可选择其用于控制载具的设定值类型。
+所用类型还界定了与不同类型载具的兼容性。
-The following sections provide a list of supported setpoint types:
+以下章节提供了支持的设置点类型列表:
-- [GotoSetpointType](#go-to-setpoint-gotosetpointtype): Smooth position and (optionally) heading control
-- [FwLateralLongitudinalSetpointType](#fixed-wing-lateral-and-longitudinal-setpoint-fwlaterallongitudinalsetpointtype): Direct control of lateral and longitudinal fixed wing dynamics
-- [DirectActuatorsSetpointType](#direct-actuator-control-setpoint-directactuatorssetpointtype): Direct control of motors and flight surface servo setpoints
+- [GotoSetpointType](#go-to-setpoint-gotosetpointtype): 平稳的位置控制以及(可选的)航向控制
+- [FwLateralLongitudinalSetpointType](#fixed-wing-lateral-and-longitudinal-setpoint-fwlaterallongitudinalsetpointtype): 对横向和纵向固定翼动态的直接控制
+- [DirectActuatorsSetpointType](#direct-actuator-control-setpoint-directactuatorssetpointtype):直接控制发动机和飞行地面servo setpoints
:::tip
-The other setpoint types are currently experimental, and can be found in: [px4_ros2/control/setpoint_types/experimental](https://github.com/Auterion/px4-ros2-interface-lib/tree/main/px4_ros2_cpp/include/px4_ros2/control/setpoint_types/experimental).
+其他设置点类型目前是实验性的,可在以下网址找到:[px4_ros2/control/setpoint_types/experimental](https://github.com/Auterion/px4-ros2-interface-lib/tree/main/px4_ros2_cpp/include/px4_ros2/control/setpoint_types/experimental)。
-You can add your own setpoint types by adding a class that inherits from `px4_ros2::SetpointBase`, sets the configuration flags according to what the setpoint requires, and then publishes any topic containing a setpoint.
+您可以通过添加一个从 `px4_ros2::SetpointBase` 继承的类来添加您自己的 setpoint 类型, 根据设置点的要求设置配置标志,然后发布任何包含设置点的主题。
:::
-#### Go-to Setpoint (GotoSetpointType)
+#### 转到设置点 (GotoSetpointType)
:::info
-This setpoint type is currently only supported for multicopters.
+当前,此设定值类型仅支持多旋翼飞行器。
:::
-Smoothly control position and (optionally) heading setpoints with the [`px4_ros2::GotoSetpointType`](https://github.com/Auterion/px4-ros2-interface-lib/blob/main/px4_ros2_cpp/include/px4_ros2/control/setpoint_types/goto.hpp) setpoint type.
-The setpoint type is streamed to FMU based position and heading smoothers formulated with time-optimal, maximum-jerk trajectories, with velocity and acceleration constraints.
+以[`px4_ros2:::GotoSetpootType`](https://github.com/Auterion/px4-ros2-interface-lib/blob/main/px4_ros2_cpp/include/px4_ros2/control/setpoint_types/goto.hpp) 设置点类型平滑控制位置和(可选) 设置点。
+该设定值类型会传输至FMU,用于基于位置和航向的平滑控制器;该平滑控制器采用时间最优、最大加加速度轨迹设计,并设有速度和加速度约束。
-The most trivial use is simply inputting a 3D position into the update method:
+最简单的用法就是直接向update method中输入一个3D 位置
```cpp
const Eigen::Vector3f target_position_m{-10.F, 0.F, 3.F};
_goto_setpoint->update(target_position_m);
```
-In this case, heading will remain _uncontrolled_.
-To additionally control heading, specify it as the second input argument:
+在这种情况下,航向将保持不受控制的状态。
+若要额外控制航向,可将其指定为第二个输入参数:
```cpp
-const Eigen::Vector3f target_position_m{-10.F, 0.F, 3.F};
+const Eigen:::Vector3f target_position_m{-10.F, 0.F, 3.F};
const float heading_rad = 3.14F;
_goto_setpoint->update(
target_position_m,
heading_rad);
```
-An additional feature of the go-to setpoint is dynamic control on the underlying smoothers' speed limits (i.e. maximum horizontal and vertical translational velocities as well as heading rate).
-If, as above, left unspecified, the smoothers will default to the vehicle's default maximums (typically set to the physical limitations).
-The smoothers will _only_ decrease speed limits, never increase.
+“前往设定值”(go-to setpoint)的一项额外功能是,可对底层平滑控制器的速度限制进行动态控制(即对最大水平和平动速度、最大垂直平动速度以及航向速率进行动态控制)。
+若如上文所述未指定(该参数),则平滑控制器将默认采用设备的默认最大值(通常设定为其物理极限值)
+平滑控制器仅会降低速度限制,绝不会提高速度限制。
```cpp
_goto_setpoint->update(
target_position_m,
heading_rad,
- max_horizontal_velocity_m_s,
+ max_水平_velocity_m_s,
max_vertical_velocity_m_s,
max_heading_rate_rad_s);
```
-All arguments in the update method except the position are templated as `std::optional`, meaning that if one desires constraining the heading rate, but not the translating velocities, this is possible using a `std::nullopt`:
+更新方法中,除位置外的所有参数均被模板化为 std::optional 类型。这意味着,若需限制航向速率但不限制平动速度,可通过 std::nullopt 实现这一需求。
```cpp
_goto_setpoint->update(
@@ -405,58 +405,58 @@ _goto_setpoint->update(
max_heading_rate_rad_s);
```
-#### Fixed-Wing Lateral and Longitudinal Setpoint (FwLateralLongitudinalSetpointType)
+#### 固定翼横向与纵向设定值(FwLateralLongitudinalSetpointType,固定翼横向纵向设定值类型)
:::info
-This setpoint type is supported for fixed-wing vehicles and for VTOLs in fixed-wing mode.
+此设定值类型支持固定翼飞行器,以及处于固定翼模式下的垂直起降飞行器(VTOL)。
:::
-Use the [`px4_ros2::FwLateralLongitudinalSetpointType`](https://auterion.github.io/px4-ros2-interface-lib/classpx4__ros2_1_1FwLateralLongitudinalSetpointType.html) to directly control the lateral and longitudinal dynamics of a fixed-wing vehicle — that is, side-to-side motion (turning/banking) and forward/vertical motion (speeding up and climbing/descending), respectively.
-This setpoint is streamed to the PX4 [_FwLateralLongitudinalControl_ module](../modules/modules_controller.md#fw-lat-lon-control), which decouples lateral and longitudinal inputs while ensuring that vehicle limits are respected.
+使用[`px4_ros2::FwLateralLongitudinalSetpointType`](https://auterion.github.io/px4-ros2-interface-lib/classpx4__ros2_1_1FwLateralLongitudinalSetpointType.html)直接控制固定翼飞行器的横向与纵向动力学特性,即分别控制其侧向运动(转弯 / 倾斜)和前向 / 垂直运动(加速及爬升 / 下降)。
+这个设置点被传输到 PX4 [_FwLateralLongitudinalControl_module](../modules/modules_controller.md#fw-lat-lon-control),该模块会对横向与纵向输入进行解耦处理,同时确保不超出飞行器的各项限制范围。
-To control the vehicle, at least one lateral **and** one longitudinal setpoint must be provided:
+为了控制载具,必须提供至少一个横向**和**一个纵向设定值:
-1. Of the longitudinal inputs: either `altitude` or `height_rate` must be finite to control vertical motion.
- If both are set to `NAN`, the vehicle will maintain its current altitude.
-2. Of the lateral inputs: at least one of `course`, `airspeed_direction`, or `lateral_acceleration` must be finite.
+1. 在纵向输入中:必须至少有一个 “高度”(altitude)或 “高度速率”(height_rate)为有限值,才能实现垂直运动控制。
+ 若二者均设为 NAN,则载具将保持当前高度。
+2. 在横向输入中:“航线角”(course)、“空速方向”(airspeed_direction)或 “横向加速度”(lateral_acceleration)这三者中,至少有一个必须为有限值。
-For a detailed description of the controllable parameters, please refer to message definitions ([FixedWingLateralSetpoint](../msg_docs/FixedWingLateralSetpoint.md) and [FixedWingLongitudinalSetpoint](../msg_docs/FixedWingLongitudinalSetpoint.md)).
+关于可控参数的详细说明,请参考消息定义([FixedWingLateralSetpoint](../msg_docs/FixedWingLateralSetpoint.md) 和 [FixedWingLongitudinalSetpoint](../msg_docs/FixedWingLongitudinalSetpoint.md))。
##### 基本用法
-This type has a number of update methods, each allowing you to specify an increasing number of setpoints.
+该类型包含多个更新方法,每种方法可支持你指定的设定值数量逐步增加。
-The simplest method is `updateWithAltitude()`, which allows you to specify a `course` and `altitude` target setpoint:
+最简单的方法是 updateWithAltitude(),该方法可让你指定 “航线角”(course)和 “高度”(altitude)这两个目标设定值。
```cpp
-const float altitude_msl = 500.F;
+const float altextede_msl = 500.F;
const float course = 0.F; // due North
-_fw_lateral_longitudinal_setpoint->updateWithAltitude(altitude_msl, course);
+_fw_later_longitudinal_setpoint->updateWAltitude(altyde_msl, course);
```
-PX4 uses the setpoints to compute the _roll angle_, _pitch angle_ and _throttle_ setpoints that are sent to lower level controllers.
-Note that the commanded flight is expected to be relatively gentle/unaggressive when using this method.
-This is done as follows:
+PX4 会利用这些设定值计算出横滚角(roll angle)、俯仰角(pitch angle)和油门(throttle)设定值,并将其发送至底层控制器。
+需注意,使用此方法时,预期的指令飞行会相对平缓 / 不激进。
+此操作按如下方式执行:
-- Lateral control output:
+- 横向控制输出:
- course setpoint (set by user) → airspeed direction (heading) setpoint → lateral acceleration setpoint → roll angle setpoint.
+ 航线角设定值(由用户设定)→ 空速方向 (航向) 设定值 → 横向加速设定值 → 滚动角度设定值
-- Longitudinal control output:
+- 纵向控制输出:
- altitude setpoint (set by user) → height rate setpoint → pitch angle setpoint and throttle settings.
+ 高度设定值(由用户设定) → 高度速率设定值 → 俯仰角设定值及油门设定。
-The `updateWithHeightRate()` method allows you to set a target `course` and `height_rate` (this is useful if the speed of ascent or descent matters, or needs to be dynamically controlled):
+updateWithHeightRate() 方法允许你设置目标 “航线角”(course)和 “高度速率”(height_rate)(当爬升或下降速度至关重要,或需要对其进行动态控制时,此方法非常实用):
```cpp
const float height_rate = 2.F;
-const float course = 0.F; // due North
-_fw_lateral_longitudinal_setpoint->updateWithHeightRate(height_rate, course);
+const float course = 0.F; //due North
+_fw_lateral_longitudinal_setpoint->updateWheightRate(high_rate course);
```
-The `updateWithAltitude()` and `updateWithHeightRate()` methods allow you to additionally control the equivalent airspeed or lateral acceleration by specifying them as the third and fourth arguments, respectively:
+updateWithAltitude() 和 updateWithHeightRate() 这两种方法还允许你分别将 “等效空速”(equivalent airspeed)或 “横向加速度”(lateral acceleration)指定为第三个和第四个参数,从而对其进行控制:
```cpp
const float altitude_msl = 500.F;
@@ -470,44 +470,44 @@ _fw_lateral_longitudinal_setpoint->updateWithAltitude(altitude_msl,
lateral_acceleration);
```
-The equivalent airspeed and lateral acceleration arguments are defined as `std::optional`, so you can omit any of them by passing `std::nullopt`.
+等效的空速和横向加速参数定义为 `std::opulatory`, 所以你可以通过 `std::nullopt` 省略其中任何一个。
:::tip
-If both lateral acceleration and course setpoints are provided, the lateral acceleration setpoint will be used as feedforward.
+若同时提供了横向加速度设定值和航线角设定值,横向加速度设定值将被用作前馈(feedforward)
:::
-##### Full Control Using the Setpoint Struct
+##### 使用设定值结构体实现完全控制
-For full flexibility, you can create and pass a [`FwLateralLongitudinalSetpoint`](https://auterion.github.io/px4-ros2-interface-lib/structpx4__ros2_1_1FwLateralLongitudinalSetpoint.html) struct.
-Each field is templated with `std::optional`.
+为实现充分的灵活性,你可以创建并传递一个[`FwLateralLongitudinalSetpoint` ](https://auterion.github.io/px4-ros2-interface-lib/structpx4__ros2_1_1FwLateralLongitudinalSetpoint.html) 结构体。
+每个字段都使用 "std::opulatory "模板。
:::tip
-If both course and airspeed direction are set: airspeed direction takes precedence, course is not controlled.
-Lateral acceleration is treated as feedforward if either course or airspeed direction are also finite.
-If both altitude and height rate are set: height rate takes precedence, altitude is not controlled.
+若同时设置了航线角(course)和空速方向(airspeed direction),则空速方向优先,航线角不进行控制。
+若航线角或空速方向中任意一个为有限值,则横向加速度会被视为前馈。
+若同时设置了高度和高度速率,则高度速率优先,高度不进行控制。
:::
```cpp
-px4_ros2::FwLateralLongitudinalSetpoint setpoint_s;
+px4_ros2:::FwLateralLongitudinalSetpoint setpoint_s;
-setpoint_s.withCourse(0.F);
-// setpoint_s.withAirspeedDirection(0.2F); // uncontrolled
-setpoint_s.withLateralAcceleration(2.F); // feedforward
-//setpoint_s.withAltitude(500.F); // uncontrolled
-setpoint_s.withHeightRate(2.F);
-setpoint_s.withEquivalentAirspeed(15.F);
+settpoint_s.withCourse(0.F);
+// setpoint_s.withAirspeedDirection(0.2F); // 失控
+setpoint_s.withLateralActivation(2.F); // feedforward
+/setpoint_s.withAltude(500.F); // 失控
+setpoint_s.withightRate(2.F);
+settpoint_s.withequivalentAirspeed(15.F);
-_fw_lateral_longitudinal_setpoint->update(setpoint_s);
+_fw_lateral_longitudinal_sett->upate(settpoint_
```
-The diagram below illustrates the interaction between the `FwLateralLongitudinalSetpointType` and PX4 when all inputs are set.
+下图展示了在所有输入均已设定的情况下,FwLateralLongitudinalSetpointType 与 PX4 之间的交互关系。
-
+
-##### Advanced Configuration (Optional)
+##### 高级配置(可选)
-You can also pass a [`FwControlConfiguration`](https://auterion.github.io/px4-ros2-interface-lib/structpx4__ros2_1_1FwControlConfiguration.html) struct along with the setpoint to override default controller settings and constraints such as pitch limits, throttle limits, and target sink/climb rates.
-This is intended for advanced users:
+你还可以传递一个[`FwControlConfiguration`](https://auterion.github.io/px4-ros2-interface-lib/structpx4__ros2_1_1FwControlConfiguration.html) 结构体以及设定值,以覆盖默认的控制器设置和约束条件,例如俯仰角限制、油门限制以及目标下降 / 爬升速率。
+这是针对高级用户的:
```cpp
px4_ros2::FwLateralLongitudinalSetpoint setpoint_s;
@@ -526,47 +526,47 @@ config_s.withThrottleLimits(0.4F, 0.6F);
_fw_lateral_longitudinal_setpoint->update(setpoint_s, config_s);
```
-All configuration fields are defined as `std::optional`.
-Unset values will default to the PX4 configuration.
-See [LateralControlConfiguration](../msg_docs/LateralControlConfiguration.md) and [FixedWingLongitudinalConfiguration](../msg_docs/LongitudinalControlConfiguration.md) for more information on configuration options.
+所有配置字段都定义为 "std::opulatory"。
+未设置的值将默认采用 PX4 的配置。
+更多关于配置选项的信息,请参阅 [LateralControlConfiguration](../msg_docs/LateralControlConfiguration.md) 和 [FixedWingLongitudinalConfiguration](../msg_docs/LongitudinalControlConfiguration.md)。
:::info
-For safety, PX4 automatically limits configuration values to stay within the vehicle’s constraints.
-For example, throttle overrides are clamped to remain between [`FW_THR_MIN`](../advanced_config/parameter_reference.md#FW_THR_MIN)
-and [`FW_THR_MAX`](../advanced_config/parameter_reference.md#FW_THR_MAX).
+为保障安全,PX4 会自动将配置值限制在飞行器的约束范围内。
+例如,油门覆盖值会被限制在[`FW_THR_MIN`](../advanced_config/parameter_reference.md#FW_THR_MIN)
+和 [`FW_THR_MAX`](../advanced_config/parameter_reference.md#FW_THR_MAX)之间。
:::
-#### Direct Actuator Control Setpoint (DirectActuatorsSetpointType)
+#### 直接执行器控制设定点(DirectActuatorsSetpointType)
-Actuators can be directly controlled using the [px4_ros2::DirectActuatorsSetpointType](https://auterion.github.io/px4-ros2-interface-lib/classpx4__ros2_1_1DirectActuatorsSetpointType.html) setpoint type.
-Motors and servos can be set independently.
-Be aware that the assignment is vehicle and setup-specific.
-For example to control a quadrotor, you need to set the first 4 motors according to its [output configuration](../concept/control_allocation.md).
+可以使用 [px4_ros2::DirectActActorsSetpootType](https://auterion.github.io/px4-ros2-interface-lib/classpx4__ros2_1_1DirectActuatorsSetpointType.html) 设置点类型直接控制执行器。
+电机和舵机可独立设置。
+请注意,该分配(设置 / 指派)具有载具和配置特定性。
+例如,要控制一架四旋翼飞行器,你需要根据其 [输出配置] (../concept/control_allocation.md )来设置前 4 个电机。
:::info
-If you want to control an actuator that does not control the vehicle's motion, but for example a payload servo, see [below](#controlling-an-independent-actuator-servo).
+若你想控制的执行器并非用于控制飞行器的运动(例如,而是用于控制有效载荷舵机),请参阅 [below](#controlling-an-independent-actuator-servo)。
:::
-### Controlling a VTOL
+### 控制VTOL
-To control a VTOL in an external flight mode, ensure you're returning the correct setpoint type based on the current flight configuration:
+要在外部飞行模式下控制VTOL,需确保根据当前飞行配置返回正确的设定值类型:
-- Multicopter mode: use a setpoint type that is compatible with multicopter control. For example: either the [`GotoSetpointType`](#go-to-setpoint-gotosetpointtype) or the [`TrajectorySetpointType`](https://auterion.github.io/px4-ros2-interface-lib/classpx4__ros2_1_1TrajectorySetpointType.html).
-- Fixed-wing mode: Use the [`FwLateralLongitudinalSetpointType`](#fixed-wing-lateral-and-longitudinal-setpoint-fwlaterallongitudinalsetpointtype).
+- 多旋翼模式:使用与多旋翼控制兼容的设定值类型。 例如:要么[`GotoSetpootType`](#go-to-setpoint-gotosetpointtype) 要么[`TracjectorySettpointType`](https://auterion.github.io/px4-ros2-interface-lib/classpx4__ros2_1_1TrajectorySetpointType.html)。
+- 固定翼形模式:使用 [`FwLateralLongitudinalSetpointType` ](#fixed-wing-lateral-and-longitudinal-setpoint-fwlaterallongitudinalsetpointtype)。
-As long as the VTOL remains in either multicopter or fixed-wing mode throughout the external mode, no additional handling is required.
+只要VTOL在整个外部模式期间始终处于多旋翼模式或固定翼模式中的任意一种,就无需额外处理。
-If you would like to command a VTOL transition in your external mode, you need to use the [VTOL API](https://auterion.github.io/px4-ros2-interface-lib/classpx4__ros2_1_1VTOL.html). The VTOL API provides the functionality to command a transition and query the current state of the vehicle.
+如果您想要在您的外部模式中命令一个 VTAL 过渡,您需要使用 [VTOL API](https://auterion.github.io/px4-ros2-interface-lib/classpx4__ros2_1_1VTOL.html)。 VTAL API具备下达转换指令和查询载具当前状态的功能。
-Use this API with caution!
-Commanding transitions externally makes the user partially responsible for ensuring smooth and safe behavior, unlike onboard transitions (e.g. via RC switch) where PX4 handles the full process:
+谨慎使用此 API !
+通过外部下达转换指令时,用户需部分负责确保(飞行器)运行平稳且安全;这与机上转换(例如通过遥控器开关实现)不同,在机上转换模式下,整个过程由 PX4 全权处理。
-1. Ensure that both the `TrajectorySetpointType` and the `FwLateralLongitudinalSetpointType` are available to your mode.
-2. Create an instance of `px4_ros2::VTOL` in the constructor of your mode.
-3. To command a transition, you can use the `toMulticopter()` or `toFixedwing()` methods on your VTOL object to set the desired state.
-4. During transition, send the following combination of setpoints:
+1. 确保你的模式可调用 TrajectorySetpointType(轨迹设定值类型)和 FwLateralLongitudinalSetpointType(固定翼横纵向设定值类型)这两种设定值类型。
+2. 在您模式的构造函数中创建 `px4_ros2::VTOL` 的实例。
+3. 要下达转换指令,你可以在 VTOL 对象上调用 toMulticopter() 或 toFixedwing() 方法,以设置所需状态。
+4. 在转换过程中,发送以下设定值组合:
```cpp
// Assuming the instance of the px4_ros2::VTOL object is called vtol
@@ -584,35 +584,35 @@ Commanding transitions externally makes the user partially responsible for ensur
_fw_lateral_longitudinal_setpoint->updateWithAltitude(NAN, course_sp)
```
- This will ensure that the transition is handled properly within PX4.
- You can optionally pass a deceleration setpoint to `computeAccelerationSetpointDuringTransition()` to be used during back-transitions.
+ 这将确保转换过程在 PX4 系统内部得到妥善处理。
+ 你可以选择性地将一个减速度设定值传递给 computeAccelerationSetpointDuringTransition(),以便在反向转换过程中使用。
-To check the current state of the vehicle, use the `getCurrentState()` method on your `px4_ros2::VTOL` object.
+要查询载具的当前状态,可在 px4_ros2::VTOL 对象上调用 getCurrentState() 方法。
-See [this external flight mode implementation](https://github.com/Auterion/px4-ros2-interface-lib/tree/main/examples/cpp/modes/vtol) for a practical example on how to use this API.
+请参阅[此外部飞行模式实现](https://github.com/Auterion/px4-ros2-interface-lib/tree/main/examples/cpp/modes/vtol)有关如何使用此 API 的实际示例。
-### Controlling an Independent Actuator/Servo
+### 控制独立执行器/Servo
-If you want to control an independent actuator (a servo), follow these steps:
+如果您想要控制一个独立执行器(aservo),遵循以下步骤:
1. [Configure the output](../payloads/generic_actuator_control.md#generic-actuator-control-with-mavlink).
-2. Create an instance of [px4_ros2::PeripheralActuatorControls](https://auterion.github.io/px4-ros2-interface-lib/classpx4__ros2_1_1PeripheralActuatorControls.html) in the constructor of your mode.
-3. Call the `set()` method to control the actuator(s).
- This can be done independently of any active setpoints.
+2. 在您的模式的构造函数中创建一个实例[px4_ros2::PeripheralActorControls](https://auterion.github.io/px4-ros2-interface-lib/classpx4__ros2_1_1PeripheralActuatorControls.html)。
+3. 调用`set()` 方法以控制执行器
+ 此操作可独立于任何活跃的设定点执行。
-### Telemetry
+### 数传
-You can access PX4 telemetry topics directly via the following classes:
+你可以通过以下类直接访问 PX4 遥测主题:
-- [OdometryGlobalPosition](https://auterion.github.io/px4-ros2-interface-lib/classpx4__ros2_1_1OdometryGlobalPosition.html): Global position
-- [OdometryLocalPosition](https://auterion.github.io/px4-ros2-interface-lib/classpx4__ros2_1_1OdometryLocalPosition.html): Local position, velocity, acceleration, and heading
-- [OdometryAttitude](https://auterion.github.io/px4-ros2-interface-lib/classpx4__ros2_1_1OdometryAttitude.html): Vehicle attitude
-- [OdometryAirspeed](https://auterion.github.io/px4-ros2-interface-lib/classpx4__ros2_1_1OdometryAirspeed.html): Airspeed
+- [OdometryGlobalPosition](https://auterion.github.io/px4-ros2-interface-lib/classpx4__ros2_1_1OdometryGlobalPosition.html): 全球位置
+- [OdometryLocalPosition](https://auterion.github.io/px4-ros2-interface-lib/classpx4__ros2_1_1OdometryLocalPosition.html): 本地位置、速度、加速度和航向
+- [OdometryAttitude](https://auterion.github.io/px4-ros2-interface-lib/classpx4__ros2_1_1OdometryAttitude.html): 载具状态
+- [OdometryAirspeed](https://auterion.github.io/px4-ros2-interface-lib/classpx4__ros2_1_1OdometryAirspeed.html):空速
-For example, you can query the vehicle's current position estimate as follows:
+例如,你可以通过以下方式查询飞行器当前的位置估算值:
```cpp
-std::shared_ptr _vehicle_local_position;
+std::shared_ptr<0> _vehicle_local_position;
...
// Get vehicle's last local position
@@ -623,55 +623,55 @@ _vehicle_local_position->positionXYValid();
```
:::info
-These topics provide a wrapper around the internal PX4 topics, allowing the library to maintain compatibility if the internal topics change.
-Check [px4_ros2/odometry](https://github.com/Auterion/px4-ros2-interface-lib/tree/main/px4_ros2_cpp/include/px4_ros2/odometry) for new topics, and of course you can use any ROS 2 topic published from PX4.
+这些主题围绕内部的 PX4 主题提供了一个包装程序,使代码库能够在内部主题发生变化时保持兼容性。
+检查 [px4_ros2/odometry](https://github.com/Auterion/px4-ros2-interface-lib/tree/main/px4_ros2_cpp/include/px4_ros2/odometry) 新主题,当然你也可以使用任何由 PX4 发布的 ROS 2 主题。
:::
-### Failsafes and Mode Requirements
+### 故障保护与模式要求
-Each mode has a set of requirement flags.
-These are generally automatically set, depending on which objects are used within the context of a mode.
-For example when adding manual control input with the code below the requirement flag for manual control gets set:
+每种模式都有一组需求标志。
+这些(需求标志)通常会根据模式语境下所使用的对象自动设置。
+例如,当通过以下代码添加手动控制输入时,手动控制的需求标志会被设置:
```cpp
_manual_control_input = std::make_shared(*this);
```
-Specifically, setting a flag has the following consequences in PX4, if the condition is not met:
+具体而言,在 PX4 中,若条件未满足,设置某个标志会产生以下结果:
-- arming is not allowed, while the mode is selected
-- when already armed, the mode cannot be selected
-- when armed and the mode is selected, the relevant failsafe is triggered (e.g. RC loss for the manual control requirement).
- Check the [safety page](../config/safety.md) for how to configure failsafe behavior.
- A failsafe is also triggered when the mode crashes or becomes unresponsive while it is selected.
+- 在选定模式时不允许进行解锁操作
+- 当已处于武装状态时,该模式无法被选择。
+- 当载具已解锁且该模式被选中时,相关的故障保护机制会被触发(例如,针对手动控制需求的遥控器信号丢失故障保护)。
+ 检查 [safety page] (../config/safety.md) 如何配置故障安全行为。
+ 当某模式已被选中,且该模式发生崩溃或失去响应时,也会触发故障保护机制。
-This is the corresponding flow diagram for the manual control flag:
+这是手动控制标志对应的流程图:

-It is possible to manually update any mode requirement after the mode is registered.
-For example to add home position as requirement:
+在模式注册后,可以手动更新任意模式要求。
+例如,要将返航点(home position)添加为一项要求:
```cpp
modeRequirements().home_position = true;
```
-The full list of flags can be found in [requirement_flags.hpp](https://github.com/Auterion/px4-ros2-interface-lib/blob/main/px4_ros2_cpp/include/px4_ros2/common/requirement_flags.hpp).
+标记的完整列表可以在 [requirement_flags.hpp](https://github.com/Auterion/px4-ros2-interface-lib/blob/main/px4_ros2_cpp/include/px4_ros2/common/requirement_flags.hpp 中找到。
-#### Deferring Failsafes
+#### 延迟故障保护
-A mode or mode executor can temporarily defer non-essential failsafes by calling the method [`deferFailsafesSync()`](https://auterion.github.io/px4-ros2-interface-lib/classpx4__ros2_1_1ModeExecutorBase.html#a16ec5be6ebe70e1d0625bf696c3e29ae).
-To get notified when a failsafe would be triggered, override the method [`void onFailsafeDeferred()`](https://auterion.github.io/px4-ros2-interface-lib/classpx4__ros2_1_1ModeExecutorBase.html#ad80a234c8cb2f4c186fa2b7bffd1a1dd).
+模式或模式执行器可以通过调用该方法暂时延迟非必要的故障保护。 [`deferFailsafesSync()`](https://auterion.github.io/px4-ros2-interface-lib/classpx4__ros2_1_1ModeExecutorBase.html#a16ec5be6ebe70e1d0625bf696c3e29ae).
+若想在故障保护即将被触发时收到通知,需重写该方法。 [`void onFailsafeDeferred()`](https://auterion.github.io/px4-ros2-interface-lib/classpx4__ros2_1_1ModeExecutorBase.html#ad80a234c8cb2f4c186fa2b7bffd1a1dd).
-Check the [integration test](https://github.com/Auterion/px4-ros2-interface-lib/blob/main/px4_ros2_cpp/test/integration/overrides.cpp) for an example.
+例如检查[integration test](https://github.com/Auterion/px4-ros2-interface-lib/blob/main/px4_ros2_cpp/test/integration/overrides.cpp)。
-### Assigning a Mode to an RC Switch or Joystick Action
+### 将模式指派给 RC 切换或操纵动作
-External modes can be assigned to [RC switches](../config/flight_mode.md) or joystick actions.
-When assigning a mode to an RC switch, you need to know the index (because the parameter metadata does not contain the dynamic mode name).
-Use `commander status` while the mode is running to get that information.
+外部模式可以被分配给[RC switches](../config/flight_mode.md) 或操纵杆动作。
+当将模式分配给RC开关时,你需要知道其索引(因为参数元数据中不包含动态模式名称)。
+在模式运行期间,使用 'commander status'(指令状态)来获取该信息。
例如:
@@ -679,23 +679,23 @@ Use `commander status` while the mode is running to get that information.
INFO [commander] External Mode 1: nav_state: 23, name: My Manual Mode
```
-means you would select **External Mode 1** in QGC:
+意味着你需要在 QGC中选择外部模式 1(External Mode 1) :
-
+
:::info
-PX4 ensures a given mode is always assigned to the same index by storing a hash of the mode name.
-This makes it independent of startup ordering in case of multiple external modes.
+PX4通过存储模式名称的散列确保指定模式始终分配到同一索引。
+这使它独立于多个外部模式下的启动订购。
:::
-### Replacing an Internal Mode
+### 替换内部模式
-An external mode can replace an existing internal mode, such as [Return](../flight_modes/return.md) mode (RTL).
-By doing so, whenever RTL gets selected (through the user or a failsafe situation), the external mode is used instead of the internal one.
-The internal one is only used as a fallback when the external one becomes unresponsive or crashes.
+外部模式可替换现有的内部模式,例如[Return](../flight_modes/return.md) mode (RTL).
+这样做,每当选择RTL(通过用户或故障安全情况),就使用外部模式而不是内部模式。
+当外部模式失去响应或发生崩溃时,内部模式仅用作备用模式。
-The replacement mode can be set in the settings of the `ModeBase` constructor:
+替换模式可在' ModeBase '构造函数的设置中进行配置:
```cpp
-Settings{kName, false, ModeBase::kModeIDRtl}
+设置{kName, false, ModeBase::kModeIDRtl}
```
diff --git a/docs/zh/ros2/px4_ros2_msg_translation_node.md b/docs/zh/ros2/px4_ros2_msg_translation_node.md
index 6d69dc3c01..c496de825e 100644
--- a/docs/zh/ros2/px4_ros2_msg_translation_node.md
+++ b/docs/zh/ros2/px4_ros2_msg_translation_node.md
@@ -1,81 +1,82 @@
-# PX4 ROS 2 Message Translation Node
+# PX4 ROS 2 消息翻译节点
-
+<0/> <1/>
-The message translation node allows ROS 2 applications that were compiled against different versions of the PX4 messages to interwork with newer versions of PX4, and vice versa, without having to change either the application or the PX4 side.
+消息翻译节点允许针对不同版本的 PX4 消息编译的 ROS 2 应用程序与更新版本的 PX4 交互。 反之亦然,而不必更改应用程序或PX4一侧。
## 综述
-The translation of messages from one definition version to another is possible thanks to the introduction of [message versioning](../middleware/uorb.md#message-versioning).
+由于引入了[消息版本](../middleware/uorb.md#message-versioning),将消息从一个定义版本翻译成另一个定义版本是可能的。
-The translation node has access to all message versions previously defined by PX4.
-It dynamically observes the DDS data space, monitoring the publications, subscriptions and services originating from either PX4 via the [uXRCE-DDS Bridge](../middleware/uxrce_dds.md), or ROS 2 applications.
-When necessary, it converts messages to the current versions expected by both applications and PX4, ensuring compatibility.
+翻译节点可以访问之前由 PX4 定义的所有消息版本。
+它积极观察了光盘系统的数据空间,监测出版物。 通过[uXRCE-DDS桥](../middleware/uxrce_dds.md)或外空委2应用源于PX4的订阅和服务。
+必要时,它会将消息转换到应用程序和PX4预期的当前版本,确保兼容性。
-
+![概述ROS 2消息转换节点]
+(../../assets/middleware/ros2/px4_ros2_interface_lib/translation_node.svg)
-To support the coexistence of different versions of the same messages within the ROS 2 domain, the ROS 2 topic-names for publications, subscriptions, and services include their respective message version as a suffix.
-This naming convention takes the form `_v`, as shown in the diagram above.
+支持不同版本的同一消息在交战规则2域内共存, 出版、订阅和服务的ROS 2主题名称包括各自的信息版本的后缀。
+这个命名协议的形式为`_v`。
## 用法
### 安装
-The following steps describe how to install and run the translation node on your machine.
+以下步骤描述如何在您的机器上安装和运行翻译节点。
-1. (Optional) Create a new ROS 2 workspace in which to build the message translation node and its dependencies:
+1. (可选) 创建一个新的 ROS2 工作空间,用于构建消息翻译节点及其依赖:
```sh
mkdir -p /path/to/ros_ws/src
```
-2. Run the following helper script to copy the message definitions and translation node into your ROS workspace directory.
+2. 运行下面的帮助脚本来复制消息定义并将节点翻译到您的ROS工作区目录。
```sh
cd /path/to/ros_ws
/path/to/PX4-Autopilot/Tools/copy_to_ros_ws.sh .
```
-3. Build and source the workspace.
+3. 构建并源自工作区。
```sh
colcon build
source /path/to/ros_ws/install/setup.bash
```
-4. Finally, run the translation node.
+4. 最后,运行翻译节点。
```sh
ros2 run translation_node translation_node_bin
```
- You should see an output similar to:
+ 您应该看到一个相似的输出:
```sh
- [INFO] [1734525720.729530513] [translation_node]: Registered pub/sub topics and versions:
- [INFO] [1734525720.729594413] [translation_node]: Registered services and versions:
+ [INFO] [1734525720.729530513] [translation_node]: 注册的 pub/子主题和版本:
+ [INFO] [1734525720.729594413] [translation_node]: 注册的服务和版本:
```
-With the translation node running, any simultaneously running ROS 2 application designed to communicate with PX4 can do so, as long as it uses message versions recognized by the node.
-The translation node will print a warning if it encounters an unknown topic version.
+在正在运行翻译节点时,任何同时运行旨在与 PX4 通信的 ROS 2 应用程序都可以这样做。 只要它使用节点承认的消息版本。
+翻译节点如果遇到未知的主题版本,将打印警告。
:::info
-After making a modification in PX4 to the message definitions and/or translation node code, you will need to rerun the steps above from point 2 to update your ROS workspace accordingly.
+在 PX4 修改消息定义和/或翻译节点代码后, 您需要从点2重新运行以上步骤来相应更新您的ROS工作区。
:::
### 在ROS 应用中
-While developing a ROS 2 application that communicates with PX4, it is not necessary to know the specific version of a message being used.
-The message version can be added generically to a topic name like this:
+开发与 PX4 通信的 ROS 2 应用程序时,不必知道正在使用的消息的特定版本。
+消息版本可以以如以下方式一般添加到主题名称中:
:::: tabs
:::tab C++
```c++
-topic_name + "_v" + std::to_string(T::MESSAGE_VERSION)
+主题名称+ "_v" + std::to_string(T::MESSAGE_VERSION)
```
:::
@@ -83,30 +84,30 @@ topic_name + "_v" + std::to_string(T::MESSAGE_VERSION)
:::tab Python
```python
-topic_name + "_v" + VehicleAttitude.MESSAGE_VERSION
+主题名称 + "_v" + VehicleAttitude.MESSAGE_VERSION
```
:::
::::
-where `T` is the message type, e.g. `px4_msgs::msg::VehicleAttitude`.
+其中‘T’消息类型,例如`px4_msgs::msg::VehicleAttitude`.
-For example, the following implements a minimal subscriber and publisher node that uses two versioned PX4 messages and topics:
+例如,以下是一个实现最小化订阅者和发布者节点的示例,该节点使用两个带版本的 PX4 消息和主题:
:::: tabs
:::tab C++
```c++
-#include
-#include
-#include
-#include
+#include <0>
+#include <1>
+#include <2>
+#include <3>
// Template function to get the message version suffix
// The correct message version is directly inferred from the message defintion
-template
+template <4>
std::string getMessageNameVersion() {
if (T::MESSAGE_VERSION == 0) return "";
return "_v" + std::to_string(T::MESSAGE_VERSION);
@@ -116,13 +117,13 @@ class MinimalPubSub : public rclcpp::Node {
public:
MinimalPubSub() : Node("minimal_pub_sub") {
// Use template function to define the correct topics automatically
- const std::string sub_topic = "/fmu/out/vehicle_attitude" + getMessageNameVersion();
- const std::string pub_topic = "/fmu/in/vehicle_command" + getMessageNameVersion();
+ const std::string sub_topic = "/fmu/out/vehicle_attitude" + getMessageNameVersion<5>();
+ const std::string pub_topic = "/fmu/in/vehicle_command" + getMessageNameVersion<6>();
- _subscription = this->create_subscription(
+ _subscription = this->create_subscription<5>(
sub_topic, 10,
std::bind(&MinimalPubSub::attitude_callback, this, std::placeholders::_1));
- _publisher = this->create_publisher(pub_topic, 10);
+ _publisher = this->create_publisher<6>(pub_topic, 10);
}
private:
@@ -130,8 +131,8 @@ class MinimalPubSub : public rclcpp::Node {
RCLCPP_INFO(this->get_logger(), "Received attitude message.");
}
- rclcpp::Publisher::SharedPtr _publisher;
- rclcpp::Subscription::SharedPtr _subscription;
+ rclcpp::Publisher<6>::SharedPtr _publisher;
+ rclcpp::Subscription<5>::SharedPtr _subscription;
};
```
@@ -180,34 +181,34 @@ class MinimalPubSub(Node):
::::
-On the PX4 side, the DDS client automatically adds the version suffix if a message definition contains the field `uint32 MESSAGE_VERSION = x`.
+在 PX4 侧,如果消息定义包含字段`uint32 MESSAGE_VERSION = x`,DDS客户端自动添加版本后缀。
:::info
主题版本0意味着不应添加`_v`后缀。
:::
-## Development
+## 开发
-### Definitions
+### 定义
-A **message** defines the data format used for communication, whether over a topic or a service.
-Therefore a message can be either a _topic_ message defined by a `.msg` file, or a _service_ message defined by a `.srv` file.
+**消息** 定义了用于通信的数据格式,无论是主题还是服务。
+因此,消息可以是 ".msg" 文件定义的 _topic_ 消息,也可以是 ".srv" 文件定义的 _service_ 消息。
-A **versioned message** is a message for which changes are tracked and each change results in a version bump, with the previous state of the definition being stored in history.
-The latest version of every message is stored in `msg/versioned/` for topics (or `srv/versioned` for services), and all older versions are stored in `msg/px4_msgs_old/msg/` (or `msg/px4_msgs_old/srv/`).
+**版本信息** 是指跟踪更改的消息,每次变更都会导致版本号递增,且定义的历史状态会被保存下来。
+每个消息的最新版本都存储在 `msg/versioned/` 中,用于主题(或`srv/versioned` 用于服务), 所有旧版本都存储在`msg/px4_msgs_old/msg/`(或`msg/px4_msgs_old/srv/`)中。
-A **version translation** defines a bidirectional mapping of the contents of one or more message definition across different versions.
-Each translation is stored as a separate `.h` header file under `msg/translation_node/translations/`.
-Message translations can be either _direct_ or _generic_.
+**版本翻译**定义了一个或多个消息定义的内容在不同版本之间的双向映射。
+每个翻译以单独的 .h 头文件形式存储在 msg/translation_node/translations/ 目录下。
+消息翻译可以是 _direct_或 _generic_。
-- A **direct translation** defines a bidirectional mapping of the contents of a _single_ message between two of its versions.
- This is the simpler case and should be preferred if possible.
-- A **generic translation** defines a bidirectional mapping of the contents of `n` input messages to `m` output messages across different versions.
- This can be used for merging or splitting a message, or when moving a field from one message to another.
+- **直接翻译** 定义一个双向映射其两个版本之间消息的内容。
+ 这是更简单的情况,在可能的情况下应优先选择。
+- **通用翻译** 定义了双向映射`n`输入消息的内容到不同版本的`m`输出消息。
+ 这可用于合并或拆分消息,也可用于将某个字段从一个消息迁移至另一个消息。
### File Structure
-Starting from PX4 v1.16, the PX4-Autopilot `msg/` and `srv/` directories are structured as follows:
+从 PX4 v1.16 版本开始,PX4-Autopilot(PX4 自动驾驶系统)的 msg/ 和 srv/ 目录结构如下:
```
PX4-Autopilot
@@ -222,15 +223,15 @@ PX4-Autopilot
└── versioned/ # Latest versioned service message files
```
-This structure introduces new directories: `versioned/`, `px4_msgs_old/`, and `translation_node/`.
+这个结构引入了新的目录:“versioned/`,`px4_msgs_old/`,以及`translation_node/\`。
-#### Directories `msg/versioned/` and `srv/versioned/`
+#### 目录`msg/versioned/` 和 `srv/versioned/`
-- Contain the current latest version of each message.
-- Files in these directories must include a `MESSAGE_VERSION` field to indicate that they are versioned.
-- File names follow the conventional naming scheme (without a version suffix).
+- 包含每条消息当前的最新版本。
+- 这些目录中的文件必须包含 `MESSAGE_VERSION` 字段以表明它们是版本控制。
+- 文件名遵循常规命名规则(不带版本后缀)。
-Example directory structure:
+示例目录结构:
```
PX4-Autopilot
@@ -244,13 +245,13 @@ PX4-Autopilot
└── VehicleCommand.srv # e.g. MESSAGE_VERSION = 2
```
-#### Directory `px4_msgs_old/`
+#### 目录`px4_msgs_old/`
-- Archives the history of all versioned messages, including both topic and service messages (resp. under `msg/` and `srv/` subdirectories).
-- Each file includes a `MESSAGE_VERSION` field.
-- File names reflect the message's version with a suffix (e.g., `V1`, `V2`).
+- 将所有版本信息的历史记录存档,包括主题和服务信息(resp. under `msg/`和`srv/`子目录)。
+- 每个文件都包含一个 MESSAGE_VERSION 字段。
+- 文件名反映了带有后缀的消息版本(如:`V1`、`V2`)。
-Example directory structure (matching the example above):
+示例目录结构(匹配上面的示例):
```
...
@@ -264,13 +265,13 @@ Example directory structure (matching the example above):
└── VehicleCommandV1.srv
```
-#### Directory `translation_node/`
+#### 目录`translation_node/`
-- Contains headers for translating between all different versions of messages.
-- Each translation (direct or generic) is a single `.h` header file.
-- The header `all_translation.h` acts as the main header, and includes all subsequent translation headers.
+- 包含用于在所有不同版本的消息之间进行翻译的标题。
+- 每个翻译 (直接或通用) 都是单个的 `.h` 标题文件。
+- 标题`all_translation.h`是主标题,包含所有其后的翻译标题。
-Example directory structure (matching the example above):
+示例目录结构(匹配上面的示例):
```
...
@@ -287,36 +288,36 @@ Example directory structure (matching the example above):
└── translation_vehicle_command_v2.h # Direct translation v1 <-> latest (v2)
```
-### Updating a Versioned Message
+### 正在更新版本信息...
-This section provides a step-by-step walkthrough and a basic working example of what the process of changing a versioned message looks like.
+本节提供了分步操作指南以及一个基础的可运行示例,以展示修改版本化消息的流程具体是怎样的。
-The example describes the process of updating the `VehicleAttitude` message definition to contain an additional `new_field` entry, incrementing the message version from `3` to `4`, and creating a new direct translation in the process.
+该示例描述了更新VehicleAttitude消息定义的流程,具体包括:为其添加一个额外的new_field字段、将消息版本从3递增至4,并在此过程中创建一个新的直接转换。
-1. **Create an Archived Definition of the Current Versioned Message**
+1. **创建当前版本信息的存档定义**
- Copy the versioned `.msg` topic message file (or `.srv` service message file) to `px4_msgs_old/msg/` (or `px4_msgs_old/srv/`), and append its message version to the file name.
+ 将版本号的`.msg`主题消息文件(或`.srv`服务消息文件)复制到`px4_msgs_old/msg/`(或`px4_msgs_old/srv/`),并将其消息版本附加到文件名。
- For example:
- Copy `msg/versioned/VehicleAttitude.msg` → `msg/versioned/px4_msgs_old/msg/VehicleAttitudeV3.msg`
+ 例如:
+ 复制 `msg/versioned/VehicleAttitude.msg` → `msg/versioned/px4_msgs_old/msg/VehicleAttitudeV3.msg`
-2. **Update Translation References to the Archived Definition**
+2. **更新对存档定义的转化引用**
- Update the existing translations header files `msg/translation_node/translations/*.h` to reference the newly archived message definition.
+ 更新现有翻译标头文件 `msg/translation_node/translations/*.h` 以参考新存档的消息定义。
- For example, update references in those files:
+ 例如,更新这些文件中的引用:
- - Replace `px4_msgs::msg::VehicleAttitude` → `px4_msgs_old::msg::VehicleAttitudeV3`
- - Replace `#include ` → `#include `
+ - 替换 `px4_msgs::msg::VehicleAttitude` → `px4_msgs_old::msg::VehicleAttitudeV3`
+ - 替换`#include ` -> \`#include
-3. **Update the Versioned Definition**
+3. **更新版本定义**
- Update the versioned `.msg` topic message file (or `.srv` service message file) with required changes.
+ 更新版本的 `.msg` 主题消息文件 (或`.srv` 服务消息文件) 并进行必要的更改。
- First increment the `MESSAGE_VERSION` field.
- Then update the message fields that prompted the version change.
+ 第一次递增`MESSAGE_VERSION`字段。
+ 然后更新促使版本变更的消息字段。
- For example, update `msg/versioned/VehicleAttitude.msg` from:
+ 例如,更新 `msg/versioned/vehicleAttitde.msg` 从:
```txt
uint32 MESSAGE_VERSION = 3
@@ -324,20 +325,19 @@ The example describes the process of updating the `VehicleAttitude` message defi
...
```
- to
+ 到
```txt
uint32 MESSAGE_VERSION = 4 # Increment
uint64 timestamp
float32 new_field # Make definition changes
- ...
```
-4. **Add a New Translation Header**
+4. **添加新的翻译标头**
- Add a new version translation to bridge the archived version and the updated current version, by creating a new translation header.
+ 通过创建一个新的翻译标头来添加一个新的版本翻译来连接存档版本和更新的当前版本。
- For example, create a direct translation header `translation_node/translations/translation_vehicle_attitude_v4.h`:
+ 例如,创建一个直接翻译标题`translation_node/translation_vaille_attitude_v4.h`:
```c++
// Translate VehicleAttitude v3 <--> v4
@@ -381,72 +381,70 @@ The example describes the process of updating the `VehicleAttitude` message defi
// Discards `new_field` from MessageNewer
}
};
-
- REGISTER_TOPIC_TRANSLATION_DIRECT(VehicleAttitudeV4Translation);
```
- Version translation templates are provided here:
+ 版本翻译模板在此提供:
- [Direct Topic Message Translation Template](https://github.com/PX4/PX4-Autopilot/blob/main/msg/translation_node/translations/example_translation_direct_v1.h)
- [Generic Topic Message Translation Template](https://github.com/PX4/PX4-Autopilot/blob/main/msg/translation_node/translations/example_translation_multi_v2.h)
- [Direct Service Message Translation Template](https://github.com/PX4/PX4-Autopilot/blob/main/msg/translation_node/translations/example_translation_service_v1.h)
-5. **Include New Headers in `all_translations.h`**
+5. **在`all_translations.h`中包含新标头**
- Add all newly created headers to [`translations/all_translations.h`](https://github.com/PX4/PX4-Autopilot/blob/main/msg/translation_node/translations/all_translations.h) so that the translation node can find them.
+ 将所有新创建的标题添加到[`translations/all_translations.h`](https://github.com/PX4/PX4-Autopilot/blob/main/msg/translation_node/translations/all_translations.h),以便翻译节点能够找到它们。
- For example, append the following line to `all_translation.h`:
+ 例如,在`all_translation.h`上加上以下一行:
```c++
#include "translation_vehicle_attitude_v4.h"
```
-Note that in the example above and in most cases, step 4 only requires the developer to create a direct translation for the definition change.
-This is because the changes only involved a single message.
-In more complex cases of splitting, merging and/or moving definitions then a generic translation must be created.
+请注意,在上述示例中以及在大多数情况下,步骤 4 仅要求开发者针对此次定义变更创建一个直接转换。
+这是因为更改只涉及一个消息。
+在更复杂的分割、合并和/或移动定义的情况下,必须创建一个通用转化。
-For example when moving a field from one message to another, a single generic translation should be added with the two older message versions as input, and the two newer versions as output.
-This ensures there is no information lost when translating forward or backward.
+例如,当一个字段从一个消息移动到另一个消息时。 应增加一个单一通用翻译,两个较旧的信息版本作为输入,两个较新的版本作为输出。
+这就确保了在向前或向后翻译时不会丢失信息。
-This is exactly the approach shown by the [Generic Topic Message Translation Template](https://github.com/PX4/PX4-Autopilot/blob/main/msg/translation_node/translations/example_translation_multi_v2.h), omitting only the code for actually modifying fields in the `fromOlder()` and `toOlder()` methods.
+这正是 [Generic Topic Message Translation Template](https://github.com/PX4/PX4-Autopilot/blob/main/msg/translation_node/translations/example_translation_multi_v2.h) 所显示的方法。 只省略`fromOlder()` 和 `toOlder()` 方法中的字段的代码。
:::warning
-If a nested message definition changes, all messages including that message also require a version update.
-For example this would be the case for message [PositionSetpointTriplet](../msg_docs/PositionSetpointTriplet.md) if it were versioned.
-This is primarily important for services which are more likely reference other message definitions.
+如果嵌套消息定义发生了变化,包括该消息在内的所有消息也需要版本更新。
+例如,如果消息 [PositionSetpointTriplet](../msg_docs/PositionSetpointTriplet.md)有版本,将会出现这种情况。
+这一点对于服务而言尤为重要,因为服务更有可能引用其他消息定义。
:::
-## Implementation Details
+## 实现细节
-The translation node dynamically monitors the topics and services.
-It then instantiates the counterside of the publications and subscribers as required.
-For example if there is an external publisher for version 1 of a topic and subscriber for version 2.
+转换节点动态监测主题和服务。
+然后视需要举例说明出版物和订阅者的对应情况。
+例如,如果主题第1版有外部发行商,第2版则有订阅商。
-Internally, it maintains a graph of all known topic and version tuples (which are the graph nodes).
-The graph is connected by the message translations.
-As arbitrary message translations can be registered, the graph can have cycles and multiple paths from one node to another.
-Therefore on a topic update, the graph is traversed using a shortest path algorithm.
-When moving from one node to the next, the message translation method is called with the current topic data.
-If a node contains an instantiated publisher (because it previously detected an external subscriber), the data is published.
-Thus, multiple subscribers of any version of the topic can be updated with the correct version of the data.
+在内部,它保存一份所有已知主题和版本管束的图表(即图节点)。
+该图通过消息转换实现连接。
+由于任意的消息转换可以注册,图可以有周期和从一个节点到另一个节点的多个路径。
+因此,在主题更新中,图形使用最短路径算法。
+当从一个节点移动到另一个节点时,消息翻译方法将与当前主题数据调用。
+如果节点包含实例化发布器 (因为它先前检测到外部订阅者),数据将被发布。
+这样,本专题任何版本的多个订阅者都可以用正确的数据更新数据。
-For translations with multiple input topics, the translation continues once all input messages are available.
+对于有多个输入主题的转化,转化将在所有输入消息都可用后继续。
## 局限
-- Translation of service messages does not work on ROS Humble, but does on ROS Jazzy.
- This is because the current implementation depends on a service API that is not yet available in ROS Humble.
- Translation of topic messages is fully supported.
-- Services messages only support a linear history, i.e. no message splitting or merging.
-- Having both publishers and subscribers for two different versions of the same topic is currently not handled by the translation node and would trigger infinite circular publications.
- This refers to the following problematic configuration:
+- 服务消息的转化不适用于 ROS Humble,而是适用于ROSJazzy。
+ 这是因为当前的实现取决于尚未在ROS人类中提供的服务 API 。
+ 完全支持主题信息转化。
+- 服务消息只支持线性历史记录,即没有消息拆分或合并。
+- 两个不同版本的同一主题的出版商和订户目前都不是由转化节点处理的,会引发无限的循环出版物。
+ 这是指下列有问题的配置:
```
app 1: pub topic_v1, sub topic_v1
app 2: pub topic_v2, sub topic_v2
```
- In practice this configuration is unlikely to occur because ROS topics shared with the FMU are intended to be directional (e.g. `/fmu/out/vehicle_status` or `/fmu/in/trajectory_setpoint`), therefore apps typically do not publish and subscribe simultaneously to the same topic.
- The translation node could be extended to handle this corner-case if required.
+ 实际上,这种配置不大可能发生,因为与金融监督单位共享的外空系统专题是指向的(例如)。 `/fmu/out/vehicle_status` 或 `/fmu/in/tracjectory_setpoint` ,因此应用通常不会同时发布和订阅相同的主题。
+ 如果需要,可以扩展翻译节点来处理这个卷轴。
-Original document with requirements: https://docs.google.com/document/d/18_RxV1eEjt4haaa5QkFZAlIAJNv9w5HED2aUEiG7PVQ/edit?usp=sharing
+需要原始文件:https://docs.google.com/document/d/18_RxV1eEjt4haaa5QkFZAlIAJNv9w5HED2aUEiG7PVQ/edit?usp=sharing
diff --git a/docs/zh/ros2/px4_ros2_navigation_interface.md b/docs/zh/ros2/px4_ros2_navigation_interface.md
index c726973a17..120183b7e1 100644
--- a/docs/zh/ros2/px4_ros2_navigation_interface.md
+++ b/docs/zh/ros2/px4_ros2_navigation_interface.md
@@ -7,16 +7,16 @@ Experimental
在撰写本文时,PX4 ROS 2 接口库的部分内容仍处于试验阶段,因此可能会发生变动。
:::
-The [PX4 ROS 2 Interface Library](../ros2/px4_ros2_interface_lib.md) navigation interface enables developers to send their position measurements to PX4 directly from ROS 2 applications, such as a VIO system or a map matching system.
-The interface provides a layer of abstraction from PX4 and the uORB messaging framework, and introduces a few sanity checks on the requested state estimation updates sent via the interface.
-These measurements are then fused into the EKF just as though they were internal PX4 measurements.
+[PX4 ROS 2 Interface Library](../ros2/px4_ros2_interface_lib.md) 中的导航接口,支持开发者直接从 ROS 2 应用(如视觉惯性里程计系统或地图匹配系统)向 PX4 发送位置测量数据。
+该接口提供了对 PX4 和 uORB 消息框架的抽象层,并对通过该接口发送的请求状态估计更新引入了一些合理性检查。
+这些测量数据随后会被融合到扩展EKF中,其处理方式与 PX4 内部生成的测量数据完全一致。
-The library provides two classes, [`LocalPositionMeasurementInterface`](https://auterion.github.io/px4-ros2-interface-lib/classpx4__ros2_1_1LocalPositionMeasurementInterface.html) and [`GlobalPositionMeasurementInterface`](https://auterion.github.io/px4-ros2-interface-lib/classpx4__ros2_1_1GlobalPositionMeasurementInterface.html), which both expose a similar `update` method to provide either a local position or global position update to PX4, respectively.
-The `update` method expects a position measurement `struct` ([`LocalPositionMeasurement`](https://auterion.github.io/px4-ros2-interface-lib/structpx4__ros2_1_1LocalPositionMeasurement.html) or [`GlobalPositionMeasurement`](https://auterion.github.io/px4-ros2-interface-lib/structpx4__ros2_1_1GlobalPositionMeasurement.html)) which developers can populate with their own generated position measurements.
+库提供两个类,[`LocalPositionMeasurementInterface`](https://auterion.github.io/px4-ros2-interface-lib/classpx4__ros2_1_1LocalPositionMeasurementInterface.html) 和 [`GlobalPositionMeasureInterface`](https://auterion.github.io/px4-ros2-interface-lib/classpx4__ros2_1_1GlobalPositionMeasurementInterface.html) 它都会暴露出一个类似的 "update" 方法来提供一个本地位置或全球位置更新到 PX4。
+`update`方法需要一个位置测量`struct`(`LocalPositionMeasure`](https://auterion.github.io/px4-ros2-interface-lib/structpx4__ros2_1_1LocalPositionMeasurement.html)或[\`GlobalPositionMeasure\`](https://auterion.github.io/px4-ros2-interface-lib/structpx4__ros2_1_1GlobalPositionMeasurement.html)],开发者可以在其中填入自己生成的位置测量数据。
-## Installation and First Test
+## 安装与首次测试
-The following steps are required to get started:
+开始使用前,需完成以下步骤:
1. 请确保您在 ROS 2 工作区中有 [ROS 2 设置](../ros2/user_guide.md) 与 [`px4_msgs`](https://github.com/PX4/px4_msgs]。
@@ -37,32 +37,32 @@ The following steps are required to get started:
```sh
cd ..
- colcon build
+ colcon版本
```
-4. In a different shell, start PX4 SITL:
+4. 在另一个外壳中,启动 PX4 SITL:
```sh
cd $px4-autopilot
make px4_sitl gazebo-classic
```
- (here we use Gazebo-Classic, but you can use any model or simulator)
+ (这里我们使用Gazebo-Classic,但你可以使用任何模型或模拟器)
-5. In yet a different shell, run the micro XRCE agent (you can keep it running afterward):
+5. 在另一个独立的终端中,运行 micro XRCE 代理(运行后可保持后台持续运行):
```sh
MicroXRCEAgent udp4 -p 8888
```
-6. Back in the ROS 2 terminal, source the workspace you just built (in step 3) and run the [global_navigation](https://github.com/Auterion/px4-ros2-interface-lib/tree/main/examples/cpp/navigation/global_navigation) example, which periodically sends dummy global position updates:
+6. 返回ROS2终端,为您刚刚构建的工作空间(步骤3),运行 [global_navigation](https://github.com/Auterion/px4-ros2-interface-lib/tree/main/examples/cpp/navigation/global_navigation) 示例。 它会周期性地发送虚拟的全球位置更新(数据):
```sh
source install/setup.bash
ros2 run example_global_navigation_cpp example_global_navigation
```
- You should get an output like this showing that the global interface is successfully sending position updates:
+ 你应会看到如下所示的输出,该输出表明全球位置接口正成功发送位置更新:
```sh
[INFO] [1702030701.836897756] [example_global_navigation_node]: example_global_navigation_node running!
@@ -70,13 +70,13 @@ The following steps are required to get started:
[DEBUG] [1702030703.837223884] [example_global_navigation_node]: Successfully sent position update to navigation interface.
```
-7. In the PX4 shell, you can check that PX4 receives global position updates:
+7. 在 PX4 终端(PX4 shell)中,你可以通过以下操作检查 PX4 是否接收到全球位置更新(数据)
```sh
listener aux_global_position
```
- The output should look like:
+ 输出内容应如下所示:
```sh
TOPIC: aux_global_position
@@ -97,31 +97,31 @@ The following steps are required to get started:
dead_reckoning: False
```
-8. Now you are ready to use the navigation interface to send your own position updates.
+8. 现在你已准备好使用该导航接口发送自己的位置更新数据了。
-## How to use the Library
+## 如何使用代码库
-To send a position measurement, you populate the position struct with the values you have measured.
-Then call the interface's update function with that struct as the argument.
+要发送位置测量数据,你需要用所测量的值填充位置结构体。
+然后以此结构调用接口的更新功能作为参数。
-For a basic example of how to use this interface, check out the [examples](https://github.com/Auterion/px4-ros2-interface-lib/tree/main/examples/cpp/navigation) in the `Auterion/px4-ros2-interface-lib` repository, such as [examples/cpp/navigation/local_navigation](https://github.com/Auterion/px4-ros2-interface-lib/blob/main/examples/cpp/navigation/local_navigation/include/local_navigation.hpp) or [examples/cpp/navigation/global_navigation](https://github.com/Auterion/px4-ros2-interface-lib/blob/main/examples/cpp/navigation/local_navigation/include/global_navigation.hpp).
+关于如何使用此接口的基本示例,请在“Auterion/px4-ros2-interface-lib”仓库中查看 [examples](https://github.com/Auterion/px4-ros2-interface-lib/tree/main/examples/cpp/navigation) 例如[示例/cpp/navigation/local_navigation](https://github.com/Auterion/px4-ros2-interface-lib/blob/main/examples/cpp/navigation/local_navigation/include/local_navigation.hpp)或[示例/cpp/navigation/global_navigation](https://github.com/Auterion/px4-ros2-interface-lib/blob/main/examples/cpp/navigation/local_navigation/include/global_navigation.hpp)。
-### Local Position Updates
+### 局部位置更新
-First ensure that the PX4 parameter [`EKF2_EV_CTRL`](../advanced_config/parameter_reference.md#EKF2_EV_CTRL) is properly configured to fuse external local measurements, by setting the appropriate bits to `true`:
+首先确保正确配置 PX4 参数[`EKF2_EV_CTRL`](../advanced_config/parameter_reference.md#EKF2_EV_CTRL)通过将相应的位设置为true,可以正确配置(系统)以融合外部局部测量数据:
-- `0`: Horizontal position data
-- `1`: Vertical position data
-- `2`: Velocity data
-- `3`: Yaw data
+- `0`: 水平位置数据
+- `1`:垂直位置数据
+- `2`:速度数据
+- `3`:偏航角数据
-To send a local position measurement to PX4:
+向PX4发送局部位置测量:
-1. Create a [`LocalPositionMeasurementInterface`](https://auterion.github.io/px4-ros2-interface-lib/classpx4__ros2_1_1LocalPositionMeasurementInterface.html) instance by providing it with: a ROS node, and the pose and velocity reference frames of your measurements.
-2. Populate a [`LocalPositionMeasurement`](https://auterion.github.io/px4-ros2-interface-lib/structpx4__ros2_1_1LocalPositionMeasurement.html) `struct` with your measurements.
-3. Pass the `struct` to the `LocalPositionMeasurementInterface` [`update()`](https://auterion.github.io/px4-ros2-interface-lib/classpx4__ros2_1_1LocalPositionMeasurementInterface.html#a6fd180b944710716d418b2cfe1c0c8e3) method.
+1. 通过提供一个 ROS节点,创建一个 [`localPositionMeasureInterface` ](https://auterion.github.io/px4-ros2-interface-lib/classpx4__ros2_1_1LocalPositionMeasurementInterface.html) 实例:您测量的位置和速度参考框架。
+2. 包含一个[`本地定位测量`](https://auterion.github.io/px4-ros2-interface-lib/structpx4__ros2_1_1LocalPositionMeasurement.html) `structt` ,包含你测量的数据。
+3. 将 `struct` 传入 `LocalPositionMeasurementInterface` [`update()`](https://auterion.github.io/px4-ros2-interface-lib/classpx4__ros2_1_1LocalPositionMeasurementInterface.html#a6fd180b944710716d418b2cfe1c0c8e3) 方法中。
-The available pose and velocity reference frames for your measurements are defined by the following `enum`:
+你的测量数据可用的位置和速度参考坐标系由以下枚举(enum)定义:
```cpp
enum class PoseFrame
@@ -140,36 +140,36 @@ enum class VelocityFrame
};
```
-The `LocalPositionMeasurement` struct is defined as follows:
+`LocalPositionMeasurement`结构定义如下:
```cpp
struct LocalPositionMeasurement
{
rclcpp::Time timestamp_sample {};
- std::optional position_xy {std::nullopt};
- std::optional position_xy_variance {std::nullopt};
- std::optional position_z {std::nullopt};
- std::optional position_z_variance {std::nullopt};
+ std::optional<0> position_xy {std::nullopt};
+ std::optional<0> position_xy_variance {std::nullopt};
+ std::optional<1> position_z {std::nullopt};
+ std::optional<1> position_z_variance {std::nullopt};
- std::optional velocity_xy {std::nullopt};
- std::optional velocity_xy_variance {std::nullopt};
- std::optional velocity_z {std::nullopt};
- std::optional velocity_z_variance {std::nullopt};
+ std::optional<0> velocity_xy {std::nullopt};
+ std::optional<0> velocity_xy_variance {std::nullopt};
+ std::optional<1> velocity_z {std::nullopt};
+ std::optional<1> velocity_z_variance {std::nullopt};
- std::optional attitude_quaternion {std::nullopt};
- std::optional attitude_variance {std::nullopt};
+ std::optional<2> attitude_quaternion {std::nullopt};
+ std::optional<3> attitude_variance {std::nullopt};
};
```
-The `update()` method of the local interface expects the following conditions to hold for `LocalPositionMeasurement`:
+局部接口的update()方法要求LocalPositionMeasurement(局部位置测量结构体)满足以下条件:
-- The sample timestamp is defined.
-- Values do not have a \`NAN\`\`.
-- If a measurement value is provided, its associated variance value is well defined (e.g. if `position_xy` is defined, then `position_xy_variance` must be defined).
-- If a measurement value is provided, its associated reference frame is not unknown (e.g. if `position_xy` is defined, then the interface was initialised with a pose frame different from `PoseFrame::Unknown`).
+- 示例时间戳已定义。
+- 数值不得包含 `NAN` 。
+- 如果提供了某个测量值,则其关联的方差值必须明确定义(例如,若position_xy已定义,则position_xy_variance也必须定义)。
+- 如果提供了某个测量值,那么其关联的参考坐标系不得为 “未知”(例如,若position_xy已定义,则接口必须以不同于PoseFrame::Unknown的位置坐标系进行初始化)。
-The following code snippet is an example of a ROS 2 node which uses the local navigation interface to send 3D pose updates in the North-East-Down (NED) reference frame to PX4:
+以下是一个 ROS 2 节点的示例代码片段,该节点使用局部导航接口向 PX4 发送东北天(NED)参考坐标系下的 3D 位姿更新:
```cpp
class MyLocalMeasurementUpdateNode : public rclcpp::Node
@@ -185,7 +185,7 @@ public:
const px4_ros2::VelocityFrame velocity_frame = px4_ros2::VelocityFrame::Unknown;
// Initialize local interface [1]
_local_position_measurement_interface =
- std::make_shared(*this, pose_frame, velocity_frame);
+ std::make_shared(*this, pose_frame, velocity_frame);
}
void sendUpdate()
@@ -217,45 +217,44 @@ public:
}
private:
- std::shared_ptr _local_position_measurement_interface;
+ std::shared_ptr _local_position_measurement_interface;
};
```
-### Global Position Updates
+### 全局位置更新
-First ensure that the PX4 parameter [`EKF2_AGP_CTRL`](../advanced_config/parameter_reference.md#EKF2_AGP_CTRL) is properly configured to fuse external global measurements, by setting the appropriate bits to `true`:
+首先确保正确配置 PX4 参数[`EKF2_EV_CTRL`](../advanced_config/parameter_reference.md#EKF2_AGP_CTRL)通过将相应的位设置为true,可以正确配置(系统)以融合外部全部测量数据:
-- `0`: Horizontal position data
-- `1`: Vertical position data
+- `0`: 水平位置数据
+- `1`:垂直位置数据
-To send a global position measurement to PX4:
+向PX4发送全局位置测量:
-1. Create a [`GlobalPositionMeasurementInterface`](https://auterion.github.io/px4-ros2-interface-lib/classpx4__ros2_1_1GlobalPositionMeasurementInterface.html) instance by providing it with a ROS node.
-2. Populate a [`GlobalPositionMeasurement`](https://auterion.github.io/px4-ros2-interface-lib/structpx4__ros2_1_1GlobalPositionMeasurement.html) `struct` with your measurements.
-3. Pass the struct to the `GlobalPositionMeasurementInterface` [update()](https://auterion.github.io/px4-ros2-interface-lib/classpx4__ros2_1_1GlobalPositionMeasurementInterface.html#a1a183b595ef7f6a22f3a83ba543fe86d) method.
+1. 创建一个 [`GlobalPositionMeasureInterface`](https://auterion.github.io/px4-ros2-interface-lib/classpx4__ros2_1_1GlobalPositionMeasurementInterface.html) 实例,并提供一个 ROS节点。
+2. 包含一个[`GlobalPositionMeasurement`](https://auterion.github.io/px4-ros2-interface-lib/structpx4__ros2_1_1GlobalPositionMeasurement.html) `struct` ,包含你测量的数据。
+3. 将结构移至`GlobalPositionMeasurementInterface` [update()](https://auterion.github.io/px4-ros2-interface-lib/classpx4__ros2_1_1GlobalPositionMeasurementInterface.html#a1a183b595ef7f6a22f3a83ba543fe86d) 方法中。
-The `GlobalPositionMeasurement` struct is defined as follows:
+`GlobalPositionMeasurement`结构定义如下:
```cpp
struct GlobalPositionMeasurement
{
rclcpp::Time timestamp_sample {};
- std::optional lat_lon {std::nullopt};
- std::optional horizontal_variance {std::nullopt};
+ std::optional lat_lon {std::nullopt};
+ std::optional<1> horizontal_variance {std::nullopt};
- std::optional altitude_msl {std::nullopt};
- std::optional vertical_variance {std::nullopt};
-};
+ std::optional<1> altitude_msl {std::nullopt};
+ std::optional<1> vertical_variance {std::nullopt};
```
-The `update()` method of the global interface expects the following conditions to hold for `GlobalPositionMeasurement`:
+全局接口的 `update()` 方法预计在 `GlobalPositionMeasurement` 中保留以下条件:
-- The sample `timestamp_sample` is defined.
-- Values do not have a NAN.
-- If a measurement value is provided, its associated variance value is well defined (e.g. if `lat_lon` is defined, then `horizontal_variance` must be defined).
+- 样本`timestamp_sample`已定义。
+- 数据不得包含NAN。
+- 如果提供了某个测量值,那么其关联的方差值必须明确定义(例如,若lat_lon(经纬度)已定义,则horizontal_variance(水平方差)也必须定义)。
-The following code snippet is an example of a ROS 2 node which uses the global navigation interface to send a measurement with latitude, longitude and altitude to PX4:
+下面的代码片段是一个 ROS 2 节点的示例,该节点使用全局导航接口来发送一个测量纬度。 经度和高度到 PX4:
```cpp
class MyGlobalMeasurementUpdateNode : public rclcpp::Node
@@ -266,7 +265,7 @@ public:
{
// Initialize global interface [1]
_global_position_measurement_interface =
- std::make_shared(*this);
+ std::make_shared(*this);
}
void sendUpdate()
@@ -298,11 +297,11 @@ public:
}
private:
- std::shared_ptr _global_position_measurement_interface;
+ std::shared_ptr<0> _global_position_measurement_interface;
};
```
-## Multiple Instances of an Interface
+## 接口的多个实例
-Using multiple instances of the same interface (e.g. local and local) to send estimation updates will stream all update messages to the same topic and result in cross-talk.
-This should not affect measurement fusion into the EKF, but different measurement sources will become indistinguishable.
+使用同一接口的多个实例(例如,多个局部接口实例)发送估计更新时,会将所有更新消息发送到同一个主题,从而导致串扰。
+这不应影响计量并入EKF,但不同的计量来源将无法区分。
diff --git a/docs/zh/ros2/user_guide.md b/docs/zh/ros2/user_guide.md
index 0a8bff0037..2bf55616cd 100644
--- a/docs/zh/ros2/user_guide.md
+++ b/docs/zh/ros2/user_guide.md
@@ -5,11 +5,11 @@ ROS 2-PX4 架构在ROS 2和PX4之间进行了深度整合。 允许 ROS 2 订阅
本指南介绍了系统架构和应用程序流程,并解释了如何与PX4一起安装和使用ROS2。
:::info
-From PX4 v1.14, ROS 2 uses [uXRCE-DDS](../middleware/uxrce_dds.md) middleware, replacing the _FastRTPS_ middleware that was used in version 1.13 (v1.13 does not support uXRCE-DDS).
+从 PX4 v1.14, ROS 2 使用 [uXRCE-DDS](../middleware/uxrce_dds.md) 中间件替换版本 1 中使用的 _FastRTPS_ 中间件. 3 (v1.13不支持uXRCE-DDS)。
-The [migration guide](../middleware/uxrce_dds.md#fast-rtps-to-uxrce-dds-migration-guidelines) explains what you need to do in order to migrate ROS 2 apps from PX4 v1.13 to PX4 v1.14.
+[migration guide](../middleware/uxrce_dds.md#fast-rtps-to-uxrce-dds-migration-guidelines) 解释您需要做什么来将ROS2 应用程序从 PX4 v1.13 迁移到 PX4 v1.14。
-If you're still working on PX4 v1.13, please follow the instructions in the [PX4 v1.13 Docs](https://docs.px4.io/v1.13/en/ros/ros2_comm.html).
+如果您仍然在 PX4 v1.13 上工作,请按照[PX4 v1.13 文档](https://docs.px4.io/v1.13/en/ros/ros2_comm.html)中的说明操作。
@@ -17,66 +17,66 @@ If you're still working on PX4 v1.13, please follow the instructions in the [PX4
## 综述
-The application pipeline for ROS 2 is very straightforward, thanks to the use of the [uXRCE-DDS](../middleware/uxrce_dds.md) communications middleware.
+得益于 uXRCE-DDS(../middleware/uxrce_dds.md) 通信中间件的使用,ROS 2 的应用流程非常简单直接。

-The uXRCE-DDS middleware consists of a client running on PX4 and an agent running on the companion computer, with bi-directional data exchange between them over a serial, UDP, TCP or custom link.
-The agent acts as a proxy for the client to publish and subscribe to topics in the global DDS data space.
+uXRCE-DDS 中间件由两部分组成:一部分是运行在 PX4 上的客户端,另一部分是运行在伴飞计算机上的代理;二者之间通过串口、UDP、TCP或自定义链路进行双向数据交换。
+代理充当客户端的代理角色,以便在全局 DDS 数据空间中发布和订阅主题。
-The PX4 [uxrce_dds_client](../modules/modules_system.md#uxrce-dds-client) is generated at build time and included in PX4 firmware by default.
-It includes both the "generic" micro XRCE-DDS client code, and PX4-specific translation code that it uses to publish to/from uORB topics.
-The subset of uORB messages that are generated into the client are specified in [dds_topics.yaml](../middleware/dds_topics.md).
-The generator uses the uORB message definitions in the source tree: [PX4-Autopilot/msg](https://github.com/PX4/PX4-Autopilot/tree/main/msg) to create the code for sending ROS 2 messages.
+PX4 [uxrce_dds_client](../modules/modules_system.md#uxrce-dds-client) 是在构建时生成,并且默认包含在 PX4 固件中。
+它包含“通用”XRCE-DDS客户端代码和它用来发布到/来自uORB主题的 PX4 特定转换代码。
+生成到客户端中的 uORB 消息子集在 [dds_topics.yaml](../middleware/dds_topics.md)中说明。
+生成器使用源代码树中的 uORB 消息定义:[PX4-Autopilot/msg](https://github.com/PX4/PX4-Autopilot/tree/main/msg) 用于生成发送 ROS 2 消息的代码。
-ROS 2 applications need to be built in a workspace that has the _same_ message definitions that were used to create the uXRCE-DDS client module in the PX4 Firmware.
-You can include these by cloning the interface package [PX4/px4_msgs](https://github.com/PX4/px4_msgs) into your ROS 2 workspace (branches in the repo correspond to the messages for different PX4 releases).
+ROS 2 应用程序需要在一个工作空间中构建,该工作空间需包含与 PX4 固件中创建 uXRCE-DDS 客户端模块时所用完全相同的消息定义。
+您可以通过克隆接口包[PX4/px4_msgs](https://github.com/PX4/px4_msgs)将这些内容纳入您的 ROS 2 工作空间(repo 中的范围与不同的 PX4 版本的消息相对应)。
-Starting from PX4 v1.16, in which [message versioning](../middleware/uorb.md#message-versioning) was introduced, ROS2 applications may use a different version of message definitions than those used to build PX4.
-This requires the [ROS 2 Message Translation Node](../ros2/px4_ros2_msg_translation_node.md) to be running to ensure that messages can be converted and exchanged correctly.
+从 PX4 v1.16 版本开始[message versioning](../middleware/uorb.md#message-versioning),ROS 2 应用程序所使用的消息定义版本,可与构建 PX4 时所用的消息定义版本不同。
+这需要[ROS 2 Message Translation Node](../ros2/px4_ros2_msg_translation_node.md)运行ROS 2 消息转换节点,以确保消息能够正确转换和交互。
-Note that the micro XRCE-DDS _agent_ itself has no dependency on client-side code.
-It can be built from [source](https://github.com/eProsima/Micro-XRCE-DDS-Agent) either standalone or as part of a ROS build, or installed as a snap.
+需要注意的是,微型XRCE-DDS _agent_ 本身并不依赖客户端代码。
+它可以从 [source](https://github.com/eProsima/Micro-XRCE-DDS-Agent)中单独构建,或者作为ROS构建的一部分,或者作为snap包安装。
-You will normally need to start both the client and agent when using ROS 2.
-Note that the uXRCE-DDS client is built into firmware by default but not started automatically except for simulator builds.
+在使用 ROS 2 时,您通常需要同时启动客户端和代理。
+需要注意的是,uXRCE-DDS 客户端默认已内置到固件中,但除仿真器构建版本外,不会自动启动。
:::info
-In PX4v1.13 and earlier, ROS 2 was dependent on definitions in [px4_ros_com](https://github.com/PX4/px4_ros_com).
-This repo is no longer needed, but does contain useful examples.
+在 PX4 v1.13 及更早版本中,ROS 2 依赖于 [px4_ros_com](https://github.com/PX4/px4_ros_com) 中的消息定义。
+该代码仓库已不再需要,但其中包含一些实用的示例。
:::
-## Installation & Setup
+## 安装与设置
-The supported and recommended ROS 2 platform for working with PX4 is ROS 2 "Humble" LTS on Ubuntu 22.04.
+支持和推荐使用 PX4 的 ROS 2 平台是 Ubuntu 的 ROS 2 “简易” LTS 22.04。
:::tip
-If you're working on Ubuntu 20.04 we recommend you update to Ubuntu 22.04.
-In the meantime you can use ROS 2 "Foxy" with [Gazebo Classic](../sim_gazebo_classic/index.md) on Ubuntu 20.04.
-Note that ROS 2 "Foxy" reached end-of-life in May 2023, but is (at time of writing) still stable and works with PX4.
+如果您在 Ubuntu 20.04 上工作,我们建议您更新到 Ubuntu 22.04。
+同时,你可以在 Ubuntu 20.04 上使用 [Gazebo Class](../sim_gazebo_classic/index.md) 的 ROS 2 "Foxy" 。
+请注意,第二号外空系统“Foxy”在2023年5月到达寿命终结,但在撰写本报告时仍然稳定并与PX4合作。
:::
-To setup ROS 2 for use with PX4:
+安装使用 PX4 的 ROS 2:
- [Install PX4](#install-px4) (to use the PX4 simulator)
- [Install ROS 2](#install-ros-2)
- [Setup Micro XRCE-DDS Agent & Client](#setup-micro-xrce-dds-agent-client)
- [Build & Run ROS 2 Workspace](#build-ros-2-workspace)
-Other dependencies of the architecture that are installed automatically, such as _Fast DDS_, are not covered.
+该架构中会自动安装的其他依赖项(如 Fast DDS)未在此处提及。
### 安装PX4
-You need to install the PX4 development toolchain in order to use the simulator.
+若要使用该仿真器,你需要安装 PX4 开发工具链。
:::info
-The only dependency ROS 2 has on PX4 is the set of message definitions, which it gets from [px4_msgs](https://github.com/PX4/px4_msgs).
-You only need to install PX4 if you need the simulator (as we do in this guide), or if you are creating a build that publishes custom uORB topics.
+唯一依赖于ROS2的 PX4 是一组信息定义,它从 [px4_msgs](https://github.com/PX4/px4_msgs)获取。
+您只需要安装 PX4 当您需要模拟器时(如我们在本指南中所做的那样), 或者如果您正在创建一个发布自定义uORB主题的构建。
:::
-Set up a PX4 development environment on Ubuntu in the normal way:
+通过以下方式在 Ubuntu 上配置一个 PX4 开发环境:
```sh
cd
@@ -86,16 +86,16 @@ cd PX4-Autopilot/
make px4_sitl
```
-Note that the above commands will install the recommended simulator for your version of Ubuntu.
-If you want to install PX4 but keep your existing simulator installation, run `ubuntu.sh` above with the `--no-sim-tools` flag.
+请注意,上述命令将为您的Ubuntu版本安装推荐的模拟器。
+如果您想要安装 PX4,但保留您现有的模拟器安装,请使用 "--no-sim-tools" 标志运行 `ubuntu.sh`。
-For more information and troubleshooting see: [Ubuntu Development Environment](../dev_setup/dev_env_linux_ubuntu.md) and [Download PX4 source](../dev_setup/building_px4.md).
+欲了解更多信息和故障排除,请参阅:[Ubuntu 开发环境](../dev_setup/dev_env_linux_ubuntu.md) 和 [下载 PX4 源](../dev_setup/building_px4.md)。
### 安装 ROS 2
-To install ROS 2 and its dependencies:
+安装 ROS 2 及其依赖:
-1. Install ROS 2.
+1. 安装 ROS 2.
:::: tabs
@@ -118,35 +118,35 @@ To install ROS 2 and its dependencies:
source /opt/ros/humble/setup.bash && echo "source /opt/ros/humble/setup.bash" >> .bashrc
```
- The instructions above are reproduced from the official installation guide: [Install ROS 2 Humble](https://docs.ros.org/en/humble/Installation/Ubuntu-Install-Debians.html).
- You can install _either_ the desktop (`ros-humble-desktop`) _or_ bare-bones versions (`ros-humble-ros-base`), _and_ the development tools (`ros-dev-tools`).
+ 以上说明转载自官方安装指南:[Install ROS 2 Humble](https://docs.ros.org/en/humble/Installation/Ubuntu-Install-Debians.html)。
+ 您可以安装 _either_ the desktop (`ros-humble-desktop`) _or_ bare-bones versions (`ros-humble-ros-base`), _and_ the development tools (`ros-dev-tools`).
:::
::: tab foxy
To install ROS 2 "Foxy" on Ubuntu 20.04:
- - Follow the official installation guide: [Install ROS 2 Foxy](https://docs.ros.org/en/foxy/Installation/Ubuntu-Install-Debians.html).
+ - 按照官方安装指南: [Install ROS 2 Foxy](https://docs.ros.org/en/foxy/Installation/Ubuntu-Install-Debians.html).
- You can install _either_ the desktop (`ros-foxy-desktop`) _or_ bare-bones versions (`ros-foxy-ros-base`), _and_ the development tools (`ros-dev-tools`).
+ 您可以安装 _either_ the desktop (`ros-foxy-desktop`) _or_ bare-bones versions (`ros-foxy-ros-base`), _and_ the development tools (`ros-dev-tools`).
:::
::::
-2. Some Python dependencies must also be installed (using **`pip`** or **`apt`**):
+2. 一些Python 依赖关系也必须安装 (使用 **`pip`** 或 **`apt`**):
```sh
pip install --user -U empy==3.3.4 pyros-genmsg setuptools
```
-### Setup Micro XRCE-DDS Agent & Client
+### 配置微型 XRCE-DDS 代理与客户端
-For ROS 2 to communicate with PX4, [uXRCE-DDS client](../modules/modules_system.md#uxrce-dds-client) must be running on PX4, connected to a micro XRCE-DDS agent running on the companion computer.
+要实现 ROS 2 与 PX4 的通信,[uXRCE-DDS client](../modules/modules_system.md#uxrce-dds-client)必须在 PX4 上运行,且需与运行在机载计算机上的微型 XRCE-DDS 代理建立连接。
#### 设置代理(Agent)
-The agent can be installed onto the companion computer in a [number of ways](../middleware/uxrce_dds.md#micro-xrce-dds-agent-installation).
+代理可以安装在机载计算机上 [number of ways](../middleware/uxrce_dds.md#micro-xrce-dds-agent-installation)。
Below we show how to build the agent "standalone" from source and connect to a client running on the PX4 simulator.
To setup and start the agent:
@@ -156,7 +156,7 @@ To setup and start the agent:
2. 输入以下命令从仓库获取源代码并构建代理(Agent):
```sh
- git clone -b v2.4.2 https://github.com/eProsima/Micro-XRCE-DDS-Agent.git
+ git clone -b v2.4.3 https://github.com/eProsima/Micro-XRCE-DDS-Agent.git
cd Micro-XRCE-DDS-Agent
mkdir build
cd build
@@ -224,7 +224,6 @@ INFO [uxrce_dds_client] synchronized with time offset 1675929429203524us
INFO [uxrce_dds_client] successfully created rt/fmu/out/failsafe_flags data writer, topic id: 83
INFO [uxrce_dds_client] successfully created rt/fmu/out/sensor_combined data writer, topic id: 168
INFO [uxrce_dds_client] successfully created rt/fmu/out/timesync_status data writer, topic id: 188
-...
```
The micro XRCE-DDS agent terminal should also start to show output, as equivalent topics are created in the DDS network:
@@ -234,7 +233,6 @@ The micro XRCE-DDS agent terminal should also start to show output, as equivalen
[1675929445.268957] info | ProxyClient.cpp | create_publisher | publisher created | client_key: 0x00000001, publisher_id: 0x0DA(3), participant_id: 0x001(1)
[1675929445.269521] info | ProxyClient.cpp | create_datawriter | datawriter created | client_key: 0x00000001, datawriter_id: 0x0DA(5), publisher_id: 0x0DA(3)
[1675929445.270412] info | ProxyClient.cpp | create_topic | topic created | client_key: 0x00000001, topic_id: 0x0DF(2), participant_id: 0x001(1)
-...
```
### Build ROS 2 Workspace
@@ -378,7 +376,7 @@ accelerometer_integral_dt: 4739
#### (Optional) Starting the Translation Node
-
+<0/> <1/>
This example is built with PX4 and ROS2 versions that use the same message definitions.
If you were to use incompatible [message versions](../middleware/uorb.md#message-versioning) you would need to install and run the [Message Translation Node](./px4_ros2_msg_translation_node.md) as well, before running the example:
@@ -607,7 +605,7 @@ The lines below create a publisher to the `SensorCombined` uORB topic, which can
````cpp
private:
- rclcpp::Subscription::SharedPtr subscription_;
+ rclcpp::Subscription::SharedPtr subscription_;
};
```s
@@ -619,7 +617,7 @@ int main(int argc, char *argv[])
std::cout << "Starting sensor_combined listener node..." << std::endl;
setvbuf(stdout, NULL, _IONBF, BUFSIZ);
rclcpp::init(argc, argv);
- rclcpp::spin(std::make_shared());
+ rclcpp::spin(std::make_shared());
rclcpp::shutdown();
return 0;
@@ -835,7 +833,7 @@ where `request_vehicle_command` handles formatting the request and sending it ov
```cpp
void OffboardControl::request_vehicle_command(uint16_t command, float param1, float param2)
{
- auto request = std::make_shared();
+ auto request = std::make_shared();
VehicleCommand msg{};
msg.param1 = param1;
@@ -860,7 +858,7 @@ The response is finally captured asynchronously by the `response_callback` metho
```cpp
void OffboardControl::response_callback(
- rclcpp::Client::SharedFuture future) {
+ rclcpp::Client<0>::SharedFuture future) {
auto status = future.wait_for(1s);
if (status == std::future_status::ready) {
auto reply = future.get()->reply;
@@ -941,17 +939,17 @@ The output will look something like:
```sh
average rate: 248.187
- min: 0.000s max: 0.012s std dev: 0.00147s window: 2724
+min: 0.000s max: 0.012s std dev: 0.00147s window: 2724
average rate: 248.006
- min: 0.000s max: 0.012s std dev: 0.00147s window: 2972
+min: 0.000s max: 0.012s std dev: 0.00147s window: 2972
average rate: 247.330
- min: 0.000s max: 0.012s std dev: 0.00148s window: 3212
+min: 0.000s max: 0.012s std dev: 0.00148s window: 3212
average rate: 247.497
- min: 0.000s max: 0.012s std dev: 0.00149s window: 3464
+min: 0.000s max: 0.012s std dev: 0.00149s window: 3464
average rate: 247.458
- min: 0.000s max: 0.012s std dev: 0.00149s window: 3712
+min: 0.000s max: 0.012s std dev: 0.00149s window: 3712
average rate: 247.485
- min: 0.000s max: 0.012s std dev: 0.00148s window: 3960
+min: 0.000s max: 0.012s std dev: 0.00148s window: 3960
```
### ros2 launch
diff --git a/docs/zh/sensor/sbgecom.md b/docs/zh/sensor/sbgecom.md
index 315365ab74..b8dd1f5141 100644
--- a/docs/zh/sensor/sbgecom.md
+++ b/docs/zh/sensor/sbgecom.md
@@ -84,7 +84,6 @@ To use the sbgECom driver:
If you don't want to have this fallback mechanism, you must disable unwanted sensors.
:::
-
4. If using the sbgECom as an INS, disable EKF2 using [EKF2_EN](../advanced_config/parameter_reference.md#EKF2_EN).
6. Restart PX4.
@@ -96,7 +95,7 @@ IMU data should be published at 200Hz.
All High Performance and Ellipse 3.0 and higher SBG Systems INS can be configured directly from PX4 firmware:
-1. Enable [SBG_CONFIGURATION_EN](../advanced_config/parameter_reference.md#SBG_CONFIGURATION_EN)
+1. Enable [SBG_CONFIGURE_EN](../advanced_config/parameter_reference.md#SBG_CONFIGURE_EN).
2. Provide a JSON file `sbg_settings.json` containing SBG Systems INS settings to be applied in your PX4 board `extras` directory (ex: `boards/px4/fmu-v5/extras`). The settings JSON file will be installed in `/etc/extras/sbg_settings.json` on the board.
@@ -111,7 +110,6 @@ All High Performance and Ellipse 3.0 and higher SBG Systems INS can be configure
:::
3. For testing purpose, it's also possible to modify SBG Systems INS settings on the fly:
-
- By passing a JSON file path as argument when starting sbgecom driver (ex: `sbgecom start -f /fs/microsd/new_sbg_settings.json`)
- By passing a JSON string as argument when starting sbgecom driver: (ex: `sbgecom start -s {"output":{"comA":{"messages":{"airData":"onChange"}}}}`)
diff --git a/docs/zh/sim_sih/index.md b/docs/zh/sim_sih/index.md
index f4896ab8db..b2b2c20c05 100644
--- a/docs/zh/sim_sih/index.md
+++ b/docs/zh/sim_sih/index.md
@@ -65,7 +65,7 @@ These include: [`pwm_out_sim`](../modules/modules_driver.md#pwm-out-sim), [`sens
To check that these are present on your flight controller:
-1. Start QGroundControl.
+1. 启动QGroundControl。
2. Open **Analyze Tools > Mavlink Console**.