mirror of
https://github.com/PX4/PX4-Autopilot.git
synced 2026-05-28 10:46:33 +08:00
New Crowdin translations - zh-CN (#24563)
Co-authored-by: Crowdin Bot <support+bot@crowdin.com>
This commit is contained in:
@@ -69,15 +69,15 @@ To install the RPi CM4 companion computer:
|
||||
|
||||
1. Disconnect the `FAN` wiring.
|
||||
|
||||

|
||||

|
||||
|
||||
2. Remove these 4 screws on the back side of the baseboard.
|
||||
|
||||

|
||||

|
||||
|
||||
3. Remove the baseboard case, install the CM4, and use the 4 screws to attach it (as shown):
|
||||
|
||||

|
||||

|
||||
|
||||
4. Reattach the cover.
|
||||
|
||||
@@ -115,29 +115,29 @@ To flash a RPi image onto EMMC.
|
||||
|
||||
1. Switch Dip-Switch to `RPI`.
|
||||
|
||||

|
||||

|
||||
|
||||
2. Connect computer to USB-C _CM4 Slave_ port used to power & flash the RPi.
|
||||
|
||||

|
||||

|
||||
|
||||
3. Get `usbboot`, build it and run it.
|
||||
|
||||
```sh
|
||||
sudo apt install libusb-1.0-0-dev
|
||||
git clone --depth=1 https://github.com/raspberrypi/usbboot
|
||||
cd usbboot
|
||||
make
|
||||
sudo ./rpiboot
|
||||
```
|
||||
```sh
|
||||
sudo apt install libusb-1.0-0-dev
|
||||
git clone --depth=1 https://github.com/raspberrypi/usbboot
|
||||
cd usbboot
|
||||
make
|
||||
sudo ./rpiboot
|
||||
```
|
||||
|
||||
4. You can now install your preferred Linux distro using The `rpi-imager`.
|
||||
Make sure you add WiFi and SSH settings (hidden behind the gear/advanced symbol).
|
||||
Make sure you add WiFi and SSH settings (hidden behind the gear/advanced symbol).
|
||||
|
||||
```sh
|
||||
sudo apt install rpi-imager
|
||||
rpi-imager
|
||||
```
|
||||
```sh
|
||||
sudo apt install rpi-imager
|
||||
rpi-imager
|
||||
```
|
||||
|
||||
5. Once done, unplugging USB-C CM4 Slave (this will unmount the volumes, and power off the CM4).
|
||||
|
||||
@@ -146,8 +146,8 @@ To flash a RPi image onto EMMC.
|
||||
7. Power on CM4 by providing power to USB-C CM4 Slave port.
|
||||
|
||||
8. To check if it's booting/working you can either:
|
||||
- Check there is HDMI output
|
||||
- Connect via SSH (if set up in rpi-imager, and WiFi is available).
|
||||
- Check there is HDMI output
|
||||
- Connect via SSH (if set up in rpi-imager, and WiFi is available).
|
||||
|
||||
## Configure PX4 to CM4 MAVLink Serial Connection
|
||||
|
||||
@@ -167,13 +167,13 @@ To enable this MAVLink instance on the FC:
|
||||
|
||||
1. Connect a computer running QGroundControl via USB Type C port on the baseboard labeled `FC`
|
||||
|
||||

|
||||

|
||||
|
||||
2. [Set the parameters](../advanced_config/parameters.md):
|
||||
|
||||
- `MAV_1_CONFIG` = `102`
|
||||
- `MAV_1_MODE = 2`
|
||||
- `SER_TEL2_BAUD` = `921600`
|
||||
- `MAV_1_CONFIG` = `102`
|
||||
- `MAV_1_MODE = 2`
|
||||
- `SER_TEL2_BAUD` = `921600`
|
||||
|
||||
3. Reboot the FC.
|
||||
|
||||
@@ -185,13 +185,13 @@ On the RPi side:
|
||||
|
||||
2. Enable the RPi serial port by running `RPi-config`
|
||||
|
||||
- Go to `3 Interface Options`, then `I6 Serial Port`.
|
||||
Then choose:
|
||||
- `login shell accessible over serial → No`
|
||||
- `serial port hardware enabled` → `Yes`
|
||||
- Go to `3 Interface Options`, then `I6 Serial Port`.
|
||||
Then choose:
|
||||
- `login shell accessible over serial → No`
|
||||
- `serial port hardware enabled` → `Yes`
|
||||
|
||||
3. Finish, and reboot.
|
||||
This will add `enable_uart=1` to `/boot/config.txt`, and remove `console=serial0,115200` from `/boot/cmdline.txt`.
|
||||
This will add `enable_uart=1` to `/boot/config.txt`, and remove `console=serial0,115200` from `/boot/cmdline.txt`.
|
||||
|
||||
4. Now MAVLink traffic should be available on `/dev/serial0` at a baudrate of 921600.
|
||||
|
||||
@@ -201,9 +201,9 @@ On the RPi side:
|
||||
|
||||
2. Install MAVSDK Python:
|
||||
|
||||
```sh
|
||||
python3 -m pip install mavsdk
|
||||
```
|
||||
```sh
|
||||
python3 -m pip install mavsdk
|
||||
```
|
||||
|
||||
3. Copy an example from the [MAVSDK-Python examples](https://github.com/mavlink/MAVSDK-Python/tree/main/examples).
|
||||
|
||||
@@ -247,7 +247,7 @@ Note that we could have used WiFi for the link, but by setting up a dedicated ro
|
||||
|
||||
To set up a local ethernet connection between CM4 and the flight computer, the two Ethernet ports need to be connected using the provided 8 pin to 4 pin connector.
|
||||
|
||||

|
||||

|
||||
|
||||
The pinout of the cable is:
|
||||
|
||||
|
||||
@@ -43,7 +43,7 @@ In most cases the accessible hardware serial ports already have some function (m
|
||||
A safe and easy to set up option is to use an FTDI Chip USB-to-serial adapter board to connect from `TELEM2` on the Pixhawk to the USB port on the companion computer.
|
||||
The `TELEM2` to FTDI wiring map is shown below.
|
||||
|
||||
| TELEM2 | | FTDI | &nbsp; |
|
||||
| TELEM2 | | FTDI | |
|
||||
| ------ | ---------------------------- | ---- | -------------------------------- |
|
||||
| 1 | + 5v (红色) | | DO NOT CONNECT! |
|
||||
| 2 | 2 | 5 | 5 |
|
||||
|
||||
@@ -132,50 +132,50 @@ Enter the following commands (in sequence) a terminal to configure Ubuntu for RP
|
||||
|
||||
1. Install `raspi-config`:
|
||||
|
||||
```sh
|
||||
sudo apt update
|
||||
sudo apt upgrade
|
||||
sudo apt-get install raspi-config
|
||||
```
|
||||
```sh
|
||||
sudo apt update
|
||||
sudo apt upgrade
|
||||
sudo apt-get install raspi-config
|
||||
```
|
||||
|
||||
2. Open `raspi-config`:
|
||||
|
||||
```sh
|
||||
sudo raspi-config
|
||||
```
|
||||
```sh
|
||||
sudo raspi-config
|
||||
```
|
||||
|
||||
3. Go to the **Interface Option** and then click **Serial Port**.
|
||||
|
||||
- Select **No** to disable serial login shell.
|
||||
- Select **Yes** to enable the serial interface.
|
||||
- Click **Finish** and restart the RPi.
|
||||
- Select **No** to disable serial login shell.
|
||||
- Select **Yes** to enable the serial interface.
|
||||
- Click **Finish** and restart the RPi.
|
||||
|
||||
4. Open the firmware boot configuration file in the `nano` editor on RPi:
|
||||
|
||||
```sh
|
||||
sudo nano /boot/firmware/config.txt
|
||||
```
|
||||
```sh
|
||||
sudo nano /boot/firmware/config.txt
|
||||
```
|
||||
|
||||
5. Append the following text to the end of the file (after the last line):
|
||||
|
||||
```sh
|
||||
enable_uart=1
|
||||
dtoverlay=disable-bt
|
||||
```
|
||||
```sh
|
||||
enable_uart=1
|
||||
dtoverlay=disable-bt
|
||||
```
|
||||
|
||||
6. Then save the file and restart the RPi.
|
||||
|
||||
- In `nano` you can save the file using the following sequence of keyboard shortcuts: **ctrl+x**, **ctrl+y**, **Enter**.
|
||||
- In `nano` you can save the file using the following sequence of keyboard shortcuts: **ctrl+x**, **ctrl+y**, **Enter**.
|
||||
|
||||
7. Check that the serial port is available.
|
||||
In this case we use the following terminal commands to list the serial devices:
|
||||
In this case we use the following terminal commands to list the serial devices:
|
||||
|
||||
```sh
|
||||
cd /
|
||||
ls /dev/ttyAMA0
|
||||
```
|
||||
```sh
|
||||
cd /
|
||||
ls /dev/ttyAMA0
|
||||
```
|
||||
|
||||
The result of the command should include the RX/TX connection `/dev/ttyAMA0` (note that this serial port is also available as `/dev/serial0`).
|
||||
The result of the command should include the RX/TX connection `/dev/ttyAMA0` (note that this serial port is also available as `/dev/serial0`).
|
||||
|
||||
The RPi is now setup to work with RPi and communicate using the `/dev/ttyAMA0` serial port.
|
||||
Note that we'll install more software in the following sections to work with MAVLink and ROS 2.
|
||||
@@ -199,39 +199,39 @@ First check the Pixhawk `TELEM 2` configuration:
|
||||
2. Open QGroundControl (the vehicle should connect).
|
||||
3. [Check/change the following parameters](../advanced_config/parameters.md) in QGroundControl:
|
||||
|
||||
```ini
|
||||
MAV_1_CONFIG = TELEM2
|
||||
UXRCE_DDS_CFG = 0 (Disabled)
|
||||
SER_TEL2_BAUD = 57600
|
||||
```
|
||||
```ini
|
||||
MAV_1_CONFIG = TELEM2
|
||||
UXRCE_DDS_CFG = 0 (Disabled)
|
||||
SER_TEL2_BAUD = 57600
|
||||
```
|
||||
|
||||
Note that the parameters may already be set appropriately.
|
||||
For information about how serial ports and MAVLink configuration work see [Serial Port Configuration](../peripherals/serial_configuration.md) and [MAVLink Peripherals](../peripherals/mavlink_peripherals.md).
|
||||
Note that the parameters may already be set appropriately.
|
||||
For information about how serial ports and MAVLink configuration work see [Serial Port Configuration](../peripherals/serial_configuration.md) and [MAVLink Peripherals](../peripherals/mavlink_peripherals.md).
|
||||
|
||||
Then install setup MAVProxy on the RPi using the following terminal commands:
|
||||
|
||||
1. Install MAVProxy:
|
||||
|
||||
```sh
|
||||
sudo apt install python3-pip
|
||||
sudo pip3 install mavproxy
|
||||
sudo apt remove modemmanager
|
||||
```
|
||||
```sh
|
||||
sudo apt install python3-pip
|
||||
sudo pip3 install mavproxy
|
||||
sudo apt remove modemmanager
|
||||
```
|
||||
|
||||
2. Run MAVProxy, setting the port to connect to `/dev/ttyAMA0` and the baud rate to match the PX4:
|
||||
|
||||
```sh
|
||||
sudo mavproxy.py --master=/dev/serial0 --baudrate 57600
|
||||
```
|
||||
```sh
|
||||
sudo mavproxy.py --master=/dev/serial0 --baudrate 57600
|
||||
```
|
||||
|
||||
::: info
|
||||
Note that above we used `/dev/serial0`, but we could equally well have used `/dev/ttyAMA0`.
|
||||
If we were connecting via USB then we would instead set the port as `/dev/ttyACM0`:
|
||||
::: info
|
||||
Note that above we used `/dev/serial0`, but we could equally well have used `/dev/ttyAMA0`.
|
||||
If we were connecting via USB then we would instead set the port as `/dev/ttyACM0`:
|
||||
|
||||
```sh
|
||||
sudo chmod a+rw /dev/ttyACM0
|
||||
sudo mavproxy.py --master=/dev/ttyACM0 --baudrate 57600
|
||||
```
|
||||
```sh
|
||||
sudo chmod a+rw /dev/ttyACM0
|
||||
sudo mavproxy.py --master=/dev/ttyACM0 --baudrate 57600
|
||||
```
|
||||
|
||||
|
||||
:::
|
||||
@@ -259,27 +259,27 @@ The configuration steps are:
|
||||
|
||||
2. [Check/change the following parameters](../advanced_config/parameters.md) in QGroundControl:
|
||||
|
||||
```ini
|
||||
MAV_1_CONFIG = 0 (Disabled)
|
||||
UXRCE_DDS_CFG = 102 (TELEM2)
|
||||
SER_TEL2_BAUD = 921600
|
||||
```
|
||||
```ini
|
||||
MAV_1_CONFIG = 0 (Disabled)
|
||||
UXRCE_DDS_CFG = 102 (TELEM2)
|
||||
SER_TEL2_BAUD = 921600
|
||||
```
|
||||
|
||||
[MAV_1_CONFIG=0](../advanced_config/parameter_reference.md#MAV_1_CONFIG) and [UXRCE_DDS_CFG=102](../advanced_config/parameter_reference.md#UXRCE_DDS_CFG) disable MAVLink on TELEM2 and enable the uXRCE-DDS client on TELEM2, respectively.
|
||||
The `SER_TEL2_BAUD` rate sets the comms link data rate.\
|
||||
You could similarly configure a connection to `TELEM1` using either `MAV_1_CONFIG` or `MAV_0_CONFIG`.
|
||||
[MAV_1_CONFIG=0](../advanced_config/parameter_reference.md#MAV_1_CONFIG) and [UXRCE_DDS_CFG=102](../advanced_config/parameter_reference.md#UXRCE_DDS_CFG) disable MAVLink on TELEM2 and enable the uXRCE-DDS client on TELEM2, respectively.
|
||||
The `SER_TEL2_BAUD` rate sets the comms link data rate.\
|
||||
You could similarly configure a connection to `TELEM1` using either `MAV_1_CONFIG` or `MAV_0_CONFIG`.
|
||||
|
||||
::: info
|
||||
You will need to reboot the flight controller to apply any changes to these parameters.
|
||||
::: info
|
||||
You will need to reboot the flight controller to apply any changes to these parameters.
|
||||
|
||||
:::
|
||||
|
||||
3. Check that the [uxrce_dds_client](../modules/modules_system.md#uxrce-dds-client) module is now running.
|
||||
YOu can do this by running the following command in the QGroundControl [MAVLink Console](https://docs.qgroundcontrol.com/master/en/qgc-user-guide/analyze_view/mavlink_console.html):
|
||||
YOu can do this by running the following command in the QGroundControl [MAVLink Console](https://docs.qgroundcontrol.com/master/en/qgc-user-guide/analyze_view/mavlink_console.html):
|
||||
|
||||
```sh
|
||||
uxrce_dds_client status
|
||||
```
|
||||
```sh
|
||||
uxrce_dds_client status
|
||||
```
|
||||
|
||||
:::info
|
||||
If the client module is not running you can start it manually in the MAVLink console:
|
||||
@@ -300,32 +300,32 @@ The steps to setup ROS 2 and the Micro XRCE-DDS Agent on the RPi are:
|
||||
|
||||
2. Install the git using the RPi terminal:
|
||||
|
||||
```sh
|
||||
sudo apt install git
|
||||
```
|
||||
```sh
|
||||
sudo apt install git
|
||||
```
|
||||
|
||||
3. Install the uXRCE_DDS agent:
|
||||
|
||||
```sh
|
||||
git clone https://github.com/eProsima/Micro-XRCE-DDS-Agent.git
|
||||
cd Micro-XRCE-DDS-Agent
|
||||
mkdir build
|
||||
cd build
|
||||
cmake ..
|
||||
make
|
||||
sudo make install
|
||||
sudo ldconfig /usr/local/lib/
|
||||
```
|
||||
```sh
|
||||
git clone https://github.com/eProsima/Micro-XRCE-DDS-Agent.git
|
||||
cd Micro-XRCE-DDS-Agent
|
||||
mkdir build
|
||||
cd build
|
||||
cmake ..
|
||||
make
|
||||
sudo make install
|
||||
sudo ldconfig /usr/local/lib/
|
||||
```
|
||||
|
||||
See [uXRCE-DDS > Micro XRCE-DDS Agent Installation](../middleware/uxrce_dds.md#micro-xrce-dds-agent-installation) for alternative ways of installing the agent.
|
||||
See [uXRCE-DDS > Micro XRCE-DDS Agent Installation](../middleware/uxrce_dds.md#micro-xrce-dds-agent-installation) for alternative ways of installing the agent.
|
||||
|
||||
4. Start the agent in the RPi terminal:
|
||||
|
||||
```sh
|
||||
sudo MicroXRCEAgent serial --dev /dev/serial0 -b 921600
|
||||
```
|
||||
```sh
|
||||
sudo MicroXRCEAgent serial --dev /dev/serial0 -b 921600
|
||||
```
|
||||
|
||||
Note how we use the serial port set up earlier and the same baud rate as for PX4.
|
||||
Note how we use the serial port set up earlier and the same baud rate as for PX4.
|
||||
|
||||
Now that both the agent and client are running, you should see activity on both the MAVLink console and the RPi terminal.
|
||||
You can view the available topics using the following command on the RPi:
|
||||
|
||||
@@ -82,18 +82,18 @@ If you use a special "very" high power cards from Taobao/Aliexpress then you MUS
|
||||
5. Setup camera pipeline. Open `/etc/systemd/system/fpv-camera.service` and uncomment pipeline according to your camera (PI camera or Logitech camera)
|
||||
6. Open `/etc/wifibroadcast.cfg` and configure WiFi channel according to your antenna setup (or use default #165 for 5.8GHz)
|
||||
7. Configure PX4 to output telemetry stream at speed 1500 Kbps (other UART speeds doesn't match well to RPi frequency dividers).
|
||||
Connect Pixhawk UART to Raspberry Pi UART.
|
||||
In `/etc/wifibroadcast.cfg` uncomment `peer = 'serial:ttyS0:1500000'` in `[drone_mavlink]` section.
|
||||
Connect Pixhawk UART to Raspberry Pi UART.
|
||||
In `/etc/wifibroadcast.cfg` uncomment `peer = 'serial:ttyS0:1500000'` in `[drone_mavlink]` section.
|
||||
|
||||
### Using a Linux Laptop as GCS (Harder than using a RPi)
|
||||
|
||||
1. On **ground** Linux development computer:
|
||||
|
||||
```sh
|
||||
sudo apt install libpcap-dev libsodium-dev python3-all python3-twisted
|
||||
git clone -b stable https://github.com/svpcom/wfb-ng.git
|
||||
cd wfb-ng && make deb && sudo apt install ./deb_dist/wfb-ng*.deb
|
||||
```
|
||||
```sh
|
||||
sudo apt install libpcap-dev libsodium-dev python3-all python3-twisted
|
||||
git clone -b stable https://github.com/svpcom/wfb-ng.git
|
||||
cd wfb-ng && make deb && sudo apt install ./deb_dist/wfb-ng*.deb
|
||||
```
|
||||
|
||||
2. Follow the [Setup HOWTO](https://github.com/svpcom/wfb-ng/wiki/Setup-HOWTO) to complete installation
|
||||
|
||||
|
||||
Reference in New Issue
Block a user