Skip to content

wake up spin when new waitable things are added to a node #209

Closed

Description

@wjwwood

For example:

auto node = rclcpp::Node::make_shared("node_name");
rclcpp::executors::SingleThreadedExecutor executor;
executor.add_node(node);
std::thread spin_thread([&executor]() {executor.spin();});
auto timer = node->create_timer([]() {printf("hello world\n");});
spin_thread.join();

This code may never print "hello world" if the spin call starts before the timer is created. So to fix this, any time something that is affected by spinning is added to a node, spin should be woken up so that it can consider new work.

To accomplish this, each node will probably need a new guard condition which is triggered any time something new is added that needs to wake up spin. This would probably include subscriptions, timers, service servers or clients, and parameter servers or clients.

Activity

  1. self-assigned this
    on Mar 16, 2016
  2. added
    in progress
    in review
    and removed
    in progress
    on Mar 16, 2016
  3. self-assigned this
    on Mar 25, 2016
  4. added
    in progress
    in review
    and removed
    in review
    in progress
    on Mar 25, 2016
  5. removed
    in review
    on Apr 1, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions