Skip to content
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

rostime_converter loses nanosecond precision #543

Open
lucasw opened this issue Nov 8, 2022 · 0 comments
Open

rostime_converter loses nanosecond precision #543

lucasw opened this issue Nov 8, 2022 · 0 comments

Comments

@lucasw
Copy link
Contributor

lucasw commented Nov 8, 2022

This converts the time into floating point in order to translate from python rostime to C++ rostime, and nanosecond precision is lost:

https://github.com/ros/geometry2/blob/noetic-devel/tf2_py/src/tf2_py.cpp#L150-L161

I ran into this doing exact time syncs which dropped all the messages out of a node doing tf transform lookups in python, the looked up transforms had stamps that were slightly off from the stamp I requested to be looked up and I was putting them into output messages assuming they were the same.

I don't know if this is correct PyObject usage but a partial solution is here, I can turn it into a PR, cover ros::Duration conversion as well:

lucasw@26feffa

And there must be converters going the other direction from C++ to python with probably the same problem- but I didn't see them after a quick look. And maybe some other similar time converters exist in other packages?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant