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

rate.sleep will sometimes return slightly early from a sleep #190

Closed
tfoote opened this issue Dec 18, 2015 · 4 comments
Closed

rate.sleep will sometimes return slightly early from a sleep #190

tfoote opened this issue Dec 18, 2015 · 4 comments

Comments

@tfoote
Copy link
Contributor

tfoote commented Dec 18, 2015

I was working on the unit tests with @gerkey for rate.sleep and expected the sleep to not return before expected.

On repeated runs it had a jitter on the order of 10us. (The printout is in nanoseconds. and the expected duration is 100 ms

Console output of observed delta: https://gist.github.com/tfoote/0ec473b38bc517d12779

We added an epsilon to the unit tests for now (#182), but we should review our code to make it as consistent as with the assumptions of developers who are used to calling the standard sleep methods.

@jacquelinekay
Copy link
Contributor

Is the console output from Linux?

@gerkey
Copy link
Member

gerkey commented Jan 8, 2016

This problem was fixed in the test, in #191.

@gerkey gerkey closed this as completed Jan 8, 2016
@jacquelinekay
Copy link
Contributor

But the issue that Rate::sleep wakes up 10 microseconds early still persists, right?

@gerkey
Copy link
Member

gerkey commented Jan 8, 2016

Nope, it was working properly the whole time. The bug was in the test, which caused the addition of the epsilon workaround mentioned here. But then the test was fixed and the workaround removed.

nnmm pushed a commit to ApexAI/rclcpp that referenced this issue Jul 9, 2022
* allocate memory for rmw types and not rcl types in waitset RMW storage

* zero initialize memory on resize and clear

* add missing void * cast to make windows happy

* set mem after checking successful alloc and use right type for rmw storage

* another instance of cast to (rmw_ ## Type ## _t *) instead of (void *)
DensoADAS pushed a commit to DensoADAS/rclcpp that referenced this issue Aug 5, 2022
Signed-off-by: Michel Hidalgo <michel@ekumenlabs.com>
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

No branches or pull requests

3 participants