No communication with ROS2 using MicroXRCEAgent with px4 board

Hello I have tried to communicate px4 board and PC with following this instruction.

here is my hardware setup:
Host machine: Lenovo thinkpad Ubuntu 22.04
ROS2 Humble
PX4 Board: pixhawk 4

When I try with this command:

make px4_sitl gz_x500
MicroXRCEAgent udp4 -p 8888 

gazebo garden opened and communication between ros2 and px4. Here is the output:

image

After gazebo I have started to try communication with px4 board.

I have configured the baudrate and set the UXRE_DD_Client parameters as shown below:image

image

But when I tried this with PX4 board I doesn’t work. Here is the output of
sudo MicroXRCEAgent serial --dev /dev/ttyUSB0 -b 921600:


It always stuck here.

I have used TELEM1 and TELEM2 either. But result was same.

Hi @serkan,
make sure that the TELEM 1 and TELEM 2 are not already used by other services, such as MAVLink.

According to the documentation uXRCE-DDS (PX4-ROS 2/DDS Bridge) | PX4 User Guide, by default the two ports are used to connect to the Ground Station and to an eventual companion computer.
To change this behavior, you have to configure the MAV_0_CONFIG and MAV_1_CONFIG parameters (more details following the previous link).

Hope it helps.

2 Likes

TRY stopping your client from QGC Mavlink console and restarting it !

uxrce_dds_client stop
uxrce_dds_client status (Not Running)
uxrce_dds_client start -t serial -d /dev/ttyS1 -b 921600

For Pixhawk 4 - Telem1 = S1. TELEM2=S2

1 Like

I closed the QGC application to prevent it from connecting. Then, I connected the FTDI, disconnected and reconnected the power cables of the PX4 board. I supplied power, and the system started working.