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

fix dds metadata timestamp to be in ms #12755

Closed
wants to merge 1 commit into from

Conversation

maloel
Copy link
Collaborator

@maloel maloel commented Mar 14, 2024

Using f.get_frame_metadata(rs.frame_metadata_value.frame_timestamp):

Under DDS mode, LibRS metadata hw timestamp is Nanosecond (ns).
939660614000
939693958000

However, under USB mode, hw timestamp is Microsecond (us).
319109940
319143273

rs2_time_t is supposed to be in milli, so it looks like the conversion we made was off by 1000 and stored as micro.

Tracked on [RSDEV-1805]

@maloel maloel requested a review from OhadMeir March 14, 2024 11:30
@@ -274,7 +274,7 @@ void dds_sensor_proxy::handle_video_data( realdds::topics::image_msg && dds_fram
{
frame_additional_data data; // with NO metadata by default!
data.timestamp // in ms
= static_cast< rs2_time_t >( realdds::time_to_double( dds_frame.timestamp ) * 1e3 );
= static_cast< rs2_time_t >( realdds::time_to_double( dds_frame.timestamp ) * 1e6 );
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we test the timestamp in the unit test. How did it pass so far?
https://github.com/IntelRealSense/librealsense/blob/development/unit-tests/dds/test-metadata.py#L194

@maloel
Copy link
Collaborator Author

maloel commented Mar 19, 2024

Closing as root cause is unknown and solution in doubt

@maloel maloel closed this Mar 19, 2024
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