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 @JulianOestutorial 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
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
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
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.
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.
No I was not running the micro_ros_agent with RTPS. For the RTPS communication I used the old micrortps_agent
Yes, I already checked that there is no Mavlink instance running on the fmu and accidentally blocks the ttys1
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
I have some question related to time syncing between PX4 and ROS 2.
I am setting up visual inertial SLAM system on a drone, and as you may know the camera images and the IMU time stamps have to be accurate for a usable and successful estimation.
I am using the v1.14beta vesion of PX4, and ROS 2 humble. I use MicroXRCEAgent to communicate with PX4. I get the IMU measurements from the fmu/out/sensor_combined topic, which look like this
Now, the important part is the timestamp field of the message in the topic. Is this timestamp of the PX4 or the ROS side?
My camera images are published with ROS timestamps, and of course, the IMU readings need to be published with ROS timestamps as well in order for the SLAM software to work properly.
If the timestamp in the fmu/out/sensor_combined corresponds to PX4 clock, how can I synchronize it with ROS clock ?
That makes it easier. So, now what I understand is that, in ROS on the companion computer, I can use the timestamp in any of the fmu/out/* topics without any modifications.
first of all sorry for my super late response. In theory that should work out of the box. However, I would still recommend you to double check the timestamps to be sure. I had some trouble due to delays (most likely due to overloaded system) For example, if you are syncing the camera for your SLAM algorithm, you could use some AR tags and compare the visual movement with the one detected from the IMU.
I am going to use a stereo camera from Arducam and the IMU from the Orange Cube with the isaac_ros_visual_slam. I will first do the calibration process using Kalibr, then test the SLAM system. I will share my findings once done.