-
Notifications
You must be signed in to change notification settings - Fork 148
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Non-monotonic time results in damaged t
field of pointclouds
#46
Comments
The way I understood the issue is that it only happens when the sensor is connected to a PTP clock and the clock is making some adjustments? Right? I don't think I have seen a case in our packets where the time of valid packets on a standalone sensor (i.e. without a PTP master) having timestamps that is not constantly increasing. I do have some experience with PTP clocks and I have observed adjustments taking place but I didn't think it could - substantially - affect the timestamps within a single frame to the degree you report. |
It apparently can happen :) And yes, we use PTP automotive profile. I'll try to record a bag file the next time it happens. It might be caused by our a bit complicated setup where the time master of Ouster syncs itself against another grand master. I suspect the time sync might get into some oscillations in some cases which then cause this behavior. |
If it is ok I would like to join in this discussion :) Line 185-186 in the current master does some std::min() action. But as the time within one scan increases it should output always the time of scan_ts <- first column. Shouldn't t within the point field contain the delta from time of the first valid column until the current column? e.g.:
|
I agree I thought that would be the case, but I think our firmware doesn't behave this way and still fills the time and sends packets for all the I saw your PR which addresses this problem and I do intend to take a look at it but definitely not before having #67 merged first. |
Sry, I rushed into this topic as my timestamps (PTP) looked off and I linked it to the Nevertheless, my testing with FW2.4. showed, that if one has configured some azimuth FoV the timestamps outside of this range are 0.0. |
This code and some other similar instances
ouster-ros/src/os_ros.cpp
Lines 151 to 157 in b5393ca
makes an assumption about monotonically increasing timestamps in the lidar packets. However, that is not guaranteed.
For example, we discipline Ouster clock via PTP automotive profile which can move the clock pretty fast, including discrete time jumps in both directions.
What happens in the driver code is that the scan timestamp is taken as the first timestamp in the scan. However, subsequent timestamps may be smaller, the subtraction yields negative numbers, and the
static_cast<uint32_t>
returns values close to the max representableuint32_t
as it underflows, which is somewhere around 4e9. That would mean some points in the scan were captured about 4 seconds after the time inheader.stamp
, which is of course nonsense.Here is an example plot of the timestamps in a single scan that was affected by this bug:
There are several possibilities what can be done with such scans:
n
invalid values by the jump size, which would make the timestamps again continuous. The scan start time has to be recomputed afterwards.I can imagine different use-cases will have different preferences about what to do in this case.
If you'd like, I can share the fix I did in our custom driver. However, first it would be good to figure out which approaches should be implemented in this driver.
The text was updated successfully, but these errors were encountered: