-
Notifications
You must be signed in to change notification settings - Fork 4.8k
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
An evident Timestamp gap between host and hardware #9495
Comments
Hi @oym1994 Global Time is designed to aid timestamp synchronization across multiple cameras. So it may not be necessary to use it if you are only using a single camera and a single stream (color). Could you provide information please about what you are trying to achieve in comparing system time and hardware time? This will help to provide an answer that is helpful to your needs. In general, if metadata support for hardware timestamps is enabled then hardware timestamps are provided by the SDK, otherwise software timestamps based on system time are provided if that metadata support is not enabled. In regard to your questions about the accuracy of your timestamp values, I do not personally have the specialist timestamp knowledge to offer advice on that particular subject. |
Thanks for ur kind response!For I want to do time synchronization with other device,such as lidar. My solution is to synchronize those device with the PC first!(which means the timestamps of all device are from PC). BTW,what do u mean when mentioning metadata support?How to verify whether it is supported in my current device and setting?Thanks again for ur kind help! |
Given that you are aiming to sync with non-D435i devices such as lidar, you could perhaps use the time_of_arrival timestamp, like a RealSense user in the link below did when synchronizing a RealSense D415 with a non-RealSense Stereolabs ZED depth camera. In the link below where a RealSense team member describes the different types of timestamp tha are supported by the RealSense SDK, time_of_arrival is defined as "host clock for the time when the frame buffer reaches Librealsense" In regard to metadata support, there are some types of timestamp that need to have an additional layer of support enabled in order to access their values. In some cases that support may be automatically included when installing the SDK by certain methods, such as in librealsense Debian packages or from source code over an internet connection using the RSUSB backend installation method. When building from source code on Linux without the RSUSB method, the kernel needs to be patched to add support for metadata in the SDK. On Windows, metadata support can be added by editing the Windows registry or by the much easier method of enabling it in the RealSense Viewer program. The SDK documentation link below states that when retrieving metadata with the get_timestamp() instruction, the timestamp types sensor_timestamp and frame_timestamp require metadata support to be enabled. You can read more documentation about SDK metadata here: https://dev.intelrealsense.com/docs/frame-metadata You can check whether metadata support is present with the SDK instruction rs2_supports_frame_metadata - there are C++ code example snippets for this in the metadata documentation: https://dev.intelrealsense.com/docs/frame-metadata#section-metadata-query-api https://dev.intelrealsense.com/docs/frame-metadata#section-librealsense2-api-for-metadata |
Hi @oym1994 Do you require further assistance with this case, please? Thanks! |
Case closed due to no further comments received. |
` //Get timestamp in the callback function
double hostTimeNow = System::Time::now().toSec();
double hardwareTime = data.get_timestamp() * 0.001;
mDriverHealth.mHardwareImageFps = 1 / (hardwareTime - mDriverHealth.mHardwareImageTime);
mDriverHealth.mHardwareImageTime = hardwareTime;
mDriverHealth.mHostImageFps = 1 / (hostTimeNow - mDriverHealth.mHostImageTime);
mDriverHealth.mHostImageTime = hostTimeNow;
output
HardwareImageFps: 30HostImageFps: 30
HostImageTime: 1627292572.279579162597656 HardwareImageTime: 1627292572.23203182220459; Time diff 0.04754734039306640625
`
Only color image is enabled and set RS2_OPTION_GLOBAL_TIME_ENABLED to be 1.
The problem is that the timestamp diff(0.047s) between the hardware and host is more than the image creation time interval(0.033s). Is it normal? I think the ideal timestamp diff is 0, am I right?
Thank you!
The text was updated successfully, but these errors were encountered: