Skip to content

GlobalTimestampFitter: custom host timestamp#160

Open
wolfd wants to merge 1 commit into
orbbec:mainfrom
AutoPallet:custom-global-timestamp
Open

GlobalTimestampFitter: custom host timestamp#160
wolfd wants to merge 1 commit into
orbbec:mainfrom
AutoPallet:custom-global-timestamp

Conversation

@wolfd

@wolfd wolfd commented May 19, 2026

Copy link
Copy Markdown

This change allows the SDK user to provide a custom timestamp function. The current default timestamp function gets the global time, which is subject to NTP updates. Some users (e.g. me) might want to replace the estimated timestamp with their own function so that we can use a monotonic time source.

IGlobalTimestampFitter gets two new methods:

  • setHostClockFn: replace the default clock function with a custom one
  • setMaxValidRtt: now exposed in the interface, the max RTT before discarding a time sample.

HostClockFn is expected to return a microsecond time value.

The new functionality is also exposed in the C API.

This change allows the SDK user to provide a custom timestamp function.
The current default timestamp function gets the global time, which is
subject to NTP updates. Some users (e.g. me) might want to replace the
estimated timestamp with their own function so that we can use a
monotonic time source.

`IGlobalTimestampFitter` gets two new methods:
- `setHostClockFn`: replace the default clock function with a custom one
- `setMaxValidRtt`: now exposed in the interface, the max RTT before
  discarding a time sample.

`HostClockFn` is expected to return a microsecond time value.

The new functionality is also exposed in the C API.
@simbachou

Copy link
Copy Markdown
Collaborator

Thanks for the contribution and the clear write-up!

We actually have an internal development build that already supports a monotonic host timestamp source for the global timestamp fitter, and we plan to release it on GitHub in the near future. Because of that, we won't be merging this PR — but the motivation here is exactly right, and it lined up with what we were already building. Really appreciate you taking the time to put this together.

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