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: 127.0.0.1; 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: 127.0.0.1; 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 sensor_combined_listener.launch.py
[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!
Edwin

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.




udp

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 https://github.com/PX4/px4_ros_com/issues/114 so I modified generate_microRTPS_bridge.py, 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

(Sorry for reviving this, but I cannot get this to work and this is the only source I can find)
Hello @sen.skm , where did you force the fastrtps_version? I have the same problem and uninstalled fastdds (to use the foxy version). Did you also build the PX4 software from source?
I am running PX4 v1.13.3 and using ROS 2 Foxy.
I can run the micrortps_agent and see the topics that the PX4 publishes, but I cannot receive messages:

ubuntu@ubuntu:~/ros2_ws$ micrortps_agent
--- MicroRTPS Agent ---
[   micrortps_agent   ]	Starting link...
[   micrortps_agent   ]	UART transport: device: /dev/ttyACM0; baudrate: 460800; poll: 1ms; flow_control: No
---   Subscribers   ---
- DebugArray subscriber started
- DebugKeyValue subscriber started
- DebugValue subscriber started
- DebugVect subscriber started
- OffboardControlMode subscriber started
- OpticalFlow subscriber started
- PositionSetpoint subscriber started
- PositionSetpointTriplet subscriber started
- TelemetryStatus subscriber started
- Timesync subscriber started
- VehicleCommand subscriber started
- VehicleLocalPositionSetpoint subscriber started
- VehicleTrajectoryWaypoint subscriber started
- OnboardComputerStatus subscriber started
- TrajectoryBezier subscriber started
- VehicleTrajectoryBezier subscriber started
- TrajectorySetpoint subscriber started
- VehicleMocapOdometry subscriber started
- VehicleVisualOdometry subscriber started
-----------------------

----   Publishers  ----
- Timesync publishers started
- TrajectoryWaypoint publisher started
- VehicleControlMode publisher started
- VehicleOdometry publisher started
- VehicleStatus publisher started
- CollisionConstraints publisher started
- TimesyncStatus publisher started
- SensorCombined publisher started
- VehicleTrajectoryWaypointDesired publisher started
-----------------------
[   micrortps_agent   ]	SensorCombined publisher matched
^C
[   micrortps_agent   ]	Interrupt signal (2) received.
[ micrortps_transport ]	Closed UART.
[   micrortps_agent   ]	SENT:     3824 messages - 198848 bytes

As you can see, messages are only being sent and not received.
When I check the topics in ROS2, I can see them:

ubuntu@ubuntu:~/ros2_ws$ ros2 topic list
/fmu/collision_constraints/out
/fmu/debug_array/in
/fmu/debug_key_value/in
/fmu/debug_value/in
/fmu/debug_vect/in
/fmu/offboard_control_mode/in
/fmu/onboard_computer_status/in
/fmu/optical_flow/in
/fmu/position_setpoint/in
/fmu/position_setpoint_triplet/in
/fmu/sensor_combined/out
/fmu/telemetry_status/in
/fmu/timesync/in
/fmu/timesync/out
/fmu/trajectory_bezier/in
/fmu/trajectory_setpoint/in
/fmu/trajectory_waypoint/out
/fmu/vehicle_command/in
/fmu/vehicle_control_mode/out
/fmu/vehicle_local_position_setpoint/in
/fmu/vehicle_mocap_odometry/in
/fmu/vehicle_odometry/out
/fmu/vehicle_status/out
/fmu/vehicle_trajectory_bezier/in
/fmu/vehicle_trajectory_waypoint/in
/fmu/vehicle_trajectory_waypoint_desired/out
/fmu/vehicle_visual_odometry/in
/parameter_events
/rosout
/timesync_status

But when I try to start the listener, I cannot receive any messages.

ubuntu@ubuntu:~/ros2_ws$ ros2 run px4_ros_com sensor_combined_listener
Starting sensor_combined listener node...

I installed ROS 2 foxy using the ubuntu package. Do I need to build it from source?

Any help would be greatly appreciated.