New Crowdin translations - zh-CN (#25782)

Co-authored-by: Crowdin Bot <support+bot@crowdin.com>
This commit is contained in:
PX4 Build Bot
2025-10-22 15:37:56 +11:00
committed by GitHub
co-authored by Crowdin Bot
parent e0fcc329a3
commit d2548ced9d
35 changed files with 750 additions and 156 deletions
+24 -24
View File
@@ -248,7 +248,7 @@ private:
};
```
- `[1]`: 首先创建一个从 [`px4_ros2:::ModeBase`](https://auterion.github.io/px4-ros2-interface-lib/classpx4__ros2_1_1ModeBase.html)继承的类。
- `[1]`: 首先创建一个从 [`px4_ros2::ModeBase`](https://auterion.github.io/px4-ros2-interface-lib/classpx4__ros2_1_1ModeBase.html)继承的类。
- `[2]`: 在构造函数中,我们传递模式名称。 这也使我们能够配置一些其他内容,例如替换飞行控制器的内置模式。
- `[3]`:我们在此处创建后续想要使用的所有对象。
这可以是 RC 输入、设置点类型(s)或遥测数据。 `*this` 作为`Context`传递给每个对象,将对象与模式联系起来。
@@ -347,7 +347,7 @@ private:
- [MulticopterGotoSetpointType](#go-to-setpoint-multicoptergotosetpointtype): <Badge type="warning" text="MC only" /> 平滑的位置控制以及(可选的)航向控制
- [FwLateralLongitudinalSetpointType](#fixed-wing-lateral-and-longitudinal-setpoint-fwlaterallongitudinalsetpointtype): <Badge type="warning" text="FW only" /> <Badge type="tip" text="main (planned for: PX4 v1.17)" /> 对横向和纵向固定翼动态的直接控制
- [DirectActuatorsSetpointType](#direct-actuator-control-setpoint-directactuatorssetpointtype):直接控制发动机和飞行地面servo setpoints
- [Rover Setpoints](#rover-setpoints): <Badge type="tip" text="main (planned for: PX4 v1.17)" /> Direct access to rover control setpoints (Position, Speed, Attitude, Rate, Throttle and Steering).
- [Rover Setpoints](#rover-setpoints): <Badge type="tip" text="main (planned for: PX4 v1.17)" />直接访问火星车控制设定值(位置、速度、姿态、速率、油门和转向)。
:::tip
其他设置点类型目前是实验性的,可在以下网址找到:[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)。
@@ -365,10 +365,10 @@ private:
当前,此设定点类型仅支持多旋翼飞行器。
:::
可通过[`px4_ros2::MulticopterGotoSetpointType`](https://github.com/Auterion/px4-ros2-interface-lib/blob/main/px4_ros2_cpp/include/px4_ros2/control/setpoint_types/multicopter/goto.hpp)设定点类型,对位置设定点以及(可选的)航向设定点进行平滑控制。
可通过[`px4_ros2::MulticopterGotoSetpointType`](https://github.com/Auterion/px4-ros2-interface-lib/blob/main/px4_ros2_cpp/include/px4_ros2/control/setpoint_types/multicopter/goto.hpp) 设定点类型,对位置设定点以及(可选的)航向设定点进行平滑控制。
设定点类型会被传输至飞控主模块(FMU),该模块基于采用时间最优、最大加加速度轨迹构建的位置及航向平滑器。
还有一个 [\`px4_ros2::MulticopterGotoGlobalSetpootType'(https://github.com/Auterion/px4-ros2-interface-lib/blob/main/px4_ros2_cpp/include/px4_ros2/control/setpoint_types/multicopter/goto.hpp), 该类支持在全局坐标系下发送设定点。
还有一个 [`px4_ros2::MulticopterGotoGlobalSetpointType`](https://github.com/Auterion/px4-ros2-interface-lib/blob/main/px4_ros2_cpp/include/px4_ros2/control/setpoint_types/multicopter/goto.hpp), 该类支持在全局坐标系下发送设定点。
最简单的用法就是直接向update method中输入一个3D 位置
@@ -421,7 +421,7 @@ _goto_setpoint->update(
:::
使用[`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),该模块会对横向与纵向输入进行解耦处理,同时确保不超出飞行器的各项限制范围。
这个设置点被传输到 PX4 [_FwLateralLongitudinalControl_ module](../modules/modules_controller.md#fw-lat-lon-control),该模块会对横向与纵向输入进行解耦处理,同时确保不超出飞行器的各项限制范围。
为了控制载具,必须提供至少一个横向**和**一个纵向设定值:
@@ -513,7 +513,7 @@ _fw_lateral_longitudinal_sett->upate(settpoint_
##### 高级配置(可选)
你还可以传递一个[`FwControlConfiguration`](https://auterion.github.io/px4-ros2-interface-lib/structpx4__ros2_1_1FwControlConfiguration.html) 结构体以及设定值,以覆盖默认的控制器设置和约束条件,例如俯仰角限制、油门限制以及目标下降 / 爬升速率。
你还可以传递一个[`FwControlConfiguration`](https://auterion.github.io/px4-ros2-interface-lib/structpx4__ros2_1_1FwControlConfiguration.html)结构体以及设定值,以覆盖默认的控制器设置和约束条件,例如俯仰角限制、油门限制以及目标下降 / 爬升速率。
这是针对高级用户的:
```cpp
@@ -535,44 +535,44 @@ _fw_lateral_longitudinal_setpoint->update(setpoint_s, config_s);
所有配置字段都定义为 `std::optional<float>`。
未设置的值将默认采用 PX4 的配置。
更多关于配置选项的信息,请参阅 [LateralControlConfiguration](../msg_docs/LateralControlConfiguration.md) 和 [FixedWingLongitudinalConfiguration](../msg_docs/LongitudinalControlConfiguration.md)。
更多关于配置选项的信息,请参阅 [LateralControlConfiguration](../msg_docs/LateralControlConfiguration.md)和 [FixedWingLongitudinalConfiguration](../msg_docs/LongitudinalControlConfiguration.md)。
:::info
为保障安全,PX4 会自动将配置值限制在飞行器的约束范围内。
例如,油门覆盖值会被限制在[`FW_THR_MIN`](../advanced_config/parameter_reference.md#FW_THR_MIN)
和 [`FW_THR_MAX`](../advanced_config/parameter_reference.md#FW_THR_MAX)之间。
例如,油门覆盖值会被限制在 [`FW_THR_MIN`](../advanced_config/parameter_reference.md#FW_THR_MIN)
和[`FW_THR_MAX`](../advanced_config/parameter_reference.md#FW_THR_MAX)之间。
:::
#### 直接执行器控制设定点(DirectActuatorsSetpointType)
可以使用 [px4_ros2::DirectActActorsSetpootType](https://auterion.github.io/px4-ros2-interface-lib/classpx4__ros2_1_1DirectActuatorsSetpointType.html) 设置点类型直接控制执行器。
可以使用 [px4_ros2::DirectActuatorsSetpointType](https://auterion.github.io/px4-ros2-interface-lib/classpx4__ros2_1_1DirectActuatorsSetpointType.html) 设置点类型直接控制执行器。
电机和舵机可独立设置。
请注意,该分配(设置 / 指派)具有载具和配置特定性。
例如,要控制一架四旋翼飞行器,你需要根据其 [输出配置] (../concept/control_allocation.md )来设置前 4 个电机。
例如,要控制一架四旋翼飞行器,你需要根据其 [输出配置] (../concept/control_allocation.md)来设置前 4 个电机。
:::info
若你想控制的执行器并非用于控制飞行器的运动(例如,而是用于控制有效载荷舵机),请参阅 [below](#controlling-an-independent-actuator-servo)。
:::
#### Rover Setpoints
#### Rover 设置点
<Badge type="tip" text="main (planned for: PX4 v1.17)" /> <Badge type="warning" text="Experimental" />
The rover modules use a hierarchical structure to propagate setpoints:
滚动模块使用层次结构来传播设置点:
![Rover Control Structure](../../assets/middleware/ros2/px4_ros2_interface_lib/rover_control_structure.svg)
:::info
The "highest" setpoint that is provided will be used within the PX4 rover modules to generate the setpoints that are below it (Overriding them!).
With this hierarchy there are clear rules for providing a valid control input:
所提供的“highest”设定值将被用于 PX4 机器人模块中,以生成低于该值的设定值(并对其进行覆盖!)。
这个层次结构有提供有效控制输入的明确规则:
- Provide a position setpoint, **or**
- One of the setpoints on the "left" (speed **or** throttle) **and** one of the setpoints on the "right" (attitude, rate **or** steering). All combinations of "left" and "right" setpoints are valid.
- 提供一个位置集点,**or**
- “左”上的设置点之一(速度 **或** 节点) **和** “右”上的设置点之一(态度、速率 **或** 节点)。 所有“左”和“右”设置点的组合都是有效的。
For ease of use we expose these valid combinations as new SetpointTypes.
为了便于使用,我们以新的 SettpointType 的形式揭示这些有效的组合。
:::
The RoverSetpointTypes exposed through the control interface are combinations of these setpoints that lead to a valid control input:
通过控制界面暴露的 RoverSetpointTypes 是这些设置点的组合,导致有效的控制输入:
| SetpointType | 安装位置 | Speed | 油门 | Attitude | 频率 | Steering | Control Flags |
| ----------------------------------------------------------------------------------------------------------------------------------- | --------------------------- | ------------------------------------------------ | ------------------------------------------------ | ------------------------------------------------ | ------------------------------------------------ | ------------------------------------------------ | ------------------------------------------------------ |
@@ -584,9 +584,9 @@ The RoverSetpointTypes exposed through the control interface are combinations of
| [RoverThrottleRate](https://auterion.github.io/px4-ros2-interface-lib/classpx4__ros2_1_1RoverThrottleRateSetpointType.html) | | | &check; | | &check; | (&check;) | Rate, Control Allocation |
| [RoverThrottleSteering](https://auterion.github.io/px4-ros2-interface-lib/classpx4__ros2_1_1RoverThrottleSteeringSetpointType.html) | | | &check; | | | &check; | Control Allocation |
&check; are the setpoints we publish, and (&check;) are generated internally by the PX4 rover modules according to the hierarchy above.
&check; 是我们发布的设置点,(&check;) 是根据上面的层次结构由 PX4 旋转模块内部生成的。
An example for a rover specific drive mode using the `RoverSpeedAttitudeSetpointType` is provided [here](https://github.com/Auterion/px4-ros2-interface-lib/tree/main/examples/cpp/modes/rover_velocity).
使用 `RoverSpeedAttitude SettpointType` 的特定驱动器模式示例为 [here](https://github.com/Auterion/px4-ros2-interface-lib/tree/main/examples/cpp/modes/rover_velocity)。
### 控制VTOL
@@ -594,8 +594,8 @@ An example for a rover specific drive mode using the `RoverSpeedAttitudeSetpoint
要在外部飞行模式下控制VTOL,需确保根据当前飞行配置返回正确的设定值类型:
- 多旋翼模式:使用与多旋翼控制兼容的设定值类型。 例如:要么[`MulticopterGotoSetpootType`](#go-to-setpoint-multicoptergotosetpointtype) 要么[`TrattorySettpointType`](https://auterion.github.io/px4-ros2-interface-lib/classpx4__ros2_1_1TrajectorySetpointType.html)。
- 固定翼形模式:使用 [`FwLateralLongitudinalSetpointType` ](#fixed-wing-lateral-and-longitudinal-setpoint-fwlaterallongitudinalsetpointtype)。
- 多旋翼模式:使用与多旋翼控制兼容的设定值类型。 例如:要么[`MulticopterGotoSetpointType`](#go-to-setpoint-multicoptergotosetpointtype)要么[`TrajectorySetpointType`](https://auterion.github.io/px4-ros2-interface-lib/classpx4__ros2_1_1TrajectorySetpointType.html)。
- 固定翼形模式:使用 [`FwLateralLongitudinalSetpointType`](#fixed-wing-lateral-and-longitudinal-setpoint-fwlaterallongitudinalsetpointtype)。
只要VTOL在整个外部模式期间始终处于多旋翼模式或固定翼模式中的任意一种,就无需额外处理。
@@ -630,7 +630,7 @@ An example for a rover specific drive mode using the `RoverSpeedAttitudeSetpoint
要查询载具的当前状态,可在 px4_ros2::VTOL 对象上调用 getCurrentState() 方法。
请参阅[此外部飞行模式实现](https://github.com/Auterion/px4-ros2-interface-lib/tree/main/examples/cpp/modes/vtol)有关如何使用此 API 的实际示例。
请参阅[此外部飞行模式实现](https://github.com/Auterion/px4-ros2-interface-lib/tree/main/examples/cpp/modes/vtol) 有关如何使用此 API 的实际示例。
### 控制独立执行器/Servo
+1 -1
View File
@@ -36,7 +36,7 @@ There are some benefits and drawbacks to using ROS-based missions, which are pro
- QGroundControl currently does not display the mission or progress during execution, and cannot upload or download a mission.
Therefore you will need another mechanism to provide a mission, such as from a web server, a custom GCS, or by generating it directly inside the application.
- The current implementation only supports multicopters (it uses the [GotoSetpointType](../ros2/px4_ros2_control_interface.md#go-to-setpoint-gotosetpointtype), which only works for multicopters, and VTOL in MC mode).
- The current implementation only supports multicopters (it uses the [GotoSetpointType](../ros2/px4_ros2_control_interface.md#go-to-setpoint-multicoptergotosetpointtype), which only works for multicopters, and VTOL in MC mode).
It is designed to be extendable to any other vehicle type.
## 综述
+9 -9
View File
@@ -9,7 +9,7 @@ ROS 2-PX4 架构在ROS 2和PX4之间进行了深度整合。 允许 ROS 2 订阅
[migration guide](../middleware/uxrce_dds.md#fast-rtps-to-uxrce-dds-migration-guidelines) 解释您需要做什么来将ROS2 应用程序从 PX4 v1.13 迁移到 PX4 v1.14。
如果您仍然在 PX4 v1.13 上工作,请按照[PX4 v1.13 文档](https://docs.px4.io/v1.13/en/ros/ros2_comm.html)中的说明操作。
如果您仍然在 PX4 v1.13 上工作,请按照[PX4 v1.13 Docs](https://docs.px4.io/v1.13/en/ros/ros2_comm.html)中的说明操作。
<!-- remove this when there are PX4 v1.14 docs for some months -->
@@ -17,17 +17,17 @@ ROS 2-PX4 架构在ROS 2和PX4之间进行了深度整合。 允许 ROS 2 订阅
## 综述
得益于 uXRCE-DDS(../middleware/uxrce_dds.md) 通信中间件的使用,ROS 2 的应用流程非常简单直接。
得益于 [uXRCE-DDS](../middleware/uxrce_dds.md) 通信中间件的使用,ROS 2 的应用流程非常简单直接。
![Architecture uXRCE-DDS with ROS 2](../../assets/middleware/xrce_dds/architecture_xrce-dds_ros2.svg)
<!-- doc source: https://docs.google.com/drawings/d/1WcJOU-EcVOZRPQwNzMEKJecShii2G4U3yhA3U6C4EhE/edit?usp=sharing -->
uXRCE-DDS 中间件由两部分组成:一部分是运行在 PX4 上的客户端,另一部分是运行在伴飞计算机上的代理;二者之间通过串口、UDP、TCP或自定义链路进行双向数据交换。
uXRCE-DDS 中间件由两部分组成:一部分是运行在 PX4 上的客户端,另一部分是运行在机载计算机上的代理;二者之间通过串口、UDP、TCP或自定义链路进行双向数据交换。
代理充当客户端的代理角色,以便在全局 DDS 数据空间中发布和订阅主题。
PX4 [uxrce_dds_client](../modules/modules_system.md#uxrce-dds-client) 是在构建时生成,并且默认包含在 PX4 固件中。
它包含“通用”XRCE-DDS客户端代码和它用来发布到/来自uORB主题的 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 消息的代码。
@@ -38,7 +38,7 @@ ROS 2 应用程序需要在一个工作空间中构建,该工作空间需包
这需要[ROS 2 Message Translation Node](../ros2/px4_ros2_msg_translation_node.md)运行ROS 2 消息转换节点,以确保消息能够正确转换和交互。
需要注意的是,微型XRCE-DDS _agent_ 本身并不依赖客户端代码。
它可以从 [source](https://github.com/eProsima/Micro-XRCE-DDS-Agent)中单独构建,或者作为ROS构建的一部分,或者作为snap包安装。
它可以从 [source](https://github.com/eProsima/Micro-XRCE-DDS-Agent) 中单独构建,或者作为ROS构建的一部分,或者作为snap包安装。
在使用 ROS 2 时,您通常需要同时启动客户端和代理。
需要注意的是,uXRCE-DDS 客户端默认已内置到固件中,但除仿真器构建版本外,不会自动启动。
@@ -72,7 +72,7 @@ ROS 2 应用程序需要在一个工作空间中构建,该工作空间需包
若要使用该仿真器,你需要安装 PX4 开发工具链。
:::info
唯一依赖于ROS2的 PX4 是一组信息定义,它从 [px4_msgs](https://github.com/PX4/px4_msgs)获取。
唯一依赖于ROS2的 PX4 是一组信息定义,它从[px4_msgs](https://github.com/PX4/px4_msgs)获取。
您只需要安装 PX4 当您需要模拟器时(如我们在本指南中所做的那样), 或者如果您正在创建一个发布自定义uORB主题的构建。
:::
@@ -313,7 +313,7 @@ px4_msgs 代码仓库中的分支均以特定名称命名,这些名称与不
换句话说,它会让刚刚构建好的可执行文件在当前终端中可用。
:::info
[ROS2 beginner tutorials](https://docs.ros.org/en/humble/Tutorials/Beginner-Client-Libraries/Creating-A-Workspace/Creating-A-Workspace.html#source-the-overlay)建议您 _open a new terminal_来运行您的可执行文件。
[ROS2 初学者教程](https://docs.ros.org/en/humble/Tutorials/Beginner-Client-Libraries/Creating-A-Workspace/Creating-A-Workspace.html#source-the-overlay)建议您_打开一个新的终端来运行您的可执行文件。
:::
在新终端中:
@@ -493,7 +493,7 @@ uXRCE-DDS 客户端的时间同步器随后会将 ROS 2 端的操作系统时钟
#### ROS2 节点使用 Gazebo 时钟作为时间源
在这种情况下,ROS2还使用Gazebo\`/时钟主题作为时间来源。
若 Gazebo 仿真的实时因子(real time factor)不为 1,或 ROS 2 需直接与 Gazebo 交互,则该方法具有合理性。
若 Gazebo 仿真的实时因子不为 1,或 ROS 2 需直接与 Gazebo 交互,则该方法具有合理性。
在 ROS 2 端,可通过[ros_gz](https://github.com/gazebosim/ros_gz)代码仓库中的[ros_gz_bridge](https://github.com/gazebosim/ros_gz) 功能包,实现与 Gazebo 的直接交互。
请使用以下命令,为 PX4 所支持的 ROS 2 和 Gazebo 版本安装正确的 ROS 2/gz 接口功能包(不仅限于桥接功能包)。
@@ -512,7 +512,7 @@ sudo apt install ros-humble-ros-gzharmonic
:::tab foxy
首先,您需要 [install Gazebo Garden](../sim_gazebo_gz/index.md#installation-ubuntu-linux),因为默认情况下,Foxy预装的是 Gazebo Classic 11 <!-- note, garden is EOL Nov 2024 -->
接下来,若要在 Ubuntu 20.04 系统上安装用于搭配 ROS 2 "Foxy"与 Gazebo的接口功能包,操作如下:
接下来,若要在 Ubuntu 20.04 系统上安装用于搭配 ROS 2 "Foxy"与 Gazebo的桥接功能包,操作如下:
```sh
sudo apt install ros-foxy-ros-gzgarden