mirror of
https://github.com/PX4/PX4-Autopilot.git
synced 2026-05-27 02:06:27 +08:00
New Crowdin translations - zh-CN
This commit is contained in:
committed by
Hamish Willee
parent
71e553c67e
commit
a19d6e4f6e
@@ -128,21 +128,21 @@ You add some "boilerplate" code to regularly listen for changes in the [uORB Top
|
|||||||
|
|
||||||
- **px4_platform_common/module_params.h** to get the `DEFINE_PARAMETERS` macro:
|
- **px4_platform_common/module_params.h** to get the `DEFINE_PARAMETERS` macro:
|
||||||
|
|
||||||
```cpp
|
```cpp
|
||||||
#include <px4_platform_common/module_params.h>
|
#include <px4_platform_common/module_params.h>
|
||||||
```
|
```
|
||||||
|
|
||||||
- **parameter_update.h** to access the uORB `parameter_update` message:
|
- **parameter_update.h** to access the uORB `parameter_update` message:
|
||||||
|
|
||||||
```cpp
|
```cpp
|
||||||
#include <uORB/topics/parameter_update.h>
|
#include <uORB/topics/parameter_update.h>
|
||||||
```
|
```
|
||||||
|
|
||||||
- **Subscription.hpp** for the uORB C++ subscription API:
|
- **Subscription.hpp** for the uORB C++ subscription API:
|
||||||
|
|
||||||
```cpp
|
```cpp
|
||||||
#include <uORB/Subscription.hpp>
|
#include <uORB/Subscription.hpp>
|
||||||
```
|
```
|
||||||
|
|
||||||
Derive your class from `ModuleParams`, and use `DEFINE_PARAMETERS` to specify a list of parameters and their associated parameter attributes.
|
Derive your class from `ModuleParams`, and use `DEFINE_PARAMETERS` to specify a list of parameters and their associated parameter attributes.
|
||||||
参数的名称必须与其参数元数据定义相同。
|
参数的名称必须与其参数元数据定义相同。
|
||||||
@@ -194,7 +194,7 @@ void Module::parameters_update()
|
|||||||
- `_parameter_update_sub.updated()` tells us if there is _any_ update to the `param_update` uORB message (but not what parameter is affected).
|
- `_parameter_update_sub.updated()` tells us if there is _any_ update to the `param_update` uORB message (but not what parameter is affected).
|
||||||
- If there has been "some" parameter updated, we copy the update into a `parameter_update_s` (`param_update`), to clear the pending update.
|
- If there has been "some" parameter updated, we copy the update into a `parameter_update_s` (`param_update`), to clear the pending update.
|
||||||
- Then we call `ModuleParams::updateParams()`.
|
- Then we call `ModuleParams::updateParams()`.
|
||||||
This "under the hood" updates all parameter attributes listed in our `DEFINE_PARAMETERS` list.
|
This "under the hood" updates all parameter attributes listed in our `DEFINE_PARAMETERS` list.
|
||||||
|
|
||||||
The parameter attributes (`_sys_autostart` and `_att_bias_max` in this case) can then be used to represent the parameters, and will be updated whenever the parameter value changes.
|
The parameter attributes (`_sys_autostart` and `_att_bias_max` in this case) can then be used to represent the parameters, and will be updated whenever the parameter value changes.
|
||||||
|
|
||||||
@@ -267,12 +267,12 @@ YAML meta data is intended as a full replacement for the **.c** definitions.
|
|||||||
- An example of YAML definitions being used can be found in the MAVLink parameter definitions: [/src/modules/mavlink/module.yaml](https://github.com/PX4/PX4-Autopilot/blob/main/src/modules/mavlink/module.yaml).
|
- An example of YAML definitions being used can be found in the MAVLink parameter definitions: [/src/modules/mavlink/module.yaml](https://github.com/PX4/PX4-Autopilot/blob/main/src/modules/mavlink/module.yaml).
|
||||||
- 通过添加到 cmake 构建系统中注册一个 YAML 文件
|
- 通过添加到 cmake 构建系统中注册一个 YAML 文件
|
||||||
|
|
||||||
```cmake
|
```cmake
|
||||||
MODULE_CONFIG
|
MODULE_CONFIG
|
||||||
module.yaml
|
module.yaml
|
||||||
```
|
```
|
||||||
|
|
||||||
to the `px4_add_module` section of the `CMakeLists.txt` file of that module.
|
to the `px4_add_module` section of the `CMakeLists.txt` file of that module.
|
||||||
|
|
||||||
#### 多实例(模块化)YAML 元数据
|
#### 多实例(模块化)YAML 元数据
|
||||||
|
|
||||||
|
|||||||
@@ -20,7 +20,7 @@ This guide walks through the process of setting up the board and connecting to P
|
|||||||
You will temporarily need the following hardware in order to log into your Jetson and get its IP address, after which you will be able to log in via SSH:
|
You will temporarily need the following hardware in order to log into your Jetson and get its IP address, after which you will be able to log in via SSH:
|
||||||
|
|
||||||
- External display.
|
- External display.
|
||||||
If your display doesn't have a mini HDMI connector you will also need a [Mini HDMI to HDMI converter](https://a.co/d/6N815N9) if your external display has HDMI input
|
If your display doesn't have a mini HDMI connector you will also need a [Mini HDMI to HDMI converter](https://a.co/d/6N815N9) if your external display has HDMI input
|
||||||
- Ethernet cable
|
- Ethernet cable
|
||||||
- Mouse and keyboard (the baseboard has 4 USB ports exposed from Jetson, two of which are USB 3.0)
|
- Mouse and keyboard (the baseboard has 4 USB ports exposed from Jetson, two of which are USB 3.0)
|
||||||
|
|
||||||
@@ -45,11 +45,11 @@ This information comes from the [Holybro Pixhawk-Jetson Baseboard Documentation]
|
|||||||
|
|
||||||
- 尺寸
|
- 尺寸
|
||||||
|
|
||||||
- 126 x 80 x 45mm (with Jetson Orin NX + Heatsink/Fan & FC Module)
|
- 126 x 80 x 45mm (with Jetson Orin NX + Heatsink/Fan & FC Module)
|
||||||
- 126 x 80 x 22.9mm (without Jetson and FC Module)
|
- 126 x 80 x 22.9mm (without Jetson and FC Module)
|
||||||
|
|
||||||
- 重量
|
- 重量
|
||||||
- 190g (with Jetson, Heatsink, Flight Controller, M.2 SSD, M.2 Wi-Fi Module)
|
- 190g (with Jetson, Heatsink, Flight Controller, M.2 SSD, M.2 Wi-Fi Module)
|
||||||
|
|
||||||
:::
|
:::
|
||||||
|
|
||||||
@@ -57,67 +57,67 @@ This information comes from the [Holybro Pixhawk-Jetson Baseboard Documentation]
|
|||||||
|
|
||||||
- 2x Gigabit Ethernet Port
|
- 2x Gigabit Ethernet Port
|
||||||
|
|
||||||
- Connected to both Jetson & Autopilot via Ethernet switch (RTL8367S)
|
- Connected to both Jetson & Autopilot via Ethernet switch (RTL8367S)
|
||||||
- Ethernet Switch powered by the same circuit as the Pixhawk
|
- Ethernet Switch powered by the same circuit as the Pixhawk
|
||||||
- 8-pin JST-GH
|
- 8-pin JST-GH
|
||||||
- RJ45
|
- RJ45
|
||||||
|
|
||||||
- 2x MIPI CSI Camera Inputs
|
- 2x MIPI CSI Camera Inputs
|
||||||
|
|
||||||
- 4 Lanes each
|
- 4 Lanes each
|
||||||
- 22-Pin Raspberry Pi Cam FFC
|
- 22-Pin Raspberry Pi Cam FFC
|
||||||
|
|
||||||
- 2x USB 3.0 Host Port
|
- 2x USB 3.0 Host Port
|
||||||
|
|
||||||
- USB A
|
- USB A
|
||||||
- 5A Current Limit
|
- 5A Current Limit
|
||||||
|
|
||||||
- 2x USB 2.0 Host Port
|
- 2x USB 2.0 Host Port
|
||||||
|
|
||||||
- 5-Pin JST-GH
|
- 5-Pin JST-GH
|
||||||
- 0A Current Limit
|
- 0A Current Limit
|
||||||
|
|
||||||
- USB 2.0 for Programming/Debugging
|
- USB 2.0 for Programming/Debugging
|
||||||
|
|
||||||
- USB-C
|
- USB-C
|
||||||
|
|
||||||
- 2 Key M 2242/2280 for NVMe SSD
|
- 2 Key M 2242/2280 for NVMe SSD
|
||||||
|
|
||||||
- PCIEx4
|
- PCIEx4
|
||||||
|
|
||||||
- 2 Key E 2230 for WiFi/BT
|
- 2 Key E 2230 for WiFi/BT
|
||||||
|
|
||||||
- PCIEx2
|
- PCIEx2
|
||||||
- USB
|
- USB
|
||||||
- UART
|
- UART
|
||||||
- I2S
|
- I2S
|
||||||
|
|
||||||
- Mini HDMI Out
|
- Mini HDMI Out
|
||||||
|
|
||||||
- 4x GPIO
|
- 4x GPIO
|
||||||
|
|
||||||
- 6-pin JST-GH
|
- 6-pin JST-GH
|
||||||
|
|
||||||
- CAN Port
|
- CAN Port
|
||||||
|
|
||||||
- Connected to Autopilot's CAN2 (4 Pin JST-GH)
|
- Connected to Autopilot's CAN2 (4 Pin JST-GH)
|
||||||
|
|
||||||
- SPI Port
|
- SPI Port
|
||||||
|
|
||||||
- 7-Pin JST-GH
|
- 7-Pin JST-GH
|
||||||
|
|
||||||
- I2C Port
|
- I2C Port
|
||||||
|
|
||||||
- 4-Pin JST-GH
|
- 4-Pin JST-GH
|
||||||
|
|
||||||
- I2S Port
|
- I2S Port
|
||||||
|
|
||||||
- 7-Pin JST-GH
|
- 7-Pin JST-GH
|
||||||
|
|
||||||
- 2x UART Port
|
- 2x UART Port
|
||||||
|
|
||||||
- 1 for debug
|
- 1 for debug
|
||||||
- 1 connected to Autopilot's telem2
|
- 1 connected to Autopilot's telem2
|
||||||
|
|
||||||
- Fan Power Port
|
- Fan Power Port
|
||||||
|
|
||||||
@@ -129,13 +129,13 @@ This information comes from the [Holybro Pixhawk-Jetson Baseboard Documentation]
|
|||||||
|
|
||||||
- Pixhawk Autopilot Bus Interface
|
- Pixhawk Autopilot Bus Interface
|
||||||
|
|
||||||
- 100 Pin Hirose DF40
|
- 100 Pin Hirose DF40
|
||||||
- 50 Pin Hirose DF40
|
- 50 Pin Hirose DF40
|
||||||
|
|
||||||
- Redundant Digital Power Module Inputs
|
- Redundant Digital Power Module Inputs
|
||||||
|
|
||||||
- I2C Power Monitor Support
|
- I2C Power Monitor Support
|
||||||
- 2x 6-Pin Molex CLIK-Mate
|
- 2x 6-Pin Molex CLIK-Mate
|
||||||
|
|
||||||
- Power Path Selector
|
- Power Path Selector
|
||||||
|
|
||||||
@@ -143,68 +143,68 @@ This information comes from the [Holybro Pixhawk-Jetson Baseboard Documentation]
|
|||||||
|
|
||||||
- 额定电压
|
- 额定电压
|
||||||
|
|
||||||
- Max input voltage: 6V
|
- Max input voltage: 6V
|
||||||
- USB 电源输入:4.75~5.25V
|
- USB 电源输入:4.75~5.25V
|
||||||
|
|
||||||
- Full GPS Plus Safety Switch Port
|
- Full GPS Plus Safety Switch Port
|
||||||
|
|
||||||
- 10-Pin JST-GH
|
- 10-Pin JST-GH
|
||||||
|
|
||||||
- Secondary (GPS2) Port
|
- Secondary (GPS2) Port
|
||||||
|
|
||||||
- 6-Pin JST-GH
|
- 6-Pin JST-GH
|
||||||
|
|
||||||
- 2x CAN Ports
|
- 2x CAN Ports
|
||||||
|
|
||||||
- 4-Pin JST-GH
|
- 4-Pin JST-GH
|
||||||
|
|
||||||
- 3x Telemetry Ports with Flow Control
|
- 3x Telemetry Ports with Flow Control
|
||||||
|
|
||||||
- 2x 6-Pin JST-GH
|
- 2x 6-Pin JST-GH
|
||||||
- 1 is connected to Jetson's `UART1` Port
|
- 1 is connected to Jetson's `UART1` Port
|
||||||
|
|
||||||
- 16 PWM Outputs
|
- 16 PWM Outputs
|
||||||
|
|
||||||
- 2x 10-Pin JST-GH
|
- 2x 10-Pin JST-GH
|
||||||
|
|
||||||
- UART4 & I2C Port
|
- UART4 & I2C Port
|
||||||
|
|
||||||
- 6-Pin JST-GH
|
- 6-Pin JST-GH
|
||||||
|
|
||||||
- 2x Gigabit Ethernet Port
|
- 2x Gigabit Ethernet Port
|
||||||
|
|
||||||
- Connected to both Jetson & Autopilot via Ethernet switch (RTL8367S)
|
- Connected to both Jetson & Autopilot via Ethernet switch (RTL8367S)
|
||||||
- 8-Pin JST-GH
|
- 8-Pin JST-GH
|
||||||
- RJ45
|
- RJ45
|
||||||
|
|
||||||
- AD & IO
|
- AD & IO
|
||||||
|
|
||||||
- 8-Pin JST-GH
|
- 8-Pin JST-GH
|
||||||
|
|
||||||
- USB 2.0
|
- USB 2.0
|
||||||
|
|
||||||
- USB-C
|
- USB-C
|
||||||
- 4-Pin JST-GH
|
- 4-Pin JST-GH
|
||||||
|
|
||||||
- DSM Input
|
- DSM Input
|
||||||
|
|
||||||
- 3-Pin JST-ZH 1.5mm Pitch
|
- 3-Pin JST-ZH 1.5mm Pitch
|
||||||
|
|
||||||
- RC In
|
- RC In
|
||||||
|
|
||||||
- PPM/SBUS
|
- PPM/SBUS
|
||||||
- 5-Pin JST-GH
|
- 5-Pin JST-GH
|
||||||
|
|
||||||
- SPI Port
|
- SPI Port
|
||||||
|
|
||||||
- External Sensor Bus (SPI5)
|
- External Sensor Bus (SPI5)
|
||||||
- 11-Pin JST-GH
|
- 11-Pin JST-GH
|
||||||
|
|
||||||
- 2x Debug Port
|
- 2x Debug Port
|
||||||
|
|
||||||
- 1 for FMU
|
- 1 for FMU
|
||||||
- 1 for IO
|
- 1 for IO
|
||||||
- 10-Pin JST-SH
|
- 10-Pin JST-SH
|
||||||
|
|
||||||
:::
|
:::
|
||||||
|
|
||||||
@@ -218,7 +218,7 @@ The Jetson has separate input power circuitry from the Pixhawk autopilot:
|
|||||||
- 8V/3A Minimum (Depends on Usage and Peripherals)
|
- 8V/3A Minimum (Depends on Usage and Peripherals)
|
||||||
- Voltage Rating: 7-21V (3S-4S)
|
- Voltage Rating: 7-21V (3S-4S)
|
||||||
- Jetson Baseboard onboard BEC is rated for 7-21V (3S-4S).
|
- Jetson Baseboard onboard BEC is rated for 7-21V (3S-4S).
|
||||||
Note that the external UBEC-12A can be used for applications above 4S
|
Note that the external UBEC-12A can be used for applications above 4S
|
||||||
|
|
||||||
During development using the following wired power supply is recommended:
|
During development using the following wired power supply is recommended:
|
||||||
|
|
||||||
@@ -698,7 +698,7 @@ On the following screen, confirm your selected device:
|
|||||||
|
|
||||||
- Choose `Pre-config` for the OEM Configuration (this will skip Ubuntu first time setup screens after reboot).
|
- Choose `Pre-config` for the OEM Configuration (this will skip Ubuntu first time setup screens after reboot).
|
||||||
- Choose your preferred username and password (and write them down).
|
- Choose your preferred username and password (and write them down).
|
||||||
These will be used as your login credentials to Jetpack.
|
These will be used as your login credentials to Jetpack.
|
||||||
- Choose `NVMe` as the storage device because the board has separate SSD for storage.
|
- Choose `NVMe` as the storage device because the board has separate SSD for storage.
|
||||||
|
|
||||||

|

|
||||||
@@ -922,95 +922,95 @@ These instructions approximately mirror the [PX4 Ethernet setup](../advanced_con
|
|||||||
Next we modify the Jetson IP address to be on the same network as the Pixhawk:
|
Next we modify the Jetson IP address to be on the same network as the Pixhawk:
|
||||||
|
|
||||||
1. Make sure `netplan` is installed.
|
1. Make sure `netplan` is installed.
|
||||||
You can check by running the following command:
|
You can check by running the following command:
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
netplan -h
|
netplan -h
|
||||||
```
|
```
|
||||||
|
|
||||||
If not, install it using the commands:
|
If not, install it using the commands:
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
sudo apt update
|
sudo apt update
|
||||||
sudo apt install netplan.io
|
sudo apt install netplan.io
|
||||||
```
|
```
|
||||||
|
|
||||||
2. Check `system_networkd` is running:
|
2. Check `system_networkd` is running:
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
sudo systemctl status systemd-networkd
|
sudo systemctl status systemd-networkd
|
||||||
```
|
```
|
||||||
|
|
||||||
You should see output like below if it is active:
|
You should see output like below if it is active:
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
● systemd-networkd.service - Network Configuration
|
● systemd-networkd.service - Network Configuration
|
||||||
Loaded: loaded (/lib/systemd/system/systemd-networkd.service; enabled; vendor preset: enabled)
|
Loaded: loaded (/lib/systemd/system/systemd-networkd.service; enabled; vendor preset: enabled)
|
||||||
Active: active (running) since Wed 2024-09-11 23:32:44 EDT; 23min ago
|
Active: active (running) since Wed 2024-09-11 23:32:44 EDT; 23min ago
|
||||||
TriggeredBy: ● systemd-networkd.socket
|
TriggeredBy: ● systemd-networkd.socket
|
||||||
Docs: man:systemd-networkd.service(8)
|
Docs: man:systemd-networkd.service(8)
|
||||||
Main PID: 2452 (systemd-network)
|
Main PID: 2452 (systemd-network)
|
||||||
Status: "Processing requests..."
|
Status: "Processing requests..."
|
||||||
Tasks: 1 (limit: 18457)
|
Tasks: 1 (limit: 18457)
|
||||||
Memory: 2.7M
|
Memory: 2.7M
|
||||||
CPU: 157ms
|
CPU: 157ms
|
||||||
CGroup: /system.slice/systemd-networkd.service
|
CGroup: /system.slice/systemd-networkd.service
|
||||||
└─2452 /lib/systemd/systemd-networkd
|
└─2452 /lib/systemd/systemd-networkd
|
||||||
|
|
||||||
Sep 11 23:32:44 ubuntu systemd-networkd[2452]: lo: Gained carrier
|
Sep 11 23:32:44 ubuntu systemd-networkd[2452]: lo: Gained carrier
|
||||||
Sep 11 23:32:44 ubuntu systemd-networkd[2452]: wlan0: Gained IPv6LL
|
Sep 11 23:32:44 ubuntu systemd-networkd[2452]: wlan0: Gained IPv6LL
|
||||||
Sep 11 23:32:44 ubuntu systemd-networkd[2452]: eth0: Gained IPv6LL
|
Sep 11 23:32:44 ubuntu systemd-networkd[2452]: eth0: Gained IPv6LL
|
||||||
Sep 11 23:32:44 ubuntu systemd-networkd[2452]: Enumeration completed
|
Sep 11 23:32:44 ubuntu systemd-networkd[2452]: Enumeration completed
|
||||||
Sep 11 23:32:44 ubuntu systemd[1]: Started Network Configuration.
|
Sep 11 23:32:44 ubuntu systemd[1]: Started Network Configuration.
|
||||||
Sep 11 23:32:44 ubuntu systemd-networkd[2452]: wlan0: Connected WiFi access point: Verizon_7YLWWD (78:67:0e:ea:a6:0>
|
Sep 11 23:32:44 ubuntu systemd-networkd[2452]: wlan0: Connected WiFi access point: Verizon_7YLWWD (78:67:0e:ea:a6:0>
|
||||||
Sep 11 23:34:16 ubuntu systemd-networkd[2452]: eth0: Re-configuring with /run/systemd/network/10-netplan-eth0.netwo>
|
Sep 11 23:34:16 ubuntu systemd-networkd[2452]: eth0: Re-configuring with /run/systemd/network/10-netplan-eth0.netwo>
|
||||||
Sep 11 23:34:16 ubuntu systemd-networkd[2452]: eth0: DHCPv6 lease lost
|
Sep 11 23:34:16 ubuntu systemd-networkd[2452]: eth0: DHCPv6 lease lost
|
||||||
Sep 11 23:34:16 ubuntu systemd-networkd[2452]: eth0: Re-configuring with /run/systemd/network/10-netplan-eth0.netwo>
|
Sep 11 23:34:16 ubuntu systemd-networkd[2452]: eth0: Re-configuring with /run/systemd/network/10-netplan-eth0.netwo>
|
||||||
Sep 11 23:34:16 ubuntu systemd-networkd[2452]: eth0: DHCPv6 lease lost
|
Sep 11 23:34:16 ubuntu systemd-networkd[2452]: eth0: DHCPv6 lease lost
|
||||||
```
|
```
|
||||||
|
|
||||||
If `system_networkd` is not running, it can be enabled using:
|
If `system_networkd` is not running, it can be enabled using:
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
sudo systemctl start systemd-networkd
|
sudo systemctl start systemd-networkd
|
||||||
sudo systemctl enable systemd-networkd
|
sudo systemctl enable systemd-networkd
|
||||||
```
|
```
|
||||||
|
|
||||||
3. Open the Netplan configuration file (so we can set up a static IP for the Jetson).
|
3. Open the Netplan configuration file (so we can set up a static IP for the Jetson).
|
||||||
|
|
||||||
The Netplan configuration file is usually located in the `/etc/netplan/` directory and named something like `01-netcfg.yaml` (the name can vary).
|
The Netplan configuration file is usually located in the `/etc/netplan/` directory and named something like `01-netcfg.yaml` (the name can vary).
|
||||||
Below we use `nano` to open the file, but you can use your preferred text editor:
|
Below we use `nano` to open the file, but you can use your preferred text editor:
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
sudo nano /etc/netplan/01-netcfg.yaml
|
sudo nano /etc/netplan/01-netcfg.yaml
|
||||||
```
|
```
|
||||||
|
|
||||||
4. Modify the yaml configuration, by overwriting the contents with the following information and then saving:
|
4. Modify the yaml configuration, by overwriting the contents with the following information and then saving:
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
network:
|
network:
|
||||||
version: 2
|
version: 2
|
||||||
renderer: networkd
|
renderer: networkd
|
||||||
ethernets:
|
ethernets:
|
||||||
eth0:
|
eth0:
|
||||||
dhcp4: no
|
dhcp4: no
|
||||||
addresses:
|
addresses:
|
||||||
- 10.41.10.1/24
|
- 10.41.10.1/24
|
||||||
routes:
|
routes:
|
||||||
- to: 0.0.0.0/0
|
- to: 0.0.0.0/0
|
||||||
via: 10.41.10.254
|
via: 10.41.10.254
|
||||||
nameservers:
|
nameservers:
|
||||||
addresses:
|
addresses:
|
||||||
- 10.41.10.254
|
- 10.41.10.254
|
||||||
```
|
```
|
||||||
|
|
||||||
This gives the Jetson a static IP address on the Ethernet interface of `10.41.10.1` .
|
This gives the Jetson a static IP address on the Ethernet interface of `10.41.10.1` .
|
||||||
|
|
||||||
5. Apply the changes using the following command:
|
5. Apply the changes using the following command:
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
sudo netplan apply
|
sudo netplan apply
|
||||||
```
|
```
|
||||||
|
|
||||||
The Pixhawk Ethernet address is set to `10.41.10.2` by default, which is on the same subnet.
|
The Pixhawk Ethernet address is set to `10.41.10.2` by default, which is on the same subnet.
|
||||||
We can test our changes above by pinging the Pixhawk from within the Jetson terminal:
|
We can test our changes above by pinging the Pixhawk from within the Jetson terminal:
|
||||||
@@ -1221,15 +1221,15 @@ Assuming the client is set up as defined above:
|
|||||||
|
|
||||||
- (Serial connection) Start the agent on `/dev/ttyTHS1`:
|
- (Serial connection) Start the agent on `/dev/ttyTHS1`:
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
sudo MicroXRCEAgent serial --dev /dev/ttyTHS1 -b 921600
|
sudo MicroXRCEAgent serial --dev /dev/ttyTHS1 -b 921600
|
||||||
```
|
```
|
||||||
|
|
||||||
- (Ethernet) Start the agent on UDP port `8888`:
|
- (Ethernet) Start the agent on UDP port `8888`:
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
MicroXRCEAgent udp4 -p 8888
|
MicroXRCEAgent udp4 -p 8888
|
||||||
```
|
```
|
||||||
|
|
||||||
If your agent and client are connected and no nodes are running, you should see output similar to this in the Agent terminal:
|
If your agent and client are connected and no nodes are running, you should see output similar to this in the Agent terminal:
|
||||||
|
|
||||||
|
|||||||
+14
-14
@@ -38,9 +38,9 @@ A frame configuration can define everything about a vehicle, from it's geometry
|
|||||||
When you're bringing up a new vehicle though, the frame will usually contain a fairly minimal configuration:
|
When you're bringing up a new vehicle though, the frame will usually contain a fairly minimal configuration:
|
||||||
|
|
||||||
- Frames named with "Generic" define the vehicle type, number of rotors, and "placeholder" rotor positions.
|
- Frames named with "Generic" define the vehicle type, number of rotors, and "placeholder" rotor positions.
|
||||||
After selecting the airframe you define the actual geometry and then configure outputs.
|
After selecting the airframe you define the actual geometry and then configure outputs.
|
||||||
- Frames named with model/brand will define the vehicle type, number of rotors, actual rotor positions, and motor directions.
|
- Frames named with model/brand will define the vehicle type, number of rotors, actual rotor positions, and motor directions.
|
||||||
After selecting the airframe you usually still have to configure outputs.
|
After selecting the airframe you usually still have to configure outputs.
|
||||||
|
|
||||||
:::
|
:::
|
||||||
|
|
||||||
@@ -52,7 +52,7 @@ This ensures that all ESC provide exactly the same output for a given input (ide
|
|||||||
The final step is [Motor Configuration](../config/actuators.md#motor-configuration):
|
The final step is [Motor Configuration](../config/actuators.md#motor-configuration):
|
||||||
|
|
||||||
- [Reverse any motors](../config/actuators.md#reversing-motors) that don't match the spin direction configured in the Geometry.
|
- [Reverse any motors](../config/actuators.md#reversing-motors) that don't match the spin direction configured in the Geometry.
|
||||||
For DShot ESC you can do this through the Acuator Testing UI.
|
For DShot ESC you can do this through the Acuator Testing UI.
|
||||||
- PWM, OneShot, and CAN ESC, set the motor input limits for disarmed, low and high speed (not needed for DShot ESC)
|
- PWM, OneShot, and CAN ESC, set the motor input limits for disarmed, low and high speed (not needed for DShot ESC)
|
||||||
|
|
||||||
相关章节:
|
相关章节:
|
||||||
@@ -123,14 +123,14 @@ Tuning is the final step, carried out only after most other setup and configurat
|
|||||||
|
|
||||||
- [Autotune](../config/autotune_mc.md) — Automates tuning PX4 rate and attitude controllers (recommended).
|
- [Autotune](../config/autotune_mc.md) — Automates tuning PX4 rate and attitude controllers (recommended).
|
||||||
|
|
||||||
::: info
|
::: info
|
||||||
Automatic tuning works on frames that have reasonable authority and dynamics around all the body axes.
|
Automatic tuning works on frames that have reasonable authority and dynamics around all the body axes.
|
||||||
It has primarily been tested on racing quads and X500, and is expected to be less effective on tricopters with a tiltable rotor.
|
It has primarily been tested on racing quads and X500, and is expected to be less effective on tricopters with a tiltable rotor.
|
||||||
|
|
||||||
Manual tuning using these guides are only needed if there is a problem with autotune:
|
Manual tuning using these guides are only needed if there is a problem with autotune:
|
||||||
|
|
||||||
- [MC PID Tuning (Manual/Basic)](../config_mc/pid_tuning_guide_multicopter_basic.md) — Manual tuning basic how to.
|
- [MC PID Tuning (Manual/Basic)](../config_mc/pid_tuning_guide_multicopter_basic.md) — Manual tuning basic how to.
|
||||||
- [MC PID Tuning Guide (Manual/Detailed)](../config_mc/pid_tuning_guide_multicopter.md) — Manual tuning with detailed explanation.
|
- [MC PID Tuning Guide (Manual/Detailed)](../config_mc/pid_tuning_guide_multicopter.md) — Manual tuning with detailed explanation.
|
||||||
|
|
||||||
|
|
||||||
:::
|
:::
|
||||||
@@ -138,7 +138,7 @@ Tuning is the final step, carried out only after most other setup and configurat
|
|||||||
- [MC Filter/Control Latency Tuning](../config_mc/filter_tuning.md) — Trade off control latency and noise filtering.
|
- [MC Filter/Control Latency Tuning](../config_mc/filter_tuning.md) — Trade off control latency and noise filtering.
|
||||||
|
|
||||||
- [MC Setpoint Tuning (Trajectory Generator)](../config_mc/mc_trajectory_tuning.md)
|
- [MC Setpoint Tuning (Trajectory Generator)](../config_mc/mc_trajectory_tuning.md)
|
||||||
- [MC Jerk-limited Type Trajectory](../config_mc/mc_jerk_limited_type_trajectory.md)
|
- [MC Jerk-limited Type Trajectory](../config_mc/mc_jerk_limited_type_trajectory.md)
|
||||||
|
|
||||||
- [Multicopter Racer Setup](../config_mc/racer_setup.md)
|
- [Multicopter Racer Setup](../config_mc/racer_setup.md)
|
||||||
|
|
||||||
@@ -167,7 +167,7 @@ Yes but it must be physically feasible. E.g. if you make a quadrotor where all m
|
|||||||
- [飞控外设](../peripherals/index.md) - 设置特定传感器、可选传感器、执行器等。
|
- [飞控外设](../peripherals/index.md) - 设置特定传感器、可选传感器、执行器等。
|
||||||
- [Advanced Configuration](../advanced_config/index.md) - Factory/OEM calibration, configuring advanced features, less-common configuration.
|
- [Advanced Configuration](../advanced_config/index.md) - Factory/OEM calibration, configuring advanced features, less-common configuration.
|
||||||
- Vehicle-Centric Config/Tuning:
|
- Vehicle-Centric Config/Tuning:
|
||||||
- **Multicopter Config/Tuning**
|
- **Multicopter Config/Tuning**
|
||||||
- [直升机配置/调参](../config_heli/index.md)
|
- [直升机配置/调参](../config_heli/index.md)
|
||||||
- [Fixed Wing Config/Tuning](../config_fw/index.md)
|
- [Fixed Wing Config/Tuning](../config_fw/index.md)
|
||||||
- [VTOL 配置/调参](../config_vtol/index.md)
|
- [VTOL 配置/调参](../config_vtol/index.md)
|
||||||
|
|||||||
@@ -26,13 +26,13 @@ The ARF kit can be used with most flight controllers supported by PX4.
|
|||||||
The Holybro [X500 V2 Kit](https://holybro.com/collections/x500-kits) includes almost all the required components:
|
The Holybro [X500 V2 Kit](https://holybro.com/collections/x500-kits) includes almost all the required components:
|
||||||
|
|
||||||
- X500V2 Frame Kit
|
- X500V2 Frame Kit
|
||||||
- Body - Full Carbon Fiber Top & Bottom plate (144 x 144mm, 2mm thick)
|
- Body - Full Carbon Fiber Top & Bottom plate (144 x 144mm, 2mm thick)
|
||||||
- Arm - High strength & ultra-lightweight 16mm carbon fiber tubes
|
- Arm - High strength & ultra-lightweight 16mm carbon fiber tubes
|
||||||
- Landing gear - 16mm & 10mm diameter carbon fiber tubes
|
- Landing gear - 16mm & 10mm diameter carbon fiber tubes
|
||||||
- Platform board - With mounting holes for GPS & popular companion computer
|
- Platform board - With mounting holes for GPS & popular companion computer
|
||||||
- Dual 10mm Ø rod x 250 mm long rail mounting system
|
- Dual 10mm Ø rod x 250 mm long rail mounting system
|
||||||
- Battery mount with two Battery Straps
|
- Battery mount with two Battery Straps
|
||||||
- Hand tools for installation
|
- Hand tools for installation
|
||||||
- Holybro Motors - 2216 KV880 x6 (superseded - check [spare parts list](https://holybro.com/products/spare-parts-x500-v2-kit) for current version).
|
- Holybro Motors - 2216 KV880 x6 (superseded - check [spare parts list](https://holybro.com/products/spare-parts-x500-v2-kit) for current version).
|
||||||
- Holybro BLHeli S ESC 20A x4 (superseded - check [spare parts list](https://holybro.com/products/spare-parts-x500-v2-kit) for current version).
|
- Holybro BLHeli S ESC 20A x4 (superseded - check [spare parts list](https://holybro.com/products/spare-parts-x500-v2-kit) for current version).
|
||||||
- Propellers - 1045 x4 (superseded - check [spare parts list](https://holybro.com/products/spare-parts-x500-v2-kit) for current version).
|
- Propellers - 1045 x4 (superseded - check [spare parts list](https://holybro.com/products/spare-parts-x500-v2-kit) for current version).
|
||||||
@@ -93,92 +93,92 @@ Tools are included to do the assembly, however you may need:
|
|||||||
Estimate time to assemble is 55 min (25 minutes for frame, 30 minutes for autopilot installation/configuration)
|
Estimate time to assemble is 55 min (25 minutes for frame, 30 minutes for autopilot installation/configuration)
|
||||||
|
|
||||||
1. Start by assembling the payload & battery holder.
|
1. Start by assembling the payload & battery holder.
|
||||||
Push the rubbers into grippers (Do not use sharp items to push them in!).
|
Push the rubbers into grippers (Do not use sharp items to push them in!).
|
||||||
Next, pass the holders through the holder bars with the battery holder bases as Figure 3.
|
Next, pass the holders through the holder bars with the battery holder bases as Figure 3.
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
_Figure 2_: Payload holder components
|
_Figure 2_: Payload holder components
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
_Figure 3_: Payload holder assembled
|
_Figure 3_: Payload holder assembled
|
||||||
|
|
||||||
2. The next is to go for attaching the bottom plate to the payload holder.
|
2. The next is to go for attaching the bottom plate to the payload holder.
|
||||||
|
|
||||||
You will need the parts as shown in Figure 4.
|
You will need the parts as shown in Figure 4.
|
||||||
Then mount the base for power distribution board using nylon nuts as Figure 5.
|
Then mount the base for power distribution board using nylon nuts as Figure 5.
|
||||||
Finally using 8 hex screws you can join the bottom plate to the payload holder (Figure 7)
|
Finally using 8 hex screws you can join the bottom plate to the payload holder (Figure 7)
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
_Figure 4_: Needed Materials
|
_Figure 4_: Needed Materials
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
_Figure 5_: PDB mount base
|
_Figure 5_: PDB mount base
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
_Figure 6_: Mounted pdb with nylon nuts
|
_Figure 6_: Mounted pdb with nylon nuts
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
_Figure 7_: Mounted Plate on payload holder
|
_Figure 7_: Mounted Plate on payload holder
|
||||||
|
|
||||||
3. Let's gather the stuff needed for mounting landing gear as Figure 8.
|
3. Let's gather the stuff needed for mounting landing gear as Figure 8.
|
||||||
Use the hex screws to join landing gears to the bottom plate.
|
Use the hex screws to join landing gears to the bottom plate.
|
||||||
You also need to open three hex screws on each of the leg stands so you can push them into carbon fiber pipes.
|
You also need to open three hex screws on each of the leg stands so you can push them into carbon fiber pipes.
|
||||||
Do not forget to tighten them back again.
|
Do not forget to tighten them back again.
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
_Figure 8_: Required parts for landing gear attachment
|
_Figure 8_: Required parts for landing gear attachment
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
_Figure 9_: Landing gear attachment to the body
|
_Figure 9_: Landing gear attachment to the body
|
||||||
|
|
||||||
4. We will gather all the arms now to mount the top plate.
|
4. We will gather all the arms now to mount the top plate.
|
||||||
Please pay attention that the motor numbers on arms are a match with the ones mentioned on the top plate.
|
Please pay attention that the motor numbers on arms are a match with the ones mentioned on the top plate.
|
||||||
Fortunately, motors are mounted and ESCs have been connected in advance.
|
Fortunately, motors are mounted and ESCs have been connected in advance.
|
||||||
Start by passing through all the screws as you have the arms fixed in their own places (They have a guide as shown in Figure 11 to ensure they are in place) and tighten all nylon nuts a bit.
|
Start by passing through all the screws as you have the arms fixed in their own places (They have a guide as shown in Figure 11 to ensure they are in place) and tighten all nylon nuts a bit.
|
||||||
Then you can connect XT30 power connectors to the power board.
|
Then you can connect XT30 power connectors to the power board.
|
||||||
Please keep in mind that the signal wires have to be passed through the top plate such that we can connect them later to Pixhawk.
|
Please keep in mind that the signal wires have to be passed through the top plate such that we can connect them later to Pixhawk.
|
||||||
|
|
||||||
<img src="../../assets/airframes/multicopter/x500_v2_holybro_pixhawk5x/needed_stuff_top_plate.png" width="700" title="Arms and top plate materials">
|
<img src="../../assets/airframes/multicopter/x500_v2_holybro_pixhawk5x/needed_stuff_top_plate.png" width="700" title="Arms and top plate materials">
|
||||||
|
|
||||||
_Figure 10_: Connecting arms needed materials.
|
_Figure 10_: Connecting arms needed materials.
|
||||||
|
|
||||||
<img src="../../assets/airframes/multicopter/x500_v2_holybro_pixhawk5x/guide_for_arm_mount.png" width="700" title="Guide for the arms mount">
|
<img src="../../assets/airframes/multicopter/x500_v2_holybro_pixhawk5x/guide_for_arm_mount.png" width="700" title="Guide for the arms mount">
|
||||||
|
|
||||||
_Figure 11_: Guide for the arms mount
|
_Figure 11_: Guide for the arms mount
|
||||||
|
|
||||||
5. Tighten all 16 screws and nuts by using both hex wrench and nut driver.
|
5. Tighten all 16 screws and nuts by using both hex wrench and nut driver.
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
_Figure 12_: Mounted top plate
|
_Figure 12_: Mounted top plate
|
||||||
|
|
||||||
6. Next you can mount your pixhawk on the top plate by using the stickers.
|
6. Next you can mount your pixhawk on the top plate by using the stickers.
|
||||||
It is recommended to have the direction of your Pixhawk's arrow the same as the one mentioned on the top plate.
|
It is recommended to have the direction of your Pixhawk's arrow the same as the one mentioned on the top plate.
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
_Figure 13_: Sticker tapes on Pixhawk
|
_Figure 13_: Sticker tapes on Pixhawk
|
||||||
|
|
||||||
7. If you want to mount the GPS on the companion computer plate, you can now secure the GPS mount onto it using 4 screws and nuts.
|
7. If you want to mount the GPS on the companion computer plate, you can now secure the GPS mount onto it using 4 screws and nuts.
|
||||||
|
|
||||||
<img src="../../assets/airframes/multicopter/x500_v2_holybro_pixhawk5x/gps_mount_plate.png" width="400" title="Secure GPS mount onto companion plate">
|
<img src="../../assets/airframes/multicopter/x500_v2_holybro_pixhawk5x/gps_mount_plate.png" width="400" title="Secure GPS mount onto companion plate">
|
||||||
|
|
||||||
_Figure 14_: Secure GPS mount onto companion plate
|
_Figure 14_: Secure GPS mount onto companion plate
|
||||||
|
|
||||||
8. Use the tape and stick the GPS to the top of the GPS mast and mount the GPS mast.
|
8. Use the tape and stick the GPS to the top of the GPS mast and mount the GPS mast.
|
||||||
Make sure the arrow on the gps is pointing forward (Figure 15).
|
Make sure the arrow on the gps is pointing forward (Figure 15).
|
||||||
|
|
||||||
<img src="../../assets/airframes/multicopter/x500_holybro_pixhawk4/gps2.jpg" width="400" title="Figure 16: GPS and mast">
|
<img src="../../assets/airframes/multicopter/x500_holybro_pixhawk4/gps2.jpg" width="400" title="Figure 16: GPS and mast">
|
||||||
|
|
||||||
_Figure 15_: GPS and mast
|
_Figure 15_: GPS and mast
|
||||||
|
|
||||||
9. Finally, you can connect the Pixhawk interfaces such as telemetry radio to 'TELEM1' and motors signal cables accordingly.
|
9. Finally, you can connect the Pixhawk interfaces such as telemetry radio to 'TELEM1' and motors signal cables accordingly.
|
||||||
|
|
||||||
@@ -204,14 +204,14 @@ First update the firmware, airframe, and actuator mappings:
|
|||||||
|
|
||||||
- [Airframe](../config/airframe.md)
|
- [Airframe](../config/airframe.md)
|
||||||
|
|
||||||
You will need to select the _Holybro X500 V2_ airframe (**Quadrotor x > Holybro 500 V2**)
|
You will need to select the _Holybro X500 V2_ airframe (**Quadrotor x > Holybro 500 V2**)
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
- [Actuators](../config/actuators.md)
|
- [Actuators](../config/actuators.md)
|
||||||
- You should not need to update the vehicle geometry (as this is a preconfigured airframe).
|
- You should not need to update the vehicle geometry (as this is a preconfigured airframe).
|
||||||
- Assign actuator functions to outputs to match your wiring.
|
- Assign actuator functions to outputs to match your wiring.
|
||||||
- Test the configuration using the sliders.
|
- Test the configuration using the sliders.
|
||||||
|
|
||||||
Then perform the mandatory setup/calibration:
|
Then perform the mandatory setup/calibration:
|
||||||
|
|
||||||
|
|||||||
@@ -20,12 +20,12 @@ Key airframe features:
|
|||||||
- Removable V tail or conventional tail options included
|
- Removable V tail or conventional tail options included
|
||||||
- Threaded inserts in the wings and fuselage top for external mounting
|
- Threaded inserts in the wings and fuselage top for external mounting
|
||||||
- Numerous mounting features
|
- Numerous mounting features
|
||||||
- Top antenna hole
|
- Top antenna hole
|
||||||
- Top GPS cover
|
- Top GPS cover
|
||||||
- Side "T" antenna mounts
|
- Side "T" antenna mounts
|
||||||
- Rear electronics tray
|
- Rear electronics tray
|
||||||
- Front facing "action cam" cutout
|
- Front facing "action cam" cutout
|
||||||
- Front facing FPV camera cutout
|
- Front facing FPV camera cutout
|
||||||
- Removable wings
|
- Removable wings
|
||||||
- Low stall speed
|
- Low stall speed
|
||||||
- Gentle handling
|
- Gentle handling
|
||||||
@@ -69,10 +69,10 @@ Key build features
|
|||||||
- [6s2p 18650 LiIon flight battery](https://www.upgradeenergytech.com/product-page/6s-22-2v-5600mah-30c-dark-lithium-liion-drone-battery) (select XT60 connector)
|
- [6s2p 18650 LiIon flight battery](https://www.upgradeenergytech.com/product-page/6s-22-2v-5600mah-30c-dark-lithium-liion-drone-battery) (select XT60 connector)
|
||||||
|
|
||||||
- [Custom designed 3D printed parts](https://github.com/PX4/PX4-user_guide/raw/main/assets/airframes/fw/reptile_dragon_2/rd2_3d_printed_parts.zip)
|
- [Custom designed 3D printed parts](https://github.com/PX4/PX4-user_guide/raw/main/assets/airframes/fw/reptile_dragon_2/rd2_3d_printed_parts.zip)
|
||||||
- ARK6X carrier mount
|
- ARK6X carrier mount
|
||||||
- Holybro Pixhawk 5x carrier mount
|
- Holybro Pixhawk 5x carrier mount
|
||||||
- FPV pod and camera mount
|
- FPV pod and camera mount
|
||||||
- Pitot static probe "plug" adapter
|
- Pitot static probe "plug" adapter
|
||||||
|
|
||||||
- [Custom designed power distribution PCB](https://github.com/PX4/PX4-user_guide/raw/main/assets/airframes/fw/reptile_dragon_2/xt30_power_distro_pcb.zip)
|
- [Custom designed power distribution PCB](https://github.com/PX4/PX4-user_guide/raw/main/assets/airframes/fw/reptile_dragon_2/xt30_power_distro_pcb.zip)
|
||||||
|
|
||||||
@@ -426,15 +426,15 @@ Prior to the first flight, a comprehensive preflight must be conducted.
|
|||||||
I recommend checking the following items:
|
I recommend checking the following items:
|
||||||
|
|
||||||
- Sensor calibration (QGC)
|
- Sensor calibration (QGC)
|
||||||
- Mag calibration
|
- Mag calibration
|
||||||
- Accelerometer calibration
|
- Accelerometer calibration
|
||||||
- Airspeed calibration
|
- Airspeed calibration
|
||||||
- Level horizon calibration
|
- Level horizon calibration
|
||||||
- Check control surface deflection
|
- Check control surface deflection
|
||||||
- Right stick -> Right aileron goes up, left aileron goes down
|
- Right stick -> Right aileron goes up, left aileron goes down
|
||||||
- Left stick -> Left aileron goes up, right aileron goes down
|
- Left stick -> Left aileron goes up, right aileron goes down
|
||||||
- Stick back -> elevator goes up
|
- Stick back -> elevator goes up
|
||||||
-Stick forward -> elevator goes down
|
-Stick forward -> elevator goes down
|
||||||
- Left rudder -> Rudder goes left
|
- Left rudder -> Rudder goes left
|
||||||
- Right rudder -> Rudder goes right
|
- Right rudder -> Rudder goes right
|
||||||
- Check Px4 inputs (in `stabilized mode`)
|
- Check Px4 inputs (in `stabilized mode`)
|
||||||
|
|||||||
@@ -98,11 +98,11 @@ The mapping between flight controller outputs and specific controls/motors depen
|
|||||||
Assembly information is covered in several sections:
|
Assembly information is covered in several sections:
|
||||||
|
|
||||||
- [Basic Assembly](../assembly/index.md) contains topics shows the setup of core components for a number of popular [flight controllers](../flight_controller/index.md).
|
- [Basic Assembly](../assembly/index.md) contains topics shows the setup of core components for a number of popular [flight controllers](../flight_controller/index.md).
|
||||||
Flight controllers for which we do not have guides are usually set up in much the same way (and almost always include similar setup guides).
|
Flight controllers for which we do not have guides are usually set up in much the same way (and almost always include similar setup guides).
|
||||||
- [Peripherals](../peripherals/index.md) contains information about other peripherals, including [Airspeed Sensors](../sensor/airspeed.md).
|
- [Peripherals](../peripherals/index.md) contains information about other peripherals, including [Airspeed Sensors](../sensor/airspeed.md).
|
||||||
- [Airframes Reference > VTOL](../airframes/airframe_reference.md#vtol) explains which flight controller outputs must be connected to different flight controls for each airframe configuration:
|
- [Airframes Reference > VTOL](../airframes/airframe_reference.md#vtol) explains which flight controller outputs must be connected to different flight controls for each airframe configuration:
|
||||||
- Select the configuration for your vehicle if one exists, as this will have been pre-tuned well enough to fly (may only require fine tuning).
|
- Select the configuration for your vehicle if one exists, as this will have been pre-tuned well enough to fly (may only require fine tuning).
|
||||||
- Otherwise select a "Generic Airframe" that matches your vehicle.
|
- Otherwise select a "Generic Airframe" that matches your vehicle.
|
||||||
|
|
||||||
In addition, build logs showing how others have set up different types of vehicles are provided as sub topics.
|
In addition, build logs showing how others have set up different types of vehicles are provided as sub topics.
|
||||||
For example see [FunCub QuadPlane](../frames_vtol/vtol_quadplane_fun_cub_vtol_pixhawk.md).
|
For example see [FunCub QuadPlane](../frames_vtol/vtol_quadplane_fun_cub_vtol_pixhawk.md).
|
||||||
|
|||||||
+119
-119
@@ -29,151 +29,151 @@ This consists of a single _C_ file and a _cmake_ definition (which tells the too
|
|||||||
|
|
||||||
2. Create a new C file in that directory named **px4_simple_app.c**:
|
2. Create a new C file in that directory named **px4_simple_app.c**:
|
||||||
|
|
||||||
- Copy in the default header to the top of the page.
|
- Copy in the default header to the top of the page.
|
||||||
该注释应出现在所有贡献的文件中!
|
该注释应出现在所有贡献的文件中!
|
||||||
|
|
||||||
```c
|
```c
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
*
|
*
|
||||||
* Copyright (c) 2012-2022 PX4 Development Team. All rights reserved.
|
* Copyright (c) 2012-2022 PX4 Development Team. All rights reserved.
|
||||||
*
|
*
|
||||||
* Redistribution and use in source and binary forms, with or without
|
* Redistribution and use in source and binary forms, with or without
|
||||||
* modification, are permitted provided that the following conditions
|
* modification, are permitted provided that the following conditions
|
||||||
* are met:
|
* are met:
|
||||||
*
|
*
|
||||||
* 1. Redistributions of source code must retain the above copyright
|
* 1. Redistributions of source code must retain the above copyright
|
||||||
* notice, this list of conditions and the following disclaimer.
|
* notice, this list of conditions and the following disclaimer.
|
||||||
* 2. Redistributions in binary form must reproduce the above copyright
|
* 2. Redistributions in binary form must reproduce the above copyright
|
||||||
* notice, this list of conditions and the following disclaimer in
|
* notice, this list of conditions and the following disclaimer in
|
||||||
* the documentation and/or other materials provided with the
|
* the documentation and/or other materials provided with the
|
||||||
* distribution.
|
* distribution.
|
||||||
* 3. Neither the name PX4 nor the names of its contributors may be
|
* 3. Neither the name PX4 nor the names of its contributors may be
|
||||||
* used to endorse or promote products derived from this software
|
* used to endorse or promote products derived from this software
|
||||||
* without specific prior written permission.
|
* without specific prior written permission.
|
||||||
*
|
*
|
||||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||||
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||||
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
|
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
|
||||||
* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
|
* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
|
||||||
* COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
|
* COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
|
||||||
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
|
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
|
||||||
* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
|
* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
|
||||||
* OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
|
* OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
|
||||||
* AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
* AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
|
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
|
||||||
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||||
* POSSIBILITY OF SUCH DAMAGE.
|
* POSSIBILITY OF SUCH DAMAGE.
|
||||||
*
|
*
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
```
|
```
|
||||||
|
|
||||||
- 将下面的代码复制到头部注释的下方,
|
- 将下面的代码复制到头部注释的下方,
|
||||||
该注释应出现在所有贡献的文件中!
|
该注释应出现在所有贡献的文件中!
|
||||||
|
|
||||||
```c
|
```c
|
||||||
/**
|
/**
|
||||||
* @file px4_simple_app.c
|
* @file px4_simple_app.c
|
||||||
* Minimal application example for PX4 autopilot
|
* Minimal application example for PX4 autopilot
|
||||||
*
|
*
|
||||||
* @author Example User <mail@example.com>
|
* @author Example User <mail@example.com>
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <px4_platform_common/log.h>
|
#include <px4_platform_common/log.h>
|
||||||
|
|
||||||
__EXPORT int px4_simple_app_main(int argc, char *argv[]);
|
__EXPORT int px4_simple_app_main(int argc, char *argv[]);
|
||||||
|
|
||||||
int px4_simple_app_main(int argc, char *argv[])
|
int px4_simple_app_main(int argc, char *argv[])
|
||||||
{
|
{
|
||||||
PX4_INFO("Hello Sky!");
|
PX4_INFO("Hello Sky!");
|
||||||
return OK;
|
return OK;
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
:::tip
|
:::tip
|
||||||
The main function must be named `<module_name>_main` and exported from the module as shown.
|
The main function must be named `<module_name>_main` and exported from the module as shown.
|
||||||
|
|
||||||
:::
|
:::
|
||||||
|
|
||||||
:::tip
|
:::tip
|
||||||
`PX4_INFO` is the equivalent of `printf` for the PX4 shell (included from **px4_platform_common/log.h**).
|
`PX4_INFO` is the equivalent of `printf` for the PX4 shell (included from **px4_platform_common/log.h**).
|
||||||
There are different log levels: `PX4_INFO`, `PX4_WARN`, `PX4_ERR`, `PX4_DEBUG`.
|
There are different log levels: `PX4_INFO`, `PX4_WARN`, `PX4_ERR`, `PX4_DEBUG`.
|
||||||
Warnings and errors are additionally added to the [ULog](../dev_log/ulog_file_format.md) and shown on [Flight Review](https://logs.px4.io/).
|
Warnings and errors are additionally added to the [ULog](../dev_log/ulog_file_format.md) and shown on [Flight Review](https://logs.px4.io/).
|
||||||
|
|
||||||
:::
|
:::
|
||||||
|
|
||||||
3. Create and open a new _cmake_ definition file named **CMakeLists.txt**.
|
3. Create and open a new _cmake_ definition file named **CMakeLists.txt**.
|
||||||
复制下面的文本:
|
复制下面的文本:
|
||||||
|
|
||||||
```cmake
|
```cmake
|
||||||
############################################################################
|
############################################################################
|
||||||
#
|
#
|
||||||
# Copyright (c) 2015 PX4 Development Team. All rights reserved.
|
# Copyright (c) 2015 PX4 Development Team. All rights reserved.
|
||||||
#
|
#
|
||||||
# Redistribution and use in source and binary forms, with or without
|
# Redistribution and use in source and binary forms, with or without
|
||||||
# modification, are permitted provided that the following conditions
|
# modification, are permitted provided that the following conditions
|
||||||
# are met:
|
# are met:
|
||||||
#
|
#
|
||||||
# 1. Redistributions of source code must retain the above copyright
|
# 1. Redistributions of source code must retain the above copyright
|
||||||
# notice, this list of conditions and the following disclaimer.
|
# notice, this list of conditions and the following disclaimer.
|
||||||
# 2. Redistributions in binary form must reproduce the above copyright
|
# 2. Redistributions in binary form must reproduce the above copyright
|
||||||
# notice, this list of conditions and the following disclaimer in
|
# notice, this list of conditions and the following disclaimer in
|
||||||
# the documentation and/or other materials provided with the
|
# the documentation and/or other materials provided with the
|
||||||
# distribution.
|
# distribution.
|
||||||
# 3. Neither the name PX4 nor the names of its contributors may be
|
# 3. Neither the name PX4 nor the names of its contributors may be
|
||||||
# used to endorse or promote products derived from this software
|
# used to endorse or promote products derived from this software
|
||||||
# without specific prior written permission.
|
# without specific prior written permission.
|
||||||
#
|
#
|
||||||
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||||
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||||
# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
|
# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
|
||||||
# FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
|
# FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
|
||||||
# COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
|
# COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
|
||||||
# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
|
# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
|
||||||
# BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
|
# BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
|
||||||
# OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
|
# OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
|
||||||
# AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
# AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||||
# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
|
# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
|
||||||
# ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
# ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||||
# POSSIBILITY OF SUCH DAMAGE.
|
# POSSIBILITY OF SUCH DAMAGE.
|
||||||
#
|
#
|
||||||
############################################################################
|
############################################################################
|
||||||
px4_add_module(
|
px4_add_module(
|
||||||
MODULE examples__px4_simple_app
|
MODULE examples__px4_simple_app
|
||||||
MAIN px4_simple_app
|
MAIN px4_simple_app
|
||||||
STACK_MAIN 2000
|
STACK_MAIN 2000
|
||||||
SRCS
|
SRCS
|
||||||
px4_simple_app.c
|
px4_simple_app.c
|
||||||
DEPENDS
|
DEPENDS
|
||||||
)
|
)
|
||||||
```
|
```
|
||||||
|
|
||||||
The `px4_add_module()` method builds a static library from a module description.
|
The `px4_add_module()` method builds a static library from a module description.
|
||||||
|
|
||||||
- The `MODULE` block is the Firmware-unique name of the module (by convention the module name is prefixed by parent directories back to `src`).
|
- The `MODULE` block is the Firmware-unique name of the module (by convention the module name is prefixed by parent directories back to `src`).
|
||||||
- The `MAIN` block lists the entry point of the module, which registers the command with NuttX so that it can be called from the PX4 shell or SITL console.
|
- The `MAIN` block lists the entry point of the module, which registers the command with NuttX so that it can be called from the PX4 shell or SITL console.
|
||||||
|
|
||||||
:::tip
|
:::tip
|
||||||
The `px4_add_module()` format is documented in [PX4-Autopilot/cmake/px4_add_module.cmake](https://github.com/PX4/PX4-Autopilot/blob/main/cmake/px4_add_module.cmake). <!-- NEED px4_version -->
|
The `px4_add_module()` format is documented in [PX4-Autopilot/cmake/px4_add_module.cmake](https://github.com/PX4/PX4-Autopilot/blob/main/cmake/px4_add_module.cmake). <!-- NEED px4_version -->
|
||||||
|
|
||||||
:::
|
:::
|
||||||
|
|
||||||
::: info
|
::: info
|
||||||
If you specify `DYNAMIC` as an option to `px4_add_module`, a _shared library_ is created instead of a static library on POSIX platforms (these can be loaded without having to recompile PX4, and shared to others as binaries rather than source code).
|
If you specify `DYNAMIC` as an option to `px4_add_module`, a _shared library_ is created instead of a static library on POSIX platforms (these can be loaded without having to recompile PX4, and shared to others as binaries rather than source code).
|
||||||
Your app will not become a builtin command, but ends up in a separate file called `examples__px4_simple_app.px4mod`.
|
Your app will not become a builtin command, but ends up in a separate file called `examples__px4_simple_app.px4mod`.
|
||||||
You can then run your command by loading the file at runtime using the `dyn` command: `dyn ./examples__px4_simple_app.px4mod`
|
You can then run your command by loading the file at runtime using the `dyn` command: `dyn ./examples__px4_simple_app.px4mod`
|
||||||
|
|
||||||
:::
|
:::
|
||||||
|
|
||||||
4. Create and open a new _Kconfig_ definition file named **Kconfig** and define your symbol for naming (see [Kconfig naming convention](../hardware/porting_guide_config.md#px4-kconfig-symbol-naming-convention)).
|
4. Create and open a new _Kconfig_ definition file named **Kconfig** and define your symbol for naming (see [Kconfig naming convention](../hardware/porting_guide_config.md#px4-kconfig-symbol-naming-convention)).
|
||||||
复制下面的文本:
|
复制下面的文本:
|
||||||
|
|
||||||
```
|
```
|
||||||
menuconfig EXAMPLES_PX4_SIMPLE_APP
|
menuconfig EXAMPLES_PX4_SIMPLE_APP
|
||||||
bool "px4_simple_app"
|
bool "px4_simple_app"
|
||||||
default n
|
default n
|
||||||
---help---
|
---help---
|
||||||
Enable support for px4_simple_app
|
Enable support for px4_simple_app
|
||||||
```
|
```
|
||||||
|
|
||||||
## 编译应用程序/固件
|
## 编译应用程序/固件
|
||||||
|
|
||||||
|
|||||||
@@ -347,7 +347,7 @@ CONFIG_DRIVERS_RPM_CAPTURE=y
|
|||||||
Additionally, to enable the module:
|
Additionally, to enable the module:
|
||||||
|
|
||||||
- Set [ICE_EN](../advanced_config/parameter_reference.md#ICE_EN)
|
- Set [ICE_EN](../advanced_config/parameter_reference.md#ICE_EN)
|
||||||
to true and adjust the other `ICE_` module parameters according to your needs.
|
to true and adjust the other `ICE_` module parameters according to your needs.
|
||||||
- Set [RPM_CAP_ENABLE](../advanced_config/parameter_reference.md#RPM_CAP_ENABLE) to true.
|
- Set [RPM_CAP_ENABLE](../advanced_config/parameter_reference.md#RPM_CAP_ENABLE) to true.
|
||||||
|
|
||||||
The module outputs control signals for ignition, throttle, and choke,
|
The module outputs control signals for ignition, throttle, and choke,
|
||||||
@@ -367,8 +367,8 @@ The state machine:
|
|||||||
|
|
||||||
- Checks if [Rpm.msg](../msg_docs/Rpm.md) is updated to know if the engine is running
|
- Checks if [Rpm.msg](../msg_docs/Rpm.md) is updated to know if the engine is running
|
||||||
- Allows for user inputs from:
|
- Allows for user inputs from:
|
||||||
- AUX{N}
|
- AUX{N}
|
||||||
- Arming state in [VehicleStatus.msg](../msg_docs/VehicleStatus.md)
|
- Arming state in [VehicleStatus.msg](../msg_docs/VehicleStatus.md)
|
||||||
|
|
||||||
The module publishes [InternalCombustionEngineControl.msg](../msg_docs/InternalCombustionEngineControl.md).
|
The module publishes [InternalCombustionEngineControl.msg](../msg_docs/InternalCombustionEngineControl.md).
|
||||||
|
|
||||||
@@ -484,7 +484,7 @@ The normal log is always a superset of the mission log.
|
|||||||
The implementation uses two threads:
|
The implementation uses two threads:
|
||||||
|
|
||||||
- The main thread, running at a fixed rate (or polling on a topic if started with -p) and checking for
|
- The main thread, running at a fixed rate (or polling on a topic if started with -p) and checking for
|
||||||
data updates
|
data updates
|
||||||
- The writer thread, writing data to the file
|
- The writer thread, writing data to the file
|
||||||
|
|
||||||
In between there is a write buffer with configurable size (and another fixed-size buffer for
|
In between there is a write buffer with configurable size (and another fixed-size buffer for
|
||||||
@@ -688,9 +688,9 @@ There are 2 environment variables used for configuration: `replay`, which must b
|
|||||||
the log file to be replayed. The second is the mode, specified via `replay_mode`:
|
the log file to be replayed. The second is the mode, specified via `replay_mode`:
|
||||||
|
|
||||||
- `replay_mode=ekf2`: specific EKF2 replay mode. It can only be used with the ekf2 module, but allows the replay
|
- `replay_mode=ekf2`: specific EKF2 replay mode. It can only be used with the ekf2 module, but allows the replay
|
||||||
to run as fast as possible.
|
to run as fast as possible.
|
||||||
- Generic otherwise: this can be used to replay any module(s), but the replay will be done with the same speed as the
|
- Generic otherwise: this can be used to replay any module(s), but the replay will be done with the same speed as the
|
||||||
log was recorded.
|
log was recorded.
|
||||||
|
|
||||||
The module is typically used together with uORB publisher rules, to specify which messages should be replayed.
|
The module is typically used together with uORB publisher rules, to specify which messages should be replayed.
|
||||||
The replay module will just publish all messages that are found in the log. It also applies the parameters from
|
The replay module will just publish all messages that are found in the log. It also applies the parameters from
|
||||||
@@ -842,12 +842,12 @@ it into a more usable form, and publishes it for the rest of the system.
|
|||||||
The provided functionality includes:
|
The provided functionality includes:
|
||||||
|
|
||||||
- Read the output from the sensor drivers (`SensorGyro`, etc.).
|
- Read the output from the sensor drivers (`SensorGyro`, etc.).
|
||||||
If there are multiple of the same type, do voting and failover handling.
|
If there are multiple of the same type, do voting and failover handling.
|
||||||
Then apply the board rotation and temperature calibration (if enabled). And finally publish the data; one of the
|
Then apply the board rotation and temperature calibration (if enabled). And finally publish the data; one of the
|
||||||
topics is `SensorCombined`, used by many parts of the system.
|
topics is `SensorCombined`, used by many parts of the system.
|
||||||
- Make sure the sensor drivers get the updated calibration parameters (scale & offset) when the parameters change or
|
- Make sure the sensor drivers get the updated calibration parameters (scale & offset) when the parameters change or
|
||||||
on startup. The sensor drivers use the ioctl interface for parameter updates. For this to work properly, the
|
on startup. The sensor drivers use the ioctl interface for parameter updates. For this to work properly, the
|
||||||
sensor drivers must already be running when `sensors` is started.
|
sensor drivers must already be running when `sensors` is started.
|
||||||
- Do sensor consistency checks and publish the `SensorsStatusImu` topic.
|
- Do sensor consistency checks and publish the `SensorsStatusImu` topic.
|
||||||
|
|
||||||
### 实现
|
### 实现
|
||||||
|
|||||||
@@ -25,38 +25,38 @@ Other examples in Python can be found here: [integrationtests/python_src/px4_it/
|
|||||||
|
|
||||||
1. Open the terminal and go to `~/catkin_ws/src` directory
|
1. Open the terminal and go to `~/catkin_ws/src` directory
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
roscd # Should cd into ~/catkin_ws/devel
|
roscd # Should cd into ~/catkin_ws/devel
|
||||||
cd ..
|
cd ..
|
||||||
cd src
|
cd src
|
||||||
```
|
```
|
||||||
|
|
||||||
2. In the `~/catkin_ws/src` directory create a new package named `offboard_py` (in this case) with the `rospy` dependency:
|
2. In the `~/catkin_ws/src` directory create a new package named `offboard_py` (in this case) with the `rospy` dependency:
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
catkin_create_pkg offboard_py rospy
|
catkin_create_pkg offboard_py rospy
|
||||||
```
|
```
|
||||||
|
|
||||||
3. Build the new package in the `~/catkin_ws/` directory:
|
3. Build the new package in the `~/catkin_ws/` directory:
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
cd .. # Assuming previous directory to be ~/catkin_ws/src
|
cd .. # Assuming previous directory to be ~/catkin_ws/src
|
||||||
catkin build
|
catkin build
|
||||||
source devel/setup.bash
|
source devel/setup.bash
|
||||||
```
|
```
|
||||||
|
|
||||||
4. 您现在应该能够通过使用以下方法切换至包目录:
|
4. 您现在应该能够通过使用以下方法切换至包目录:
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
roscd offboard_py
|
roscd offboard_py
|
||||||
```
|
```
|
||||||
|
|
||||||
5. To store your Python files, create a new folder called `/scripts` on the package:
|
5. To store your Python files, create a new folder called `/scripts` on the package:
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
mkdir scripts
|
mkdir scripts
|
||||||
cd scripts
|
cd scripts
|
||||||
```
|
```
|
||||||
|
|
||||||
## 代码
|
## 代码
|
||||||
|
|
||||||
|
|||||||
@@ -37,63 +37,63 @@ This is needed because, by default, you cannot arm a vehicle without a connectio
|
|||||||
|
|
||||||
2. 使用以下方法创建并切换至新的 colcon工作目录:
|
2. 使用以下方法创建并切换至新的 colcon工作目录:
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
mkdir -p ~/ws_offboard_control/src/
|
mkdir -p ~/ws_offboard_control/src/
|
||||||
cd ~/ws_offboard_control/src/
|
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. 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!):
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
git clone https://github.com/PX4/px4_msgs.git
|
git clone https://github.com/PX4/px4_msgs.git
|
||||||
# checkout the matching release branch if not using PX4 main.
|
# checkout the matching release branch if not using PX4 main.
|
||||||
```
|
```
|
||||||
|
|
||||||
4. Clone the example repository [px4_ros_com](https://github.com/PX4/px4_ros_com) to the `/src` directory:
|
4. Clone the example repository [px4_ros_com](https://github.com/PX4/px4_ros_com) to the `/src` directory:
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
git clone https://github.com/PX4/px4_ros_com.git
|
git clone https://github.com/PX4/px4_ros_com.git
|
||||||
```
|
```
|
||||||
|
|
||||||
5. Source the ROS 2 development environment into the current terminal and compile the workspace using `colcon`:
|
5. Source the ROS 2 development environment into the current terminal and compile the workspace using `colcon`:
|
||||||
|
|
||||||
:::: tabs
|
:::: tabs
|
||||||
|
|
||||||
::: tab humble
|
::: tab humble
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
cd ..
|
cd ..
|
||||||
source /opt/ros/humble/setup.bash
|
source /opt/ros/humble/setup.bash
|
||||||
colcon build
|
colcon build
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
:::
|
:::
|
||||||
|
|
||||||
::: tab foxy
|
::: tab foxy
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
cd ..
|
cd ..
|
||||||
source /opt/ros/foxy/setup.bash
|
source /opt/ros/foxy/setup.bash
|
||||||
colcon build
|
colcon build
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
:::
|
:::
|
||||||
|
|
||||||
::::
|
::::
|
||||||
|
|
||||||
6. Source the `local_setup.bash`:
|
6. Source the `local_setup.bash`:
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
source install/local_setup.bash
|
source install/local_setup.bash
|
||||||
```
|
```
|
||||||
|
|
||||||
7. 启动例程。
|
7. 启动例程。
|
||||||
|
|
||||||
```
|
```
|
||||||
ros2 run px4_ros_com offboard_control
|
ros2 run px4_ros_com offboard_control
|
||||||
```
|
```
|
||||||
|
|
||||||
飞行器将解锁、起飞至5米并悬停等待(永久)。
|
飞行器将解锁、起飞至5米并悬停等待(永久)。
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user