mirror of
https://github.com/PX4/PX4-Autopilot.git
synced 2026-05-24 07:09:48 +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:
|
||||
|
||||
```cpp
|
||||
#include <px4_platform_common/module_params.h>
|
||||
```
|
||||
```cpp
|
||||
#include <px4_platform_common/module_params.h>
|
||||
```
|
||||
|
||||
- **parameter_update.h** to access the uORB `parameter_update` message:
|
||||
|
||||
```cpp
|
||||
#include <uORB/topics/parameter_update.h>
|
||||
```
|
||||
```cpp
|
||||
#include <uORB/topics/parameter_update.h>
|
||||
```
|
||||
|
||||
- **Subscription.hpp** for the uORB C++ subscription API:
|
||||
|
||||
```cpp
|
||||
#include <uORB/Subscription.hpp>
|
||||
```
|
||||
```cpp
|
||||
#include <uORB/Subscription.hpp>
|
||||
```
|
||||
|
||||
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).
|
||||
- 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()`.
|
||||
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.
|
||||
|
||||
@@ -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).
|
||||
- 通过添加到 cmake 构建系统中注册一个 YAML 文件
|
||||
|
||||
```cmake
|
||||
MODULE_CONFIG
|
||||
module.yaml
|
||||
```
|
||||
```cmake
|
||||
MODULE_CONFIG
|
||||
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 元数据
|
||||
|
||||
|
||||
@@ -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:
|
||||
|
||||
- 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
|
||||
- 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 22.9mm (without Jetson and 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)
|
||||
|
||||
- 重量
|
||||
- 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
|
||||
|
||||
- Connected to both Jetson & Autopilot via Ethernet switch (RTL8367S)
|
||||
- Ethernet Switch powered by the same circuit as the Pixhawk
|
||||
- 8-pin JST-GH
|
||||
- RJ45
|
||||
- Connected to both Jetson & Autopilot via Ethernet switch (RTL8367S)
|
||||
- Ethernet Switch powered by the same circuit as the Pixhawk
|
||||
- 8-pin JST-GH
|
||||
- RJ45
|
||||
|
||||
- 2x MIPI CSI Camera Inputs
|
||||
|
||||
- 4 Lanes each
|
||||
- 22-Pin Raspberry Pi Cam FFC
|
||||
- 4 Lanes each
|
||||
- 22-Pin Raspberry Pi Cam FFC
|
||||
|
||||
- 2x USB 3.0 Host Port
|
||||
|
||||
- USB A
|
||||
- 5A Current Limit
|
||||
- USB A
|
||||
- 5A Current Limit
|
||||
|
||||
- 2x USB 2.0 Host Port
|
||||
|
||||
- 5-Pin JST-GH
|
||||
- 0A Current Limit
|
||||
- 5-Pin JST-GH
|
||||
- 0A Current Limit
|
||||
|
||||
- USB 2.0 for Programming/Debugging
|
||||
|
||||
- USB-C
|
||||
- USB-C
|
||||
|
||||
- 2 Key M 2242/2280 for NVMe SSD
|
||||
|
||||
- PCIEx4
|
||||
- PCIEx4
|
||||
|
||||
- 2 Key E 2230 for WiFi/BT
|
||||
|
||||
- PCIEx2
|
||||
- USB
|
||||
- UART
|
||||
- I2S
|
||||
- PCIEx2
|
||||
- USB
|
||||
- UART
|
||||
- I2S
|
||||
|
||||
- Mini HDMI Out
|
||||
|
||||
- 4x GPIO
|
||||
|
||||
- 6-pin JST-GH
|
||||
- 6-pin JST-GH
|
||||
|
||||
- CAN Port
|
||||
|
||||
- Connected to Autopilot's CAN2 (4 Pin JST-GH)
|
||||
- Connected to Autopilot's CAN2 (4 Pin JST-GH)
|
||||
|
||||
- SPI Port
|
||||
|
||||
- 7-Pin JST-GH
|
||||
- 7-Pin JST-GH
|
||||
|
||||
- I2C Port
|
||||
|
||||
- 4-Pin JST-GH
|
||||
- 4-Pin JST-GH
|
||||
|
||||
- I2S Port
|
||||
|
||||
- 7-Pin JST-GH
|
||||
- 7-Pin JST-GH
|
||||
|
||||
- 2x UART Port
|
||||
|
||||
- 1 for debug
|
||||
- 1 connected to Autopilot's telem2
|
||||
- 1 for debug
|
||||
- 1 connected to Autopilot's telem2
|
||||
|
||||
- Fan Power Port
|
||||
|
||||
@@ -129,13 +129,13 @@ This information comes from the [Holybro Pixhawk-Jetson Baseboard Documentation]
|
||||
|
||||
- Pixhawk Autopilot Bus Interface
|
||||
|
||||
- 100 Pin Hirose DF40
|
||||
- 50 Pin Hirose DF40
|
||||
- 100 Pin Hirose DF40
|
||||
- 50 Pin Hirose DF40
|
||||
|
||||
- Redundant Digital Power Module Inputs
|
||||
|
||||
- I2C Power Monitor Support
|
||||
- 2x 6-Pin Molex CLIK-Mate
|
||||
- I2C Power Monitor Support
|
||||
- 2x 6-Pin Molex CLIK-Mate
|
||||
|
||||
- Power Path Selector
|
||||
|
||||
@@ -143,68 +143,68 @@ This information comes from the [Holybro Pixhawk-Jetson Baseboard Documentation]
|
||||
|
||||
- 额定电压
|
||||
|
||||
- Max input voltage: 6V
|
||||
- USB 电源输入:4.75~5.25V
|
||||
- Max input voltage: 6V
|
||||
- USB 电源输入:4.75~5.25V
|
||||
|
||||
- Full GPS Plus Safety Switch Port
|
||||
|
||||
- 10-Pin JST-GH
|
||||
- 10-Pin JST-GH
|
||||
|
||||
- Secondary (GPS2) Port
|
||||
|
||||
- 6-Pin JST-GH
|
||||
- 6-Pin JST-GH
|
||||
|
||||
- 2x CAN Ports
|
||||
|
||||
- 4-Pin JST-GH
|
||||
- 4-Pin JST-GH
|
||||
|
||||
- 3x Telemetry Ports with Flow Control
|
||||
|
||||
- 2x 6-Pin JST-GH
|
||||
- 1 is connected to Jetson's `UART1` Port
|
||||
- 2x 6-Pin JST-GH
|
||||
- 1 is connected to Jetson's `UART1` Port
|
||||
|
||||
- 16 PWM Outputs
|
||||
|
||||
- 2x 10-Pin JST-GH
|
||||
- 2x 10-Pin JST-GH
|
||||
|
||||
- UART4 & I2C Port
|
||||
|
||||
- 6-Pin JST-GH
|
||||
- 6-Pin JST-GH
|
||||
|
||||
- 2x Gigabit Ethernet Port
|
||||
|
||||
- Connected to both Jetson & Autopilot via Ethernet switch (RTL8367S)
|
||||
- 8-Pin JST-GH
|
||||
- RJ45
|
||||
- Connected to both Jetson & Autopilot via Ethernet switch (RTL8367S)
|
||||
- 8-Pin JST-GH
|
||||
- RJ45
|
||||
|
||||
- AD & IO
|
||||
|
||||
- 8-Pin JST-GH
|
||||
- 8-Pin JST-GH
|
||||
|
||||
- USB 2.0
|
||||
|
||||
- USB-C
|
||||
- 4-Pin JST-GH
|
||||
- USB-C
|
||||
- 4-Pin JST-GH
|
||||
|
||||
- DSM Input
|
||||
|
||||
- 3-Pin JST-ZH 1.5mm Pitch
|
||||
- 3-Pin JST-ZH 1.5mm Pitch
|
||||
|
||||
- RC In
|
||||
|
||||
- PPM/SBUS
|
||||
- 5-Pin JST-GH
|
||||
- PPM/SBUS
|
||||
- 5-Pin JST-GH
|
||||
|
||||
- SPI Port
|
||||
|
||||
- External Sensor Bus (SPI5)
|
||||
- 11-Pin JST-GH
|
||||
- External Sensor Bus (SPI5)
|
||||
- 11-Pin JST-GH
|
||||
|
||||
- 2x Debug Port
|
||||
|
||||
- 1 for FMU
|
||||
- 1 for IO
|
||||
- 10-Pin JST-SH
|
||||
- 1 for FMU
|
||||
- 1 for IO
|
||||
- 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)
|
||||
- Voltage Rating: 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:
|
||||
|
||||
@@ -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 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.
|
||||
|
||||

