Hi all,
I'm looking into timesync for our OAK-d PoE S2 camera.
I'm using the DepthAI ROS driver, where I find the header.stamp is assigned as github_link.
I read that the device clock is
depthai clock dai.Clock.now()
(Python) or dai::Clock::now()
(C++) is a monotonic clock that is used for timestamps in the depthai library. It is derived from std::chrono::steady_clock
and is not affected by system time changes (eg. NTP sync).
(source).
I get that the steady_clock of the camera is not affected by system time changes. However, is it expected that my ros messages header.stamp
values also don't reflect changes in system time?
I do want the header.stamps to reflect the host system time, which in my case is continuously synced with GPS time.
To test the current behavior (simulating host system time changes), I manually change the host system time a few seconds into the past or future. I find that the ROS wall time follows, but the header.stamp timestamp inside OAK messages does not (even after waiting a while for the timesync interval to pass).
Diving a bit deeper into the driver, I find that there is actually a time offset tracked between the host and the device, to convert the device's timestamp to a ROS epoch timestamp. I would expect this offset to align the header.stamp with my host system time again.
In updateBaseTime
(link) I see the rclBaseTime
getting updated, but since it is passed as a copy this change is not stored. Is that the expected behavior? Looks to me like this variable would be able to let the header.stamp reflect the updated system time.
So to summarize, I have two questions:
- Is it expected that the header.stamp values assigned in the ROS driver do not reflect changes in system time?
- And if that is true, is there any way to still achieve this?
Thanks in advance