-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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
UniversalTimeScaleClock now() and conversion from unix time #411
Comments
Can you explain a bit what you are trying to do? The reason that there is no Regarding a conversion from |
Unfortunately my sensors can't do hardware time synchronization so I'm trying to estimate the skew between multiple hardware times and local machine time in software across multiple hardware devices. Some of the reasons timing/synchronization is important are discussed in #242. This involves timestamping before making data requests and after they are received on multiple sensors so I can better estimate when in local machine time the data was collected, so I can then determine a corrected hardware time stamp that most accurately matches between two data sources and correctly sample in the pose interpolation buffer. An example of this sort of thing is TicSync/TriggerSync (pdf). Other approaches to time synchronization are implemented in https://github.com/ethz-asl/kalibr with various tradeoffs. |
I disagree on this point because I have found fusing multiple data sources according to a common time frame to be a very sound and well studied approach to reducing noise/error and improving the accuracy of world state estimates. |
Thanks for the context. There is no fixed relationship between Trying to get the best possible estimate for sensor timing as you suggest is indeed a very good idea. These timestamps have to be accurate relative to each other. Shifting all sensor timestamps by a fixed offset to the correct date and time has no influence on the quality of the resulting trajectory. An approach could be: Computing the offset once at the very beginning, add this constant offset to all sensor data. If you need to convert from a Unix epoch timestamp to UniversalTimeScaleClock for this, you'd have to add |
Yes, I agree. This makes sense now that we are on the same page, thanks. I think in practice every major OS, compiler, and standard library implements unix time. However, Considering that, would you consider accepting a PR with either of the following or should I just keep things in user code?
I'd prefer to rely on the ad-hoc convention over runtime estimation when it is feasible and correct on my platform, unless there's another approach that would have no limitations?
Thanks! |
I'm going to vote with @wohe on this and say that |
Ok fair enough, thanks! |
* support map loading in offline node * support map loading in offline node * offline_node_main.cc add todo to replace loadmap later * rename map_filename to pbstream filename
It seems the UniversalTimeScaleClock doesn't have a
now()
function. Additionally, it isn't clear to me how to convert thestd::chrono::steady_clock::time_point
fromstd::chrono::steady_clock::now()
tocartographer::common::Time
. I saw that there are ROS conversions in cartographer_ros, but that requires ROS as a dependency,What is the best way to convert
std::chrono::steady_clock::time_point
and get the current time incartographer::common::Time format
with high precision?Perhaps an addition for
now()
such as https://stackoverflow.com/a/17138183/99379 would be appropriate?I'm not 100% sure if I'm supposed to subtract or add
kUtsEpochOffsetFromUnixEpochInSeconds
though...update: adding is the correct behavior
The text was updated successfully, but these errors were encountered: