New Crowdin translations - zh-CN
Build all targets / Scan for Board Targets (push) Has been cancelled
Build all targets / Build Group [${{ matrix.group }}][${{ matrix.arch == 'nuttx' && 'x86' || 'arm64' }}] (push) Has been cancelled
Build all targets / Upload Artifacts to S3 (push) Has been cancelled
Build all targets / Create Release and Upload Artifacts (push) Has been cancelled
Checks / build (NO_NINJA_BUILD=1 px4_fmu-v5_default) (push) Has been cancelled
Checks / build (NO_NINJA_BUILD=1 px4_sitl_default) (push) Has been cancelled
Checks / build (check_format) (push) Has been cancelled
Checks / build (check_newlines) (push) Has been cancelled
Checks / build (module_documentation) (push) Has been cancelled
Checks / build (px4_fmu-v2_default stack_check) (push) Has been cancelled
Checks / build (px4_sitl_allyes) (push) Has been cancelled
Checks / build (shellcheck_all) (push) Has been cancelled
Checks / build (tests) (push) Has been cancelled
Checks / build (tests_coverage) (push) Has been cancelled
Checks / build (validate_module_configs) (push) Has been cancelled
Clang Tidy / build (push) Has been cancelled
MacOS build / build (px4_fmu-v5_default) (push) Has been cancelled
MacOS build / build (px4_sitl) (push) Has been cancelled
Ubuntu environment build / Build and Test (ubuntu:22.04) (push) Has been cancelled
Ubuntu environment build / Build and Test (ubuntu:24.04) (push) Has been cancelled
Container build / Set Tags and Variables (push) Has been cancelled
Container build / Build Container (amd64) (push) Has been cancelled
Container build / Build Container (arm64) (push) Has been cancelled
Container build / Deploy To Registry (push) Has been cancelled
EKF Update Change Indicator / unit_tests (push) Has been cancelled
Failsafe Simulator Build / build (failsafe_web) (push) Has been cancelled
FLASH usage analysis / Analyzing px4_fmu-v5x (push) Has been cancelled
FLASH usage analysis / Analyzing px4_fmu-v6x (push) Has been cancelled
FLASH usage analysis / Publish Results (push) Has been cancelled
ITCM check / Checking nxp_tropic-community (push) Has been cancelled
ITCM check / Checking px4_fmu-v5x (push) Has been cancelled
ITCM check / Checking px4_fmu-v6xrt (push) Has been cancelled
MAVROS Mission Tests / build (map[mission:MC_mission_box vehicle:iris]) (push) Has been cancelled
MAVROS Mission Tests / build (map[mission:rover_mission_1 vehicle:rover]) (push) Has been cancelled
MAVROS Offboard Tests / build (map[test_file:mavros_posix_tests_offboard_posctl.test vehicle:iris]) (push) Has been cancelled
Nuttx Target with extra env config / build (px4_fmu-v5_default) (push) Has been cancelled
Python CI Checks / build (push) Has been cancelled
ROS Integration Tests / build (push) Has been cancelled
ROS Translation Node Tests / Build and test (map[ros_version:humble ubuntu:jammy]) (push) Has been cancelled
ROS Translation Node Tests / Build and test (map[ros_version:jazzy ubuntu:noble]) (push) Has been cancelled
SITL Tests / Testing PX4 tailsitter (push) Has been cancelled
SITL Tests / Testing PX4 iris (push) Has been cancelled
SITL Tests / Testing PX4 standard_vtol (push) Has been cancelled
ClusterFuzzLite batch fuzzing / BatchFuzzing (address) (push) Has been cancelled
ClusterFuzzLite batch fuzzing / BatchFuzzing (memory) (push) Has been cancelled
ClusterFuzzLite batch fuzzing / BatchFuzzing (undefined) (push) Has been cancelled

This commit is contained in:
Crowdin Bot
2025-07-06 00:15:00 +00:00
committed by Hamish Willee
parent 8aecc7e588
commit 588fd9d684
163 changed files with 796 additions and 674 deletions
+22 -20
View File
@@ -35,15 +35,13 @@ sudo usermod -aG docker $USER
# Log in/out again before using docker!
```
<a id="px4_containers"></a>
## Container Hierarchy {#px4_containers}
## 本地编辑层次结构
The available containers are on [Github here](https://github.com/PX4/PX4-containers/tree/master?tab=readme-ov-file#container-hierarchy).
The available containers are on [GitHub here](https://github.com/PX4/PX4-containers/tree/master?tab=readme-ov-file#container-hierarchy).
使用容器的最简单方法是通过 <a href="https://github.com/PX4/Firmware/blob/master/Tools/docker_run.sh">docker_run.sh</a> 帮助程序脚本。
The containers are hierarchical, such that containers have the functionality of their parents.
For example, the partial hierarchy below shows that the docker container with nuttx build tools (`px4-dev-nuttx-focal`) does not include ROS 2, while the simulation containers do:
For example, the partial hierarchy below shows that the docker container with NuttX build tools (`px4-dev-nuttx-focal`) does not include ROS 2, while the simulation containers do:
```plain
- px4io/px4-dev-base-focal
@@ -58,7 +56,7 @@ For example, the partial hierarchy below shows that the docker container with nu
The most recent version can be accessed using the `latest` tag: `px4io/px4-dev-nuttx-focal:latest`
(available tags are listed for each container on _hub.docker.com_.
For example, the `px4io/px4-dev-nuttx-focal` tags can be found [here](https://hub.docker.com/r/px4io/px4-dev-nuttx-focal/tags?page=1&ordering=last_updated)).
For example, the `px4io/px4-dev-nuttx-focal` tags can be found on [hub.docker.com here](https://hub.docker.com/r/px4io/px4-dev-nuttx-focal/tags?page=1&ordering=last_updated)).
:::tip
Typically you should use a recent container, but not necessarily the `latest` (as this changes too often).
@@ -97,9 +95,7 @@ sudo ./Tools/docker_run.sh 'bash'
The script is easy because you don't need to know anything much about _Docker_ or think about what container to use. 要重新进入此容器(将保留您的更改),只需执行以下操作: The manual approach discussed in the [section below](#manual_start) is more flexible and should be used if you have any problems with the script.
:::
<a id="manual_start"></a>
### 手动调用 Docker
### Calling Docker Manually {#manual_start}
The syntax of a typical command is shown below.
This runs a Docker container that has support for X forwarding (makes the simulation GUI available from inside the container).
@@ -163,7 +159,8 @@ make px4_sitl_default gazebo-classic
### 重新进入容器
The `docker run` command can only be used to create a new container. To get back into this container (which will retain your changes) simply do:
The `docker run` command can only be used to create a new container.
To get back into this container (which will retain your changes) simply do:
```sh
# start the container
@@ -192,9 +189,14 @@ docker rm 45eeb98f1dd9
### QGroundControl
When running a simulation instance e.g. SITL inside the docker container and controlling it via _QGroundControl_ from the host, the communication link has to be set up manually. The autoconnect feature of _QGroundControl_ does not work here.
When running a simulation instance e.g. SITL inside the docker container and controlling it via _QGroundControl_ from the host, the communication link has to be set up manually.
The autoconnect feature of _QGroundControl_ does not work here.
In _QGroundControl_, navigate to [Settings](https://docs.qgroundcontrol.com/master/en/qgc-user-guide/settings_view/settings_view.html) and select Comm Links. Create a new link that uses the UDP protocol. The port depends on the used [configuration](https://github.com/PX4/PX4-Autopilot/blob/main/ROMFS/px4fmu_common/init.d-posix/rcS) e.g. port 14570 for the SITL config. The IP address is the one of your docker container, usually 172.17.0.1/16 when using the default network. The IP address of the docker container can be found with the following command (assuming the container name is `mycontainer`):
In _QGroundControl_, navigate to [Settings](https://docs.qgroundcontrol.com/master/en/qgc-user-guide/settings_view/settings_view.html) and select Comm Links.
Create a new link that uses the UDP protocol.
The port depends on the used [configuration](https://github.com/PX4/PX4-Autopilot/blob/main/ROMFS/px4fmu_common/init.d-posix/rcS) e.g. port 14570 for the SITL config.
The IP address is the one of your docker container, usually 172.17.0.1/16 when using the default network.
The IP address of the docker container can be found with the following command (assuming the container name is `mycontainer`):
```sh
$ docker inspect -f '{ {range .NetworkSettings.Networks}}{ {.IPAddress}}{ {end}}' mycontainer
@@ -208,9 +210,11 @@ Spaces between double curly braces above should be not be present (they are need
#### 权限错误
The container creates files as needed with a default user - typically "root". This can lead to permission errors where the user on the host computer is not able to access files created by the container.
The container creates files as needed with a default user - typically "root".
This can lead to permission errors where the user on the host computer is not able to access files created by the container.
The example above uses the line `--env=LOCAL_USER_ID="$(id -u)"` to create a user in the container with the same UID as the user on the host. This ensures that all files created within the container will be accessible on the host.
The example above uses the line `--env=LOCAL_USER_ID="$(id -u)"` to create a user in the container with the same UID as the user on the host.
This ensures that all files created within the container will be accessible on the host.
#### 图形驱动问题
@@ -220,17 +224,15 @@ It's possible that running Gazebo Classic will result in a similar error message
libGL error: failed to load driver: swrast
```
In that case the native graphics driver for your host system must be installed. Download the right driver and install it inside the container. For Nvidia drivers the following command should be used (otherwise the installer will see the loaded modules from the host and refuse to proceed):
In that case the native graphics driver for your host system must be installed.
Download the right driver and install it inside the container.
For Nvidia drivers the following command should be used (otherwise the installer will see the loaded modules from the host and refuse to proceed):
```sh
./NVIDIA-DRIVER.run -a -N --ui=none --no-kernel-module
```
More information on this can be found [here](http://gernotklingler.com/blog/howto-get-hardware-accelerated-opengl-support-docker/).
<a id="virtual_machine"></a>
## 虚拟机支持
## Virtual Machine Support {#virtual_machine}
尝试禁用并行构建。
@@ -162,4 +162,4 @@ About to run 39 test cases for 3 selected models (1 iteration):
Terms used:
- "model": This is the selected Gazebo model, e.g. `iris`.
- "test case": This is a [catch2 test case](https://github.com/catchorg/Catch2/blob/master/docs/test-cases-and-sections.md).
- "test case": This is a [catch2 test case](https://github.com/catchorg/Catch2/blob/devel/docs/test-cases-and-sections.md).
@@ -59,7 +59,7 @@ The **.test** files launch the corresponding Python tests defined in `integratio
This section explains how to write a new python test using ROS 1/MAVROS, test it, and add it to the PX4 test suite.
We recommend you review the existing tests as examples/inspiration ([integrationtests/python_src/px4_it/mavros/](https://github.com/PX4/PX4-Autopilot/tree/main/integrationtests/python_src/px4_it/mavros)).
The official ROS documentation also contains information on how to use [unittest](http://wiki.ros.org/unittest) (on which this test suite is based).
The official ROS documentation also contains information on how to use [unittest](https://wiki.ros.org/unittest) (on which this test suite is based).
To write a new test:
@@ -117,25 +117,23 @@ To write a new test:
```
2. Run the new test only
- Start the simulator:
```sh
cd <PX4-Autopilot_clone>
source Tools/simulation/gazebo/setup_gazebo.bash
roslaunch launch/mavros_posix_sitl.launch
```
```sh
cd <PX4-Autopilot_clone>
source Tools/simulation/gazebo/setup_gazebo.bash
roslaunch launch/mavros_posix_sitl.launch
```
- Run test (in a new shell):
```sh
cd <PX4-Autopilot_clone>
source Tools/simulation/gazebo/setup_gazebo.bash
rosrun px4 mavros_new_test.py
```
```sh
cd <PX4-Autopilot_clone>
source Tools/simulation/gazebo/setup_gazebo.bash
rosrun px4 mavros_new_test.py
```
3. Add new test node to a launch file
- In `test/` create a new `<test_name>.test` ROS launch file.
- Call the test file using one of the base scripts _rostest_px4_run.sh_ or _rostest_avoidance_run.sh_