|
||||
@@ -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:
|
||||
|
||||
1. Make sure `netplan` is installed.
|
||||
You can check by running the following command:
|
||||
You can check by running the following command:
|
||||
|
||||
```sh
|
||||
netplan -h
|
||||
```
|
||||
```sh
|
||||
netplan -h
|
||||
```
|
||||
|
||||
If not, install it using the commands:
|
||||
If not, install it using the commands:
|
||||
|
||||
```sh
|
||||
sudo apt update
|
||||
sudo apt install netplan.io
|
||||
```
|
||||
```sh
|
||||
sudo apt update
|
||||
sudo apt install netplan.io
|
||||
```
|
||||
|
||||
2. Check `system_networkd` is running:
|
||||
|
||||
```sh
|
||||
sudo systemctl status systemd-networkd
|
||||
```
|
||||
```sh
|
||||
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
|
||||
● systemd-networkd.service - Network Configuration
|
||||
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
|
||||
TriggeredBy: ● systemd-networkd.socket
|
||||
Docs: man:systemd-networkd.service(8)
|
||||
Main PID: 2452 (systemd-network)
|
||||
Status: "Processing requests..."
|
||||
Tasks: 1 (limit: 18457)
|
||||
Memory: 2.7M
|
||||
CPU: 157ms
|
||||
CGroup: /system.slice/systemd-networkd.service
|
||||
└─2452 /lib/systemd/systemd-networkd
|
||||
```sh
|
||||
● systemd-networkd.service - Network Configuration
|
||||
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
|
||||
TriggeredBy: ● systemd-networkd.socket
|
||||
Docs: man:systemd-networkd.service(8)
|
||||
Main PID: 2452 (systemd-network)
|
||||
Status: "Processing requests..."
|
||||
Tasks: 1 (limit: 18457)
|
||||
Memory: 2.7M
|
||||
CPU: 157ms
|
||||
CGroup: /system.slice/systemd-networkd.service
|
||||
└─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]: wlan0: 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[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: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: 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: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]: eth0: Gained IPv6LL
|
||||
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-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: 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: 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
|
||||
sudo systemctl start systemd-networkd
|
||||
sudo systemctl enable systemd-networkd
|
||||
```
|
||||
```sh
|
||||
sudo systemctl start systemd-networkd
|
||||
sudo systemctl enable systemd-networkd
|
||||
```
|
||||
|
||||
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).
|
||||
Below we use `nano` to open the file, but you can use your preferred text editor:
|
||||
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:
|
||||
|
||||
```sh
|
||||
sudo nano /etc/netplan/01-netcfg.yaml
|
||||
```
|
||||
```sh
|
||||
sudo nano /etc/netplan/01-netcfg.yaml
|
||||
```
|
||||
|
||||
4. Modify the yaml configuration, by overwriting the contents with the following information and then saving:
|
||||
|
||||
```sh
|
||||
network:
|
||||
version: 2
|
||||
renderer: networkd
|
||||
ethernets:
|
||||
eth0:
|
||||
dhcp4: no
|
||||
addresses:
|
||||
- 10.41.10.1/24
|
||||
routes:
|
||||
- to: 0.0.0.0/0
|
||||
via: 10.41.10.254
|
||||
nameservers:
|
||||
addresses:
|
||||
- 10.41.10.254
|
||||
```
|
||||
```sh
|
||||
network:
|
||||
version: 2
|
||||
renderer: networkd
|
||||
ethernets:
|
||||
eth0:
|
||||
dhcp4: no
|
||||
addresses:
|
||||
- 10.41.10.1/24
|
||||
routes:
|
||||
- to: 0.0.0.0/0
|
||||
via: 10.41.10.254
|
||||
nameservers:
|
||||
addresses:
|
||||
- 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:
|
||||
|
||||
```sh
|
||||
sudo netplan apply
|
||||
```
|
||||
```sh
|
||||
sudo netplan apply
|
||||
```
|
||||
|
||||
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:
|
||||
@@ -1221,15 +1221,15 @@ Assuming the client is set up as defined above:
|
||||
|
||||
- (Serial connection) Start the agent on `/dev/ttyTHS1`:
|
||||
|
||||
```sh
|
||||
sudo MicroXRCEAgent serial --dev /dev/ttyTHS1 -b 921600
|
||||
```
|
||||
```sh
|
||||
sudo MicroXRCEAgent serial --dev /dev/ttyTHS1 -b 921600
|
||||
```
|
||||
|
||||
- (Ethernet) Start the agent on UDP port `8888`:
|
||||
|
||||
```sh
|
||||
MicroXRCEAgent udp4 -p 8888
|
||||
```
|
||||
```sh
|
||||
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:
|
||||
|
||||
|
||||
+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:
|
||||
|
||||
- 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.
|
||||
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):
|
||||
|
||||
- [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)
|
||||
|
||||
相关章节:
|
||||
@@ -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).
|
||||
|
||||
::: info
|
||||
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.
|
||||
::: info
|
||||
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.
|
||||
|
||||
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 Guide (Manual/Detailed)](../config_mc/pid_tuning_guide_multicopter.md) — Manual tuning with detailed explanation.
|
||||
- [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.
|
||||
|
||||
|
||||
:::
|
||||
@@ -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 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)
|
||||
|
||||
@@ -167,7 +167,7 @@ Yes but it must be physically feasible. E.g. if you make a quadrotor where all m
|
||||
- [飞控外设](../peripherals/index.md) - 设置特定传感器、可选传感器、执行器等。
|
||||
- [Advanced Configuration](../advanced_config/index.md) - Factory/OEM calibration, configuring advanced features, less-common configuration.
|
||||
- Vehicle-Centric Config/Tuning:
|
||||
- **Multicopter Config/Tuning**
|
||||
- [直升机配置/调参](../config_heli/index.md)
|
||||
- [Fixed Wing Config/Tuning](../config_fw/index.md)
|
||||
- [VTOL 配置/调参](../config_vtol/index.md)
|
||||
- **Multicopter Config/Tuning**
|
||||
- [直升机配置/调参](../config_heli/index.md)
|
||||
- [Fixed Wing Config/Tuning](../config_fw/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:
|
||||
|
||||
- X500V2 Frame Kit
|
||||
- Body - Full Carbon Fiber Top & Bottom plate (144 x 144mm, 2mm thick)
|
||||
- Arm - High strength & ultra-lightweight 16mm carbon fiber tubes
|
||||
- Landing gear - 16mm & 10mm diameter carbon fiber tubes
|
||||
- Platform board - With mounting holes for GPS & popular companion computer
|
||||
- Dual 10mm Ø rod x 250 mm long rail mounting system
|
||||
- Battery mount with two Battery Straps
|
||||
- Hand tools for installation
|
||||
- Body - Full Carbon Fiber Top & Bottom plate (144 x 144mm, 2mm thick)
|
||||
- Arm - High strength & ultra-lightweight 16mm carbon fiber tubes
|
||||
- Landing gear - 16mm & 10mm diameter carbon fiber tubes
|
||||
- Platform board - With mounting holes for GPS & popular companion computer
|
||||
- Dual 10mm Ø rod x 250 mm long rail mounting system
|
||||
- Battery mount with two Battery Straps
|
||||
- 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 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).
|
||||
@@ -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)
|
||||
|
||||
1. Start by assembling the payload & battery holder.
|
||||
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.
|
||||
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.
|
||||
|
||||

|
||||

|
||||
|
||||
_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.
|
||||
|
||||
You will need the parts as shown in Figure 4.
|
||||
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)
|
||||
You will need the parts as shown in Figure 4.
|
||||
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)
|
||||
|
||||

|
||||

|
||||
|
||||
_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.
|
||||
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.
|
||||
Do not forget to tighten them back again.
|
||||
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.
|
||||
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.
|
||||
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.
|
||||
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.
|
||||
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 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.
|
||||
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.
|
||||
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.
|
||||
|
||||

|
||||

|
||||
|
||||
_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.
|
||||
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.
|
||||
|
||||
<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.
|
||||
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.
|
||||
|
||||
@@ -204,14 +204,14 @@ First update the firmware, airframe, and actuator mappings:
|
||||
|
||||
- [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)
|
||||
- You should not need to update the vehicle geometry (as this is a preconfigured airframe).
|
||||
- Assign actuator functions to outputs to match your wiring.
|
||||
- Test the configuration using the sliders.
|
||||
- You should not need to update the vehicle geometry (as this is a preconfigured airframe).
|
||||
- Assign actuator functions to outputs to match your wiring.
|
||||
- Test the configuration using the sliders.
|
||||
|
||||
Then perform the mandatory setup/calibration:
|
||||
|
||||
|
||||
@@ -20,12 +20,12 @@ Key airframe features:
|
||||
- Removable V tail or conventional tail options included
|
||||
- Threaded inserts in the wings and fuselage top for external mounting
|
||||
- Numerous mounting features
|
||||
- Top antenna hole
|
||||
- Top GPS cover
|
||||
- Side "T" antenna mounts
|
||||
- Rear electronics tray
|
||||
- Front facing "action cam" cutout
|
||||
- Front facing FPV camera cutout
|
||||
- Top antenna hole
|
||||
- Top GPS cover
|
||||
- Side "T" antenna mounts
|
||||
- Rear electronics tray
|
||||
- Front facing "action cam" cutout
|
||||
- Front facing FPV camera cutout
|
||||
- Removable wings
|
||||
- Low stall speed
|
||||
- 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)
|
||||
|
||||
- [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
|
||||
- Holybro Pixhawk 5x carrier mount
|
||||
- FPV pod and camera mount
|
||||
- Pitot static probe "plug" adapter
|
||||
- ARK6X carrier mount
|
||||
- Holybro Pixhawk 5x carrier mount
|
||||
- FPV pod and camera mount
|
||||
- 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)
|
||||
|
||||
@@ -426,15 +426,15 @@ Prior to the first flight, a comprehensive preflight must be conducted.
|
||||
I recommend checking the following items:
|
||||
|
||||
- Sensor calibration (QGC)
|
||||
- Mag calibration
|
||||
- Accelerometer calibration
|
||||
- Airspeed calibration
|
||||
- Level horizon calibration
|
||||
- Mag calibration
|
||||
- Accelerometer calibration
|
||||
- Airspeed calibration
|
||||
- Level horizon calibration
|
||||
- Check control surface deflection
|
||||
- Right stick -> Right aileron goes up, left aileron goes down
|
||||
- Left stick -> Left aileron goes up, right aileron goes down
|
||||
- Stick back -> elevator goes up
|
||||
-Stick forward -> elevator goes down
|
||||
-Stick forward -> elevator goes down
|
||||
- Left rudder -> Rudder goes left
|
||||
- Right rudder -> Rudder goes right
|
||||
- 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:
|
||||
|
||||
- [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).
|
||||
- [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).
|
||||
- Otherwise select a "Generic Airframe" that matches your vehicle.
|
||||
- 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.
|
||||
|
||||
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).
|
||||
|
||||
+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**:
|
||||
|
||||
- Copy in the default header to the top of the page.
|
||||
该注释应出现在所有贡献的文件中!
|
||||
- Copy in the default header to the top of the page.
|
||||
该注释应出现在所有贡献的文件中!
|
||||
|
||||
```c
|
||||
/****************************************************************************
|
||||
*
|
||||
* Copyright (c) 2012-2022 PX4 Development Team. All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
*
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in
|
||||
* the documentation and/or other materials provided with the
|
||||
* distribution.
|
||||
* 3. Neither the name PX4 nor the names of its contributors may be
|
||||
* used to endorse or promote products derived from this software
|
||||
* without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
|
||||
* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
|
||||
* COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
|
||||
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
|
||||
* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
|
||||
* OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
|
||||
* AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
|
||||
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
* POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
****************************************************************************/
|
||||
```
|
||||
```c
|
||||
/****************************************************************************
|
||||
*
|
||||
* Copyright (c) 2012-2022 PX4 Development Team. All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
*
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in
|
||||
* the documentation and/or other materials provided with the
|
||||
* distribution.
|
||||
* 3. Neither the name PX4 nor the names of its contributors may be
|
||||
* used to endorse or promote products derived from this software
|
||||
* without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
|
||||
* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
|
||||
* COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
|
||||
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
|
||||
* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
|
||||
* OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
|
||||
* AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
|
||||
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
* POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
****************************************************************************/
|
||||
```
|
||||
|
||||
- 将下面的代码复制到头部注释的下方,
|
||||
该注释应出现在所有贡献的文件中!
|
||||
- 将下面的代码复制到头部注释的下方,
|
||||
该注释应出现在所有贡献的文件中!
|
||||
|
||||
```c
|
||||
/**
|
||||
* @file px4_simple_app.c
|
||||
* Minimal application example for PX4 autopilot
|
||||
*
|
||||
* @author Example User <mail@example.com>
|
||||
*/
|
||||
```c
|
||||
/**
|
||||
* @file px4_simple_app.c
|
||||
* Minimal application example for PX4 autopilot
|
||||
*
|
||||
* @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[])
|
||||
{
|
||||
PX4_INFO("Hello Sky!");
|
||||
return OK;
|
||||
}
|
||||
```
|
||||
int px4_simple_app_main(int argc, char *argv[])
|
||||
{
|
||||
PX4_INFO("Hello Sky!");
|
||||
return OK;
|
||||
}
|
||||
```
|
||||
|
||||
:::tip
|
||||
The main function must be named `<module_name>_main` and exported from the module as shown.
|
||||
:::tip
|
||||
The main function must be named `<module_name>_main` and exported from the module as shown.
|
||||
|
||||
:::
|
||||
|
||||
:::tip
|
||||
`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`.
|
||||
Warnings and errors are additionally added to the [ULog](../dev_log/ulog_file_format.md) and shown on [Flight Review](https://logs.px4.io/).
|
||||
:::tip
|
||||
`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`.
|
||||
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**.
|
||||
复制下面的文本:
|
||||
复制下面的文本:
|
||||
|
||||
```cmake
|
||||
############################################################################
|
||||
#
|
||||
# Copyright (c) 2015 PX4 Development Team. All rights reserved.
|
||||
#
|
||||
# Redistribution and use in source and binary forms, with or without
|
||||
# modification, are permitted provided that the following conditions
|
||||
# are met:
|
||||
#
|
||||
# 1. Redistributions of source code must retain the above copyright
|
||||
# notice, this list of conditions and the following disclaimer.
|
||||
# 2. Redistributions in binary form must reproduce the above copyright
|
||||
# notice, this list of conditions and the following disclaimer in
|
||||
# the documentation and/or other materials provided with the
|
||||
# distribution.
|
||||
# 3. Neither the name PX4 nor the names of its contributors may be
|
||||
# used to endorse or promote products derived from this software
|
||||
# without specific prior written permission.
|
||||
#
|
||||
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
|
||||
# FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
|
||||
# COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
|
||||
# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
|
||||
# BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
|
||||
# OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
|
||||
# AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
|
||||
# ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
# POSSIBILITY OF SUCH DAMAGE.
|
||||
#
|
||||
############################################################################
|
||||
px4_add_module(
|
||||
MODULE examples__px4_simple_app
|
||||
MAIN px4_simple_app
|
||||
STACK_MAIN 2000
|
||||
SRCS
|
||||
px4_simple_app.c
|
||||
DEPENDS
|
||||
)
|
||||
```
|
||||
```cmake
|
||||
############################################################################
|
||||
#
|
||||
# Copyright (c) 2015 PX4 Development Team. All rights reserved.
|
||||
#
|
||||
# Redistribution and use in source and binary forms, with or without
|
||||
# modification, are permitted provided that the following conditions
|
||||
# are met:
|
||||
#
|
||||
# 1. Redistributions of source code must retain the above copyright
|
||||
# notice, this list of conditions and the following disclaimer.
|
||||
# 2. Redistributions in binary form must reproduce the above copyright
|
||||
# notice, this list of conditions and the following disclaimer in
|
||||
# the documentation and/or other materials provided with the
|
||||
# distribution.
|
||||
# 3. Neither the name PX4 nor the names of its contributors may be
|
||||
# used to endorse or promote products derived from this software
|
||||
# without specific prior written permission.
|
||||
#
|
||||
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
|
||||
# FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
|
||||
# COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
|
||||
# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
|
||||
# BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
|
||||
# OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
|
||||
# AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
|
||||
# ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
# POSSIBILITY OF SUCH DAMAGE.
|
||||
#
|
||||
############################################################################
|
||||
px4_add_module(
|
||||
MODULE examples__px4_simple_app
|
||||
MAIN px4_simple_app
|
||||
STACK_MAIN 2000
|
||||
SRCS
|
||||
px4_simple_app.c
|
||||
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 `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 `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.
|
||||
|
||||
:::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 -->
|
||||
:::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 -->
|
||||
|
||||
:::
|
||||
|
||||
::: 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).
|
||||
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`
|
||||
::: 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).
|
||||
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`
|
||||
|
||||
:::
|
||||
|
||||
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
|
||||
bool "px4_simple_app"
|
||||
default n
|
||||
---help---
|
||||
Enable support for px4_simple_app
|
||||
```
|
||||
```
|
||||
menuconfig EXAMPLES_PX4_SIMPLE_APP
|
||||
bool "px4_simple_app"
|
||||
default n
|
||||
---help---
|
||||
Enable support for px4_simple_app
|
||||
```
|
||||
|
||||
## 编译应用程序/固件
|
||||
|
||||
|
||||
@@ -347,7 +347,7 @@ CONFIG_DRIVERS_RPM_CAPTURE=y
|
||||
Additionally, to enable the module:
|
||||
|
||||
- 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.
|
||||
|
||||
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
|
||||
- Allows for user inputs from:
|
||||
- AUX{N}
|
||||
- Arming state in [VehicleStatus.msg](../msg_docs/VehicleStatus.md)
|
||||
- AUX{N}
|
||||
- Arming state in [VehicleStatus.msg](../msg_docs/VehicleStatus.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 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
|
||||
|
||||
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`:
|
||||
|
||||
- `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
|
||||
log was recorded.
|
||||
log was recorded.
|
||||
|
||||
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
|
||||
@@ -842,12 +842,12 @@ it into a more usable form, and publishes it for the rest of the system.
|
||||
The provided functionality includes:
|
||||
|
||||
- Read the output from the sensor drivers (`SensorGyro`, etc.).
|
||||
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
|
||||
topics is `SensorCombined`, used by many parts of the system.
|
||||
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
|
||||
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
|
||||
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.
|
||||
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.
|
||||
- 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
|
||||
|
||||
```sh
|
||||
roscd # Should cd into ~/catkin_ws/devel
|
||||
cd ..
|
||||
cd src
|
||||
```
|
||||
```sh
|
||||
roscd # Should cd into ~/catkin_ws/devel
|
||||
cd ..
|
||||
cd src
|
||||
```
|
||||
|
||||
2. In the `~/catkin_ws/src` directory create a new package named `offboard_py` (in this case) with the `rospy` dependency:
|
||||
|
||||
```sh
|
||||
catkin_create_pkg offboard_py rospy
|
||||
```
|
||||
```sh
|
||||
catkin_create_pkg offboard_py rospy
|
||||
```
|
||||
|
||||
3. Build the new package in the `~/catkin_ws/` directory:
|
||||
|
||||
```sh
|
||||
cd .. # Assuming previous directory to be ~/catkin_ws/src
|
||||
catkin build
|
||||
source devel/setup.bash
|
||||
```
|
||||
```sh
|
||||
cd .. # Assuming previous directory to be ~/catkin_ws/src
|
||||
catkin build
|
||||
source devel/setup.bash
|
||||
```
|
||||
|
||||
4. 您现在应该能够通过使用以下方法切换至包目录:
|
||||
|
||||
```sh
|
||||
roscd offboard_py
|
||||
```
|
||||
```sh
|
||||
roscd offboard_py
|
||||
```
|
||||
|
||||
5. To store your Python files, create a new folder called `/scripts` on the package:
|
||||
|
||||
```sh
|
||||
mkdir scripts
|
||||
cd scripts
|
||||
```
|
||||
```sh
|
||||
mkdir scripts
|
||||
cd scripts
|
||||
```
|
||||
|
||||
## 代码
|
||||
|
||||
|
||||
@@ -37,63 +37,63 @@ This is needed because, by default, you cannot arm a vehicle without a connectio
|
||||
|
||||
2. 使用以下方法创建并切换至新的 colcon工作目录:
|
||||
|
||||
```sh
|
||||
mkdir -p ~/ws_offboard_control/src/
|
||||
cd ~/ws_offboard_control/src/
|
||||
```
|
||||
```sh
|
||||
mkdir -p ~/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!):
|
||||
|
||||
```sh
|
||||
git clone https://github.com/PX4/px4_msgs.git
|
||||
# checkout the matching release branch if not using PX4 main.
|
||||
```
|
||||
```sh
|
||||
git clone https://github.com/PX4/px4_msgs.git
|
||||
# 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:
|
||||
|
||||
```sh
|
||||
git clone https://github.com/PX4/px4_ros_com.git
|
||||
```
|
||||
```sh
|
||||
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`:
|
||||
|
||||
:::: tabs
|
||||
:::: tabs
|
||||
|
||||
::: tab humble
|
||||
::: tab humble
|
||||
|
||||
```sh
|
||||
cd ..
|
||||
source /opt/ros/humble/setup.bash
|
||||
colcon build
|
||||
```
|
||||
```sh
|
||||
cd ..
|
||||
source /opt/ros/humble/setup.bash
|
||||
colcon build
|
||||
```
|
||||
|
||||
|
||||
:::
|
||||
|
||||
::: tab foxy
|
||||
::: tab foxy
|
||||
|
||||
```sh
|
||||
cd ..
|
||||
source /opt/ros/foxy/setup.bash
|
||||
colcon build
|
||||
```
|
||||
```sh
|
||||
cd ..
|
||||
source /opt/ros/foxy/setup.bash
|
||||
colcon build
|
||||
```
|
||||
|
||||
|
||||
:::
|
||||
|
||||
::::
|
||||
::::
|
||||
|
||||
6. Source the `local_setup.bash`:
|
||||
|
||||
```sh
|
||||
source install/local_setup.bash
|
||||
```
|
||||
```sh
|
||||
source install/local_setup.bash
|
||||
```
|
||||
|
||||
7. 启动例程。
|
||||
|
||||
```
|
||||
ros2 run px4_ros_com offboard_control
|
||||
```
|
||||
```
|
||||
ros2 run px4_ros_com offboard_control
|
||||
```
|
||||
|
||||
飞行器将解锁、起飞至5米并悬停等待(永久)。
|
||||
|
||||
|
||||
Reference in New Issue
Block a user