Connecting Pixhawk to Raspberry Pi and Jetson

Pixhawk Companion Computer Integration: Serial Protocols, Hardware Interfaces, and Communication Architectures for Raspberry Pi and NVIDIA Jetson Platforms

Technical guide for connecting Pixhawk flight controllers to Raspberry Pi and NVIDIA Jetson companion computers via serial, Ethernet, and ROS 2 interfaces.

The Physical Layer: Establishing Reliable Hardware Connections

Connecting a Pixhawk flight controller to companion computers demands precise attention to electrical specifications and pin mapping. The foundational approach employs UART serial communication through dedicated telemetry ports, typically TELEM1 or TELEM2 on the flight controller.

Serial Cable Fabrication and Pin Configuration

A custom three-wire cable forms the physical bridge between systems. The Pixhawk's 6-pin JST-GH or DF13 telemetry connector exposes VCC, TX, RX, CTS, RTS, and GND signals. For basic MAVLink communication, only TX, RX, and ground connections prove essential. Power delivery through the serial cable introduces unnecessary risk; separate power supplies for flight controller and companion computer prevent voltage fluctuations from disrupting either system.

The critical wiring principle: cross-connect transmit and receive lines. The Pixhawk's TX pin routes to the companion computer's RX GPIO, while the Pixhawk's RX connects to the companion's TX. Ground establishes the common reference potential. Soldered connections with heat-shrink insulation provide mechanical reliability superior to breadboard-style jumper arrangements.

Platform-Specific GPIO Mapping

Raspberry Pi platforms expose the primary UART at /dev/ttyAMA0 or /dev/serial0, mapped to GPIO pins 8 (TX) and 10 (RX). NVIDIA Jetson devices, including Nano and Orin variants, utilize /dev/ttyTHS1 for the hardware UART, with identical GPIO pin assignments. This consistency simplifies cable design across platforms but masks underlying driver differences that affect software configuration.

MAVLink remains the predominant protocol for Pixhawk companion computer communication. Configuration requires setting specific parameters within the flight controller: SERIAL2_PROTOCOL to 1 (MAVLink), SERIAL2_BAUD to 921600 for high-throughput applications, and disabling hardware flow control via BRD_SER2_RTSCTS when using basic three-wire connections. Ground station software like QGroundControl facilitates parameter modification before deployment.

uXRCE-DDS: Native ROS 2 Integration

PX4's uXRCE-DDS implementation enables direct ROS 2 topic publication from the flight controller, eliminating MAVLink translation overhead. This approach demands flight controllers with sufficient flash memory—2MB minimum—which excludes legacy hardware like the Pixhawk 2.4.8. Configuration involves disabling MAVLink on the target serial port (MAV_1_CONFIG = 0) and enabling the XRCE-DDS client (UXRCE_DDS_CFG = 102 for TELEM2). The companion computer runs a Micro XRCE-DDS Agent that brokers communication between the flight controller's uORB middleware and the ROS 2 DDS network.

Ethernet Alternatives for High-Bandwidth Applications

Integrated Ethernet switches on specialized carrier boards, such as the Holybro Pixhawk Jetson Baseboard, enable MAVLink or uXRCE-DDS communication over TCP/UDP. This configuration requires network parameter alignment: Pixhawk defaults to 10.41.10.2, while the companion computer needs static assignment within the same subnet. Netplan configuration on Ubuntu-based Jetson systems establishes persistent network settings.

Software Stack Configuration and Verification

Serial Port Permissions and Driver Considerations

Linux serial device access requires appropriate user permissions. Adding the user account to the dialout group via sudo usermod -a -G dialout $USER prevents permission-denied errors during MAVProxy or ROS node execution. A system reboot applies group membership changes.

Jetson platforms present additional complexity: the nvgetty.service daemon may claim UART resources, preventing companion computer access. Disabling this service via sudo systemctl disable nvgetty.service resolves conflicts on Jetson Nano and Orin devices.

MAVProxy Testing and Validation

MAVProxy provides immediate verification of serial connectivity. The command sudo mavproxy.py --master=/dev/ttyTHS1 --baudrate 921600 (Jetson) or --master=/dev/ttyAMA0 (Raspberry Pi) initiates a MAVLink session. Successful connection displays heartbeat messages and enables parameter inspection. Absence of heartbeats indicates wiring errors, baud rate mismatches, or serial port conflicts.

ROS 2 Integration Pathways

MAVROS bridges MAVLink to ROS 1 or ROS 2 topics, offering extensive message translation but introducing processing latency. Installation via sudo apt install ros-humble-mavros followed by geographic dataset configuration prevents runtime crashes. Launch parameters specify the serial device: ros2 launch mavros px4.launch fcu_url:="serial:///dev/ttyTHS1:921600".

MAVSDK-Python provides a higher-level abstraction for mission scripting. Connection strings follow the pattern serial:///dev/ttyTHS1:921600, with asynchronous Python APIs simplifying takeoff, waypoint navigation, and telemetry subscription.

Troubleshooting Common Integration Failures

Serial Communication Diagnostics

When MAVLink heartbeats fail to appear, systematic verification isolates the fault. Confirm physical wiring: TX-to-RX crossover, secure solder joints, and ground continuity. Validate device file existence with ls /dev/ttyTHS* or ls /dev/ttyAMA*. Check baud rate consistency between flight controller parameters and companion computer software.

Voltage Level Compatibility

Jetson GPIO pins operate at 3.3V logic levels, matching Pixhawk telemetry port specifications. Raspberry Pi models vary; some expose 5V-tolerant pins that risk damaging 3.3V flight controller interfaces. Level-shifting circuits provide protection when voltage compatibility remains uncertain.

Resource Conflicts and Service Management

Bluetooth on Raspberry Pi shares the primary UART hardware, requiring explicit disablement via /boot/config.txt entries: enable_uart=1 and dtoverlay=disable-bt. Jetson platforms avoid this conflict but may experience UART initialization delays during boot; adding brief sleep intervals before serial access attempts improves reliability.

Performance Considerations and Method Selection

Latency-sensitive applications—visual navigation, real-time obstacle avoidance—benefit from uXRCE-DDS native ROS 2 integration, which achieves microsecond-scale message delivery. Mission scripting and telemetry logging tolerate MAVLink's millisecond overhead while gaining protocol maturity and extensive tooling support.

Bandwidth requirements influence transport selection. High-rate sensor streaming or log transfer demands 921600 baud serial connections or Ethernet alternatives. Basic command-and-control functions operate reliably at lower baud rates, reducing susceptibility to electromagnetic interference.

Hardware constraints dictate feasible approaches. Legacy Pixhawk models with 1MB flash cannot execute uXRCE-DDS client firmware, necessitating MAVLink-based architectures. Modern flight controllers with 2MB+ flash enable protocol flexibility but require careful firmware version alignment with companion computer software.

Frequently Asked Questions

What baud rate should I configure for Pixhawk companion computer communication? Set SER_TEL2_BAUD or equivalent parameter to 921600 for high-throughput applications like log streaming or computer vision data transfer. Basic command-and-control functions operate reliably at 57600 or 115200 baud with reduced electromagnetic interference susceptibility.

Why does my Jetson show "link 1 down" in MAVProxy despite correct wiring? The nvgetty.service daemon commonly claims UART resources on Jetson platforms. Disable it via sudo systemctl disable nvgetty.service and reboot. Verify device file permissions and confirm the user belongs to the dialout group.

Can I use USB instead of GPIO serial for Pixhawk connection? Yes, USB-to-serial adapters or direct USB connections to Pixhawk's USB ports provide alternative communication paths. This approach avoids GPIO configuration complexity but consumes a USB port and may introduce additional latency compared to native UART.

How do I verify ROS 2 topics are receiving Pixhawk data? After launching the Micro XRCE-DDS Agent and sourcing your ROS 2 workspace, execute ros2 topic list | grep /fmu/ to enumerate available topics. Use ros2 topic echo /fmu/out/vehicle_odometry to inspect live telemetry data. Absence of topics indicates agent-client connection failures or parameter misconfiguration.

What distinguishes TELEM1 from TELEM2 on Pixhawk flight controllers? Both ports support identical MAVLink functionality. TELEM2 often defaults to companion computer assignments in PX4 configuration, while TELEM1 frequently serves ground station links. Parameter names reference the specific port: MAV_1_CONFIG controls TELEM1, MAV_2_CONFIG manages TELEM2.