ROS TimeStamp [closed]

asked 2021-11-03 15:42:26 -0500

NiranjanRavi gravatar image

updated 2021-11-03 15:43:19 -0500

Hi, I am working with ROS2 platform using USB Cams with my NVIDIA device. I am using this repo https://github.com/ros-drivers/usb_ca... to collect camera (3 cams) data individually and store it in my system. My cameras are collecting data at 45 fps (roughly).

For instance , one of the files has this extension, builtin_interfaces.msg.Time(sec=1635793569, nanosec=915083150).png

here 1635793569 = Monday, November 1, 2021 3:06:09 PM GMT-04:00 DST (checked it using epoch time converter)

Function used is: get_clock().now()

The problem i face is, when i try to concatenate files collected by different cameras, I am not able to find a right way. I want to concatenate images based on the closest milliseconds value. But all i see is sec and nsec in timestamps.

If i try to concatenate based on secs, lots of redundant data will occur since approximately 45 frames are collected for a second. It would be helpful if someone could guide me on the right path?

Thank you.

Regards Niranjan.

edit retag flag offensive reopen merge delete

Closed for the following reason duplicate question by NiranjanRavi
close date 2021-11-04 12:25:13.781853

Comments

You can either concatenate based on the nanoseconds value and seconds value together, or you can convert the nanoseconds to miliseconds. I'm not sure if this is what you are asking, though. Can you clarify your question?

Geoff gravatar image Geoff  ( 2021-11-03 18:43:14 -0500 )edit

Hi @NiranjanRavi not clear how you are trying to concatenate the filenames. You may consider using pandas. There is a good example https://towardsdatascience.com/machin...

osilva gravatar image osilva  ( 2021-11-03 18:44:03 -0500 )edit

Yes, i realized i can convert my nanoseconds to mill seconds and perform the concatenation. Thank you for your inputs.

NiranjanRavi gravatar image NiranjanRavi  ( 2021-11-04 12:25:07 -0500 )edit