* docs: Add CLI article (en) * docs: Update frames article (en) * docs: Add article about part models (en) * docs: Update Raspberry Pi article (en) * docs: Remove unused raspberry3.jpg * docs: Add COEX Pix article (en) * docs: Add CopterHack 2019 article (en) * docs: Update connection article (en) * docs: Add programming overview (en) * docs: Add anchor in modes article * docs: Fix link in auto_setup, add editing ID (en) * docs: Rearrange summary to match Russian version (en) * docs/camera_frame: Add link to cli#editing (en) * docs/wifi: Fix link to next article (en) * docs: Add "next" links where appropriate (en)
1.8 KiB
Connecting Raspberry Pi to the flight controller
In order to program autonomous flights, work with Pixhawk or Pixracer over Wi-Fi, use controller app and access other functions you need to connect your Raspberry Pi to the flight controller.
USB connection
USB connection is the preferred way to connect to the flight controller.
-
Connect your FCU to the Raspberry Pi using a microUSB to USB cable.
-
Make sure the connection is working by running the following command on the Raspberry Pi:
rostopic echo /mavros/stateThe
connectedfield should have theTruevalue.s
Hint You need to set the
CBRK_USB_CHKparameter to 197848 for the USB connection to work.
UART connection
UART connection is another way for the Raspberry Pi and FCU to communicate.
-
Connect Raspberry Pi to your FCU using a UART cable.
-
Change the connection type in
~/catkin_ws/src/clever/clever/launch/clever.launchto UART:<arg name="fcu_conn" default="uart"/>Be sure to restart the
cleverservice after editing the .launch file:sudo systemctl restart clever
Hint Set the
SYS_COMPANIONPX4 parameter to 921600 to enable UART on the FCU.
SITL connection
In order to connect to a local or a remote SITL instance set the fcu_conn parameter to udp and fcu_ip to the IP address of the SITL instance (127.0.0.1 if you are running the instance locally):
<arg name="fcu_conn" default="udp"/>
<arg name="fcu_ip" default="127.0.0.1"/>