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

When is time stamp of frame captured? #11330

Closed
reinzler opened this issue Jan 18, 2023 · 13 comments
Closed

When is time stamp of frame captured? #11330

reinzler opened this issue Jan 18, 2023 · 13 comments
Labels

Comments

@reinzler
Copy link

I have to know precision time of the end of exposure, how can i get it?
I saw get_timestamp() function but i'm not sure that it is exactly what i need.

@MartyG-RealSense
Copy link
Collaborator

MartyG-RealSense commented Jan 18, 2023

Hi @reinzler There are a range of different timestamps that have different characteristics. At #2188 (comment) a RealSense team member provides a list of timestamp types and descriptions for them, and further information about how the timestamps work at #4525

In regard to references in these lnks about Global Time (which is enabled by default on 400 Series cameras), information can be found at #3909

Documentation for the get_timestamp() instruction can be found at the link below.

https://intelrealsense.github.io/librealsense/doxygen/classrs2_1_1frame.html#a25f71d45193f2f4d77960320276b83f1

My understanding from the above information resources is that if hardware timestamps are available then get_timestamp() provides the frame_timestamp, which designates the beginning of UVC frame transmission (the first USB chunk sent towards host) and readout begins after exposure is completed.

@reinzler
Copy link
Author

Thanks for fast responce, how can I get FRAME_TIMESTAMP using Python?

@MartyG-RealSense
Copy link
Collaborator

First, disable Global Time using the Python code at #9172 (comment)

You should be able to obtain frame_timestamp using the Python code below.

frames.get_frame_metadata(rs.frame_metadata_value.frame_timestamp)

An example of Python code for printing the frame_timestamp metadata value is at #9891

@reinzler
Copy link
Author

Thanks, how I can convert the Hardware clock to epochs to compare with the global time?

@MartyG-RealSense
Copy link
Collaborator

MartyG-RealSense commented Jan 19, 2023

The section of the global timestamp system's code that makes use of EPOCH is at the link below.

https://github.com/IntelRealSense/librealsense/blob/master/src/global_timestamp_reader.cpp#L208-L211

My understanding from IntelRealSense/realsense-ros#1906 (comment) is that global time is not a direct conversion of the hardware time, but instead uses the system clock as a means to perform correction of the hardware timestamp.

@MartyG-RealSense
Copy link
Collaborator

Hi @reinzler Was the information in the above comment helpful to you, please? Thanks!

@reinzler
Copy link
Author

Yes, it was helpful, thanks, another question - is it possible to fuse data from 2 different IMU ( VN100, Bosh BMI055), GPS (HERE 3) and SLAM from IntelRealSense D455 using ROS robot_localization package?

@MartyG-RealSense
Copy link
Collaborator

MartyG-RealSense commented Jan 29, 2023

Multiple sensors, such as multiple IMUs, can be fused in robot_localization using state estimation nodes, as described at the robot_localization documentation link below.

http://docs.ros.org/en/kinetic/api/robot_localization/html/configuring_robot_localization.html#the-differential-and-relative-parameters

Intel's RealSense SLAM guide for ROS makes use of robot_localization, though there have not been previous cases of the SLAM data being used with sensors other than a single IMU-equipped RealSense camera.

https://github.com/IntelRealSense/realsense-ros/wiki/SLAM-with-D435i

@reinzler
Copy link
Author

Thank you very much for fast and useful response!

@reinzler
Copy link
Author

Thank you for your help, a have another question, can I pass some prepared in advance data from D455 to ROS robot_localization library to produce some simulation?

@MartyG-RealSense
Copy link
Collaborator

MartyG-RealSense commented Jan 30, 2023

Intel's SLAM guide suggests replaying a saved RealSense bag file by setting the rosparam use_sim_time to true and then reading the bag with rosbag play

roscore >/dev/null 2>&1 &
rosparam set use_sim_time true
rosbag play my_bagfile_1.bag --clock
roslaunch realsense2_camera opensource_tracking.launch offline:=true

The link below suggests a method for loading a bag file directly into robot_localization.

https://answers.ros.org/question/268046/robot_localization-and-bag-file-output/?answer=268228#post-id-268228

@MartyG-RealSense
Copy link
Collaborator

Hi @reinzler Do you require further assistance with this case, please? Thanks!

@MartyG-RealSense
Copy link
Collaborator

Case closed due to no further comments received.

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

No branches or pull requests

2 participants