No sensor sensor data received using micrortps_client/agent and ROS2

Hi all,

I successfully installed:

  • Px4 Firmware 1.11
  • ROS2 Eloquent and ROS Melodic
  • FastRTPS-1.8.2 and Fast-RTPS-Gen 1.0.4

Then I build px4 firmware for holybro x500 with:
$ make px4_fmu-v5_rtps
Using QGroundControl I uploaded the file to the PX4.

When I run the following command in the MAVLink Console it states:

nsh> micrortps_client start -t UDP
INFO [micrortps_client] UDP transport: ip address:; recv port: 2019; send port: 2020; sleep: 1ms

When I run:

$ source ~/px4_ros_com_ros2/install/setup.bash
$ micrortps_agent -t UDP
--- MicroRTPS Agent ---
[   micrortps_agent   ]	Starting link...
[   micrortps_agent   ]	UDP transport: ip address:; recv port: 2020; send port: 2019; sleep: 1us
[ micrortps_transport ]	UDP transport: Trying to connect...[ micrortps_transport ]	UDP transport: Connected to server!

---   Subscribers   ---
- DebugArray subscriber started
- DebugKeyValue subscriber started
- DebugValue subscriber started
- DebugVect subscriber started
- OpticalFlow subscriber started
- PositionSetpoint subscriber started
- PositionSetpointTriplet subscriber started
- Timesync subscriber started
- TrajectoryWaypoint subscriber started
- VehicleTrajectoryWaypoint subscriber started
- OnboardComputerStatus subscriber started
- VehicleMocapOdometry subscriber started
- VehicleVisualOdometry subscriber started

----   Publishers  ----
- SatelliteInfo publisher started
- SensorCombined publisher started
- Timesync publisher started
- VehicleOdometry publisher started
- CollisionConstraints publisher started

And finally I run:

$ source ~/px4_ros_com_ros2/install/local_setup.bash
$ ros2 launch px4_ros_com
[INFO] [launch]: All log files can be found below /home/edwin/.ros/log/2020-09-25-14-13-36-170040-edwin-GL62M-7RD-26574
[INFO] [launch]: Default logging verbosity is set to INFO
[INFO] [sensor_combined_listener-1]: process started with pid [26588]
[sensor_combined_listener-1] Starting sensor_combined listener node...

However nothing is showing as data from the sensors. I am kind of lost here. Anybody knows the issue?

Thanks in regard!

Hey, I am also facing the same issue, so were you able to solve it? The difference is that I am using PX4 1.12.0 beta-5 and ROS Foxy but for SITL and not real hardware.

Hey, I am in similar situation, listener not receiving any ROS messages however fmu topics are listed so I hope agent is running and also client status is good :confused: tcpdump for UDP port 2019/2020 show some traffics so I assume communication between agent and client working (I haven’t checked UDP packets in detailed)

Some details about my environment
PX4 release 1.12.3 (SITL gazebo)
micrortpsgen 1.0.4
FastDDS 2.4.1
ROS2 Galactic (build from source) and Ubuntu 18.04.


did you manage to solve the issue ? please could someone help here :pray:

I solved the issue,

  1. I built ros2 foxy distro (just to avoid unnecessary confusion of cyclone DDS/default middleware for galactic is cyclone DDS).
  2. As mentioned in Fast DDS Installation | PX4 User Guide, fastdds is part of ros2. Previously I made mistake here by installing 2.4.1 so now uninstalled it.
  3. I cloned PX4 autopilot repo (Important!! recursive). Ubuntu Development Environment | PX4 User Guide
  4. Since I built from source I faced issue of so I modified, forced fastrtps_version = ‘2.1.1’ because foxy uses this version AFAIK.

Now things are working fine.

[   micrortps_agent   ]	RECEIVED: 263083 messages - 34792781 bytes; 263084 LOOPS - 759.162 seconds - 45.83KB/s
[   micrortps_agent   ]	SENT:     7525 messages - 391300 bytes
1 Like