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

Feat time correction #7

Merged
merged 6 commits into from
Jun 16, 2022
Merged

Feat time correction #7

merged 6 commits into from
Jun 16, 2022

Conversation

nitin710
Copy link
Collaborator

@nitin710 nitin710 commented Jun 13, 2022

Description

  • Adds timecorrection to ofxLSL core.
  • Now timeCorrection() is accessible as a public function to convert LSL marker source time to receiver time

This was referenced Jun 13, 2022
Copy link

@produceconsumerobot produceconsumerobot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Couldn't test yet without sln, but generally looks good.

@@ -75,6 +80,7 @@ class Receiver : public BaseReceiver {
sampleBuffer->timeStamp = ts;
if (ts > 0) {
std::lock_guard<std::mutex> lock(pullMutex);
sampleBuffer->timeCorrection = getTimeCorrection(1); // update the time correction value when pulling sample

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What does a timeout return?
Are we able to handle that case reasonably downstream?

Copy link
Collaborator Author

@nitin710 nitin710 Jun 16, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested by making timenot = 0.1s. (getTimeCorrection(0.1)), and the example threw a lsl::timeout exception.

Copy link
Collaborator Author

@nitin710 nitin710 Jun 16, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

According to the library,

param timeout Timeout to acquire the first time-correction estimate (default: no timeout).

Looks like this timeout is only for the first correction. So it is better to remove the timeout all together, since it only affects the first reading.

Copy link
Collaborator Author

@nitin710 nitin710 Jun 16, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested working. If the stream is lost, it tries to reconnect to the stream.
image

@nitin710
Copy link
Collaborator Author

✔️ merging

@nitin710 nitin710 merged commit afb0ee0 into feat-lsl_1.14.0 Jun 16, 2022
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