Skip to content
This repository was archived by the owner on Oct 7, 2021. It is now read-only.

Pass timeout to rmw_wait#55

Merged
jacquelinekay merged 1 commit intomasterfrom
wait_timeout
Aug 5, 2015
Merged

Pass timeout to rmw_wait#55
jacquelinekay merged 1 commit intomasterfrom
wait_timeout

Conversation

@jacquelinekay
Copy link
Copy Markdown
Contributor

Connects to ros2/ros2#73

@jacquelinekay jacquelinekay added the in progress Actively being worked on (Kanban column) label Jul 24, 2015
@dirk-thomas
Copy link
Copy Markdown
Member

This needs a rebase since the commit list contains other commits.

@jacquelinekay jacquelinekay force-pushed the wait_timeout branch 2 times, most recently from 366017b to 2eac487 Compare July 25, 2015 00:28
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

As I was writing a test for this, I realized that the existing logic of this loop is not what I thought it was.

Old behavior:

  • Get "blocking" or "non-blocking in rclcpp.
  • In rmw implementation:
  • if non-blocking, call rmw_wait with a timeout of zero, and don't loop if timed out.
  • if blocking: while return code is timeout, wait for 1 second. throw if error, continue if retcode was not timeout. The executor will always block indefinitely inside of rmw_wait.

Here's what I think the new behavior should be:

Get timeout from rclcpp.

  • If NULL: block indefinitely in rmw_wait, by passing DURATION_INFINITE to WaitSet::Wait.
  • If positive: pass the timeout value to WaitSet::wait and return if timed out.
  • If non-blocking: same behavior as before.

Thoughts on this? (@wjwwood?)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

We discussed this off-line, and it seems that the DURATION_INFINITE is the right approach, since no additional checks are being done in the busy wait loop anyways. We're relying on our guard condition to wake the waitset up in an exit condition.

@dirk-thomas
Copy link
Copy Markdown
Member

+1

@esteve
Copy link
Copy Markdown
Member

esteve commented Aug 4, 2015

+1

1 similar comment
@wjwwood
Copy link
Copy Markdown
Member

wjwwood commented Aug 4, 2015

+1

@tfoote
Copy link
Copy Markdown
Contributor

tfoote commented Aug 4, 2015

+1 with squash/rebase

jacquelinekay added a commit that referenced this pull request Aug 5, 2015
@jacquelinekay jacquelinekay merged commit 0d7303a into master Aug 5, 2015
@jacquelinekay jacquelinekay removed the in progress Actively being worked on (Kanban column) label Aug 5, 2015
@jacquelinekay jacquelinekay deleted the wait_timeout branch August 5, 2015 02:25
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants