diff --git a/clover/CMakeLists.txt b/clover/CMakeLists.txt index 7eca3f4c..f1bdb819 100644 --- a/clover/CMakeLists.txt +++ b/clover/CMakeLists.txt @@ -30,6 +30,8 @@ find_package(catkin REQUIRED COMPONENTS list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_LIST_DIR}/cmake") +# https://github.com/mavlink/mavros/blob/7f1a8/mavros/CMakeLists.txt#L42 +set(CMAKE_MODULE_PATH "${CMAKE_MODULE_PATH};/usr/share/cmake/geographiclib") find_package(GeographicLib REQUIRED) # Workaround for OpenCV 3/4 support diff --git a/clover/cmake/FindGeographicLib.cmake b/clover/cmake/FindGeographicLib.cmake deleted file mode 100644 index 9b29c320..00000000 --- a/clover/cmake/FindGeographicLib.cmake +++ /dev/null @@ -1,18 +0,0 @@ -# taken from: https://github.com/mavlink/mavros/blob/master/libmavconn/cmake/Modules/FindGeographicLib.cmake - -# Look for GeographicLib -# -# Set -# GEOGRAPHICLIB_FOUND = TRUE -# GeographicLib_INCLUDE_DIRS = /usr/local/include -# GeographicLib_LIBRARIES = /usr/local/lib/libGeographic.so -# GeographicLib_LIBRARY_DIRS = /usr/local/lib - -find_path (GeographicLib_INCLUDE_DIRS NAMES GeographicLib/Config.h) - -find_library (GeographicLib_LIBRARIES NAMES Geographic) - -include (FindPackageHandleStandardArgs) -find_package_handle_standard_args (GeographicLib DEFAULT_MSG - GeographicLib_LIBRARIES GeographicLib_INCLUDE_DIRS) -mark_as_advanced (GeographicLib_LIBRARIES GeographicLib_INCLUDE_DIRS) diff --git a/docs/assets/raspberry-uart-telemetry2.png b/docs/assets/raspberry-uart-telemetry2.png new file mode 100644 index 00000000..d24fba67 Binary files /dev/null and b/docs/assets/raspberry-uart-telemetry2.png differ diff --git a/docs/en/connection.md b/docs/en/connection.md index 2ca89d62..fec4fc90 100644 --- a/docs/en/connection.md +++ b/docs/en/connection.md @@ -6,37 +6,59 @@ In order to program [autonomous flights](simple_offboard.md), [work with Pixhawk USB connection is the preferred way to connect to the flight controller. +USB connection + 1. Connect your FCU to the Raspberry Pi using a microUSB to USB cable. 2. [Connect to the Raspberry Pi over SSH](ssh.md). -3. Make sure the connection is working by [running the following command on the Raspberry Pi](ssh.md): +3. Make sure that the connection is working properly by [running the following command on the Raspberry Pi](cli.md): ```bash rostopic echo /mavros/state ``` - The `connected` field should have the `True` value.s + The `connected` field should have the `True` value. > **Hint** You need to set the `CBRK_USB_CHK` [parameter](parameters.md) to 197848 for the USB connection to work. ## UART connection - - UART connection is another way for the Raspberry Pi and FCU to communicate. +UART connection via TELEM2 + +If the pin marked GND is occupied, you can use any other ground pin (look at the [pinout](https://pinout.xyz) for reference). + 1. Connect the TELEM 2 port on the flight controller using a UART cable to the Raspberry Pi pins following this instruction: the black cable (*GND*) to Ground, the green cable (*UART_RX*) to *GPIO14*, the yellow cable (*UART_TX*) to *GPIO15*. Do not connect the red cable (*5V*). -2. Set the PX4 parameters: `MAV_1_CONFIG` to TELEM 2, `SER_TEL2_BAUND` to 921600 8N1. In PX4 of version prior to v1.10.0 the parameter `SYS_COMPANION` should be set to 921600. +2. In PX4 of version v1.9.0 or higher, set parameter values: `MAV_1_CONFIG` to TELEM 2, `SER_TEL2_BAUND` to 921600 8N1. In PX4 of version [prior to v1.9.0](https://github.com/mavlink/qgroundcontrol/issues/6905#issuecomment-464549610) the parameter `SYS_COMPANION` should be set to `Companion Link (921600 baud, 8N1)`, to set it correctly use the old version of QGC [v3.3.1](https://github.com/mavlink/qgroundcontrol/releases/tag/v3.3.1). 3. [Connect to the Raspberry Pi over SSH](ssh.md). -4. Change the connection type in `~/catkin_ws/src/clover/clover/launch/clover.launch` to UART: +4. Check the presence of the parameters `enable_uart=1` and `dtoverlay=pi 3-disable-bt` in the file `/boot/config.txt` by [running the following command on the Raspberry Pi](cli.md): + + ```bash + cat /boot/config.txt | grep -E "^enable_uart=.|^dtoverlay=pi3-disable-bt" + ``` + + If the parameters in the file are different or missing, then edit the file and restart the Raspberry Pi. + +5. Change the connection type from `usb` to `uart` in the Clover' launch file `~/catkin_ws/src/clover/clover/launch/clover.launch`: ```xml ``` - Be sure to restart the `clover` service after editing the .launch file: + If you change the launch file, you need to restart the `clover' service: ```bash sudo systemctl restart clover ``` +6. Make sure that the connection is working properly by running the following command: + + ```bash + rostopic echo -n1 /mavros/state + ``` + + The `connected` field should have the `True` value. + +Read more in the PX4 docs: https://docs.px4.io/main/en/peripherals/serial_configuration.html. + **Next**: [Using QGroundControl over Wi-Fi](gcs_bridge.md) diff --git a/docs/en/rc_flysky_a8s.md b/docs/en/rc_flysky_a8s.md index 3370f809..3f9b6d4c 100644 --- a/docs/en/rc_flysky_a8s.md +++ b/docs/en/rc_flysky_a8s.md @@ -67,7 +67,7 @@ Connect your receiver to the RC IN port on your flight controller: > **Hint** Double check that you're using the RC IN port on the COEX Pix: -coex pix pinout +coex pix pinout ## Binding your transmitter {#rc_bind} diff --git a/docs/ru/connection.md b/docs/ru/connection.md index a9d2e893..90a24361 100644 --- a/docs/ru/connection.md +++ b/docs/ru/connection.md @@ -6,9 +6,11 @@ Основным способом подключения является подключение по интерфейсу USB. +Подключение по USB + 1. Соедините Raspberry Pi и полетный контроллер micro-USB to USB кабелем. 2. [Подключитесь в Raspberry Pi по SSH](ssh.md). -3. Убедитесь в работоспособности подключения, [выполнив на Raspberry Pi](ssh.md): +3. Убедитесь в работоспособности подключения, [выполнив команду на Raspberry Pi](cli.md): ```bash rostopic echo /mavros/state @@ -20,14 +22,24 @@ ## Подключение по UART - +Дополнительным способом подключения является подключение по интерфейсу UART. -Дополнительным способом подключения является подключение подключение по интерфейсу UART. +Подключение UART через TELEM2 + +Если обозначенный пин GND занят, можно использовать другой свободный, используя [распиновку](https://pinout.xyz). 1. Подключите Raspberry Pi к полетному контроллеру по UART. Для этого соедините кабелем порт TELEM 2 на полетном контроллере к пинам на Raspberry Pi следующем образом: черный провод (GND) к Ground, зеленый (*UART_RX*) к *GPIO14*, желтый (*UART_TX*) к *GPIO15*. Красный провод (*5V*) подключать не нужно. -2. Измените значения параметров PX4: `MAV_1_CONFIG` на TELEM 2, `SER_TEL2_BAUND` на 921600 8N1. В PX4 до версии v1.10.0 необходима установка параметра `SYS_COMPANION` в значение 921600. +2. В PX4 версии v1.9.0 и выше измените значения параметров PX4: `MAV_1_CONFIG` на TELEM 2, `SER_TEL2_BAUND` на 921600 8N1. В PX4 [до версии v1.9.0](https://github.com/mavlink/qgroundcontrol/issues/6905#issuecomment-464549610) необходима установка параметра `SYS_COMPANION` в значение `Companion Link (921600 baud, 8N1)`, для его корректной установки используйте старую версию QGC [v3.3.1](https://github.com/mavlink/qgroundcontrol/releases/tag/v3.3.1). 3. [Подключитесь в Raspberry Pi по SSH](ssh.md). -4. Поменяйте в launch-файле Клевера (`~/catkin_ws/src/clover/clover/launch/clover.launch`) тип подключения на UART: +4. Проверьте наличие параметров `enable_uart=1` и `dtoverlay=pi3-disable-bt` в файле `/boot/config.txt`, [выполнив команду на Raspberry Pi](cli.md): + + ```bash + cat /boot/config.txt | grep -E "^enable_uart=.|^dtoverlay=pi3-disable-bt" + ``` + + Если параметры в файле отличаются или отсутствуют, то отредактируйте файл и перезагрузите Raspberry Pi. + +5. Поменяйте в launch-файле Клевера (`~/catkin_ws/src/clover/clover/launch/clover.launch`) тип подключения с `usb` на `uart`: ```xml @@ -39,4 +51,14 @@ sudo systemctl restart clover ``` +6. Убедитесь в работоспособности подключения: + + ```bash + rostopic echo -n1 /mavros/state + ``` + + Поле `connected` должно содержать значение `True`. + +Дополнительная информация: https://docs.px4.io/main/en/peripherals/serial_configuration.html. + **Далее**: [Подключение QGroundControl по Wi-Fi](gcs_bridge.md). diff --git a/docs/ru/rc_flysky_a8s.md b/docs/ru/rc_flysky_a8s.md index 99ebcfe8..fe6d6117 100644 --- a/docs/ru/rc_flysky_a8s.md +++ b/docs/ru/rc_flysky_a8s.md @@ -67,7 +67,7 @@ > **Hint** Убедитесь, что провод, идущий в COEX Pix, подключен к порту RC IN: -coex pix pinout +coex pix pinout ## Сопряжение приёмника с пультом {#rc_bind}