Pixhawk系列飞控板的协同计算机
无论何种协同计算机(Raspberry Pi, Odroid, Tegra K1),与Pixhawk系列飞控板之间的接口是相同的:它们通过串口连接到Pixhawk上的,这个端口专用于与协同计算机相连。连接的消息格式是MAVLink。
参考下表,设置SYS_COMPANION
参数(System参数组)
0
:禁用TELEM2上的MAVLink输出(默认)921600
:使能MAVLink输出,波特率:921600, 8N1(推荐)157600
:使能MAVLink输出,OSD模式,波特率:57600
为了能够接收MAVLink消息,协同计算机需要运行一些和串口通讯的软件,最常用的是:
- :ROS
- C/C++ example code:自定义的代码
- :在串口和UDP之间传输MAVLink
安全的做法是使用FTDI(USB转串口适配器),并按照下面说明连接它。这大多数时候都管用并且很容易设置。
On Linux the default name of a USB FTDI would be like . If you have a second FTDI linked on the USB or an Arduino, it will registered as \dev\ttyUSB1
. To avoid the confusion between the first plugged and the second plugged, we recommend you to create a symlink from ttyUSBx
to a friendly name, depending on the Vendor and Product ID of the USB device.
Using lsusb
we can get the vendor and product IDs.
The Pixhawk is Bus 003 Device 005: ID 26ac:0011
Therefore, we can create a new UDEV rule in a file called /etc/udev/rules.d/99-pixhawk.rules
with the following content, changing the idVendor and idProduct to yours.
Finally, after a reboot you can be sure to know which device is what and put /dev/ttyPixhawk
instead of /dev/ttyUSB0
in your scripts.