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

Fixed wrong image timestamp due to missing handling of microseconds in epoch time shift #267

Merged
merged 2 commits into from
Jul 22, 2023

Conversation

boitumeloruf
Copy link
Contributor

Before, in the calculation of the epoch time shift the offset was rounded to seconds and, thus, cutting off a shift in milli- and microseconds. This would be fine if the v4l2 buffer timestamp would be synced to the wall time on the bases of seconds. But this is not the case and, thus, the subsequent calculation of the image timestamp was wrong since the sub-second shift was missing.

I corrected this by computing the epoch time shift in microseconds (which is the smallest unit of epoch_time in the type of timeval. Then in the calculation of the image timestamp, the buffer time is first converted into microseconds before the epoch time shift is added. Afterwards, it is split into seconds and nanoseconds for the image timestamp.

This PR implicitly PR #261. And I think this also resolves the issue #259 .

@flynneva flynneva self-requested a review July 22, 2023 19:50
@flynneva flynneva merged commit c743cb1 into ros-drivers:ros2 Jul 22, 2023
3 checks passed
@flynneva
Copy link
Collaborator

@boitumeloruf thanks for the contribution 🙏🏼

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

Successfully merging this pull request may close these issues.

2 participants