-
Notifications
You must be signed in to change notification settings - Fork 5
[RSDK-13174] Fixing spammy color and depth timsteamps differ logs #62
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
base: main
Are you sure you want to change the base?
[RSDK-13174] Fixing spammy color and depth timsteamps differ logs #62
Conversation
| if (ts > 0) { | ||
| return ts; | ||
| } | ||
| return frame->getSystemTimeStampUs(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
according to your description, it sounds like we shouldn't use system timestamp bc it's unreliable
why are we still using it as a fallback when somehow getGlobalTimeStampUs is LEQ 0?
also, how can getGlobalTimeStampUs be LEQ 0? have you observed this happening
could it happen when global timestamp is not enabled on the system?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should we log a single, not noisy warning that color-depth timestamp comparisons are not supported when global timestamp isn't available? Instead of falling back to the unreliable system timestamp?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
hmmm, another option would be to support system timestamp and put a threshold of perhaps 400ms between frames. My thinking is that it may be better to have that rough measurement than nothing, but totally open to discuss it.
what about in the models we unofficially support? |
|
When you say this do you mean Astra2 doesn't support using the Global timestamp? |
|
This old thread may be relevant: orbbec/OrbbecSDK_v2#92 We haven't tested their suggested fix yet if you want to try it, but if this works thats fine too |
I'm sorry I wasn't clear enough, I mean that Astra2 does support using the Global timestamp. |
Good call, the only other model we currently support is the Gemini35Le, and we officially support it (documentation here). I tested with it and it also supports global timestamps, so at this moment both our cameras support it. |
327f21c to
39ec6f6
Compare
|
@oliviamiller Is there any documentation on what the |
| std::unique_ptr<ViamOBDevice>& my_dev = search->second; | ||
|
|
||
| // Enable global timestamp if supported | ||
| if (my_dev->device->isGlobalTimestampSupported()) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Given that GlobalTimstamps are supported on the orbecc module we care about, can we remove the system backup?
| } | ||
|
|
||
| // Get the best available timestamp for a frame (Global > System) | ||
| uint64_t getBestTimestampUs(std::shared_ptr<ob::Frame> frame) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| uint64_t getBestTimestampUs(std::shared_ptr<ob::Frame> frame) { | |
| uint64_t getBestTimestampUs(const std::shared_ptr<ob::Frame>& frame) { |
[maybe nit] Should we pass in as const ref here so we do not increment/decrement the shared_pt every time the helper is called?
|
yes, docs here. "The Color and Depth should be set to same frame rates, the Color and Depth will be synchronized."
|
|
@oliviamiller Ty for the docs. But still confused on why this was suggested... I believe this is referring to syncing multiple orbec modules with hardware pwm input over |
yes that is what the ob_multi_device_sync_mode enum does, but the OB_MULTI_DEVICE_SYNC_MODE_STANDALONE option indicates that the device isn't syncing with any other cameras. Im assuming the default is OB_MULTI_DEVICE_SYNC_MODE_FREE_RUN which indicates |
Fixing
color and depth timestamps differ, defaulting to older of the twocolor timestamp was 1768433375958437 depth timestamp was 1768433375967415spammy logs.This is caused by the fact that the timestamp used is the system time of when the frame arrives to the host, not the timestamp of when the frame was captured at the device. We want to make sure that the frames were captured at the same time, so using System Time is not accurate
Instead, we are switching to using Global Timestamp, which is explained here from the documentation itself:
In my testing, the Astra2 device does support this feature, so the spammy logs are no longer seen.
Gemini 335LE cameras also supports this feature: