Hello Community,
I’m working on a project where I need to integrate a physical Pixhawk flight controller with ROS 2. My goal is to read MAVLink data (e.g., IMU, GPS, battery status) as ROS 2 topics from the Pixhawk over a serial connection.
Here’s what I’ve done so far:
-
Installed ROS 2 Humble on Ubuntu.
-
Installed PX4-Autopilot and confirmed the Pixhawk works with QGroundControl via USB.
However, I’m struggling to configure the physical Pixhawk to communicate with ROS 2 over serial.
Any detailed guidance, sample configurations, or best practices would be greatly appreciated.
Thanks in advance!
Thank you for your response sir. I followed the official guide, but I’m having trouble starting the client after successfully starting the agent. For context, I’m using a USB-C cable connection with the pixhawk 6x pro.
Steps I Followed
-
Starting the Agent:
I ran the following command:
MicroXRCEAgent serial --dev /dev/ttyACM0 -b 921600
-
Starting the Client:
I attempted to start the client with this command:
uxrce_dds_client start -t serial -d /dev/ttyACM0 -b 921600
Issue
When I run the above client command, I get this error:
uxrce_dds_client: command not found
I also tried running it in the MAVLink console on QGroundControl, but the console becomes inaccessible after starting the agent.
Additionally, I attempted to run it in the PX4 shell, but I’m not sure how to access it since I’m new to the system.
Any guidance or suggestions would be greatly appreciated.
Thank you.
You’re likely missing this line for your board:
https://github.com/PX4/PX4-Autopilot/blob/2c97a875bfd46cdb4beb0b75f38eeb1b2b16c1a4/boards/px4/fmu-v6x/default.px4board#L86```
Thank you for your response, I really appreciate. I have checked the PX4 directory on my computer, and the uXRCE_DDS_CLIENT module is present on my board, as shown below:
CONFIG_MODULES_UXRCE_DDS_CLIENT=y
The module appears to be enabled in the configuration. However, I am still facing issues starting the client successfully.
I observed that the uXRCE_DDS_CLIENT command is accessible via the PX4 shell only when the Agent is not running. However, once I start the Agent, the MAVLink shell becomes inaccessible.
Any guidance, suggestions, or clarification would be greatly appreciated.
Thank you.
u can use mavros
mavros node has various topics that runs with ros2
u will be able to view all the data on the respective topics
Thank you for your response, I really appreciate it.
Could you please help with an installation guide for ROS 2 Humble with MAVROS?
Most of the instructions I’ve found so far have not been very helpful.
Any guidance, suggestions, or clarification would be greatly appreciated.
Thank you.
Installation — ROS 2 Documentation: Humble documentation , I Know u have visited this, but install ros2 by following the instructions
and for mavros installation u have to build it from source, use chatgpt for that
after that to start the mavros node-- the command is like
“ros2 launch mavros_ros2 serial.launch.py fcu_url:=/dev/ttyACM0:57600”
u have to write a correct fcu_url here to inorder to start the node
if does not work , try different executables in the mavros package
and first of all , install mavros correctly
Thank you for your response, I really appreciate it.
I decided to switch from using USB-C for the DDS client because of the persistent issues I encountered. Currently, I’m utilizing an Ethernet connection at the moment, which has been working well for reading DDS topics.
I would still like to explore if there’s any way to fix the DDS client issue via the USB-C connection.
Thank you all for your support and assistance.
Sometimes when you get command not found
you’re out of RAM. Check what free
tells you.