Timesync in MicroDDS

Dear all,

I am trying to switch the flight controller โ†” companion computer communication from RTPS to microDDS with the latest release of PX4 1.13.2. I compiled the px4_fmu-v5_rtps target for the flight controller and started the micordds client on the flight controller. On the companion computer, I have ROS2 Humble and followed @JulianOes tutorial on how to run the microDDS bridge on ROS2. I see the topics on ROS2 and can even echo the VehicleState. So far, so good :slight_smile:

I noticed the Timesync message was deleted in one of the latest px4_msgs updates. Thus, it got not compiled and is not available in ROS2. However, I still see a Timsync message (in/out) in the topic list output and a TimesyncStatus (out). However, I do not receive any data on either of these topics. Can anyone explain how the time sync between the companion computer and the flight controller works with microDDS or point me to a tutorial?

Looking forward to getting in touch with you. Best,
Julia

List of standard topics published by PX4 1.13.2:

/fmu/in/DebugArray
/fmu/in/DebugKeyValue
/fmu/in/DebugValue
/fmu/in/DebugVect
/fmu/in/OffboardControlMode
/fmu/in/OnboardComputerStatus
/fmu/in/OpticalFlow
/fmu/in/PositionSetpoint
/fmu/in/PositionSetpointTriplet
/fmu/in/TelemetryStatus
/fmu/in/Timesync
/fmu/in/TrajectoryBezier
/fmu/in/TrajectorySetpoint
/fmu/in/VehicleCommand
/fmu/in/VehicleLocalPositionSetpoint
/fmu/in/VehicleMocapOdometry
/fmu/in/VehicleTrajectoryBezier
/fmu/in/VehicleTrajectoryWaypoint
/fmu/in/VehicleVisualOdometry
/fmu/out/CollisionConstraints
/fmu/out/SensorCombined
/fmu/out/Timesync
/fmu/out/TimesyncStatus
/fmu/out/TrajectoryWaypoint
/fmu/out/VehicleControlMode
/fmu/out/VehicleOdometry
/fmu/out/VehicleStatus
/fmu/out/VehicleTrajectoryWaypointDesired

Hi @Julia_Nitsch! Nice to see an ASL alumni here :smile:

You would need to use a newer version of PX4 (main) which uses XRCE-DDS and has better time synchronization. PX4 has moved away from fastRTPS After v1.13, and the px4_msgs have been updated against main

Hey,

haha yes the world is simply too small :sweat_smile:

Great thanks for the information! You are right, on the current main-branch the micro-dds has a timesync synchronization which is missing on 1.13.2. I will look into the sync in the main.

Hey,

many thanks for your hint with the time sync, you are right the timesync was added later on. Thus I tried to compile the current main and connect it to my companion computer, however I cannot establish a microdds communication (simulation is working fine).
On the main, I ran make px4_fmu-v5 upload and adopted the rcS to work with the serial connection microdds_client start -t serial -d /dev/ttyS1 -b 921600 -l. With this setting, my companion computer does not find any published topic when I run ros2 run micro_ros_agent micro_ros_agent serial -D /dev/ttyTHS0 -b 921600.
However, this setup is working fine on 1.13.2 when running make px4_fmu-v5_rtps upload.

Am I missing here something?

@Julia_Nitsch Some things you might want to check

  • Were you running the micro_ros_agent also with RTPS? Have you checked on the fmu side if no other mavlink instance is using ttyS1?
  • In case you are using the snap packaged micro_ros_agent , you might need to grant hardware access
  1. No I was not running the micro_ros_agent with RTPS. For the RTPS communication I used the old micrortps_agent
  2. Yes, I already checked that there is no Mavlink instance running on the fmu and accidentally blocks the ttys1
  3. No I built the micro_ros_agent from source like explained in the tutorial and I mean it is working with the 1.13.2 thus probably not a permission problem

The -l flag is broken microdds_client: fix -l flag and add -c for custom participant configuration by bkueng ยท Pull Request #21150 ยท PX4/PX4-Autopilot ยท GitHub

Try without it :slight_smile:

2 Likes

Oh what a great hint! Many thanks that did the trick :+1:

โ€ฆ and timesync messages are working too and giving me reasonable values for RTT.