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

StaticSingleThreadedExecutor uses spin_once in spin #2470

Open
jmachowinski opened this issue Mar 31, 2024 · 1 comment · May be fixed by #2473
Open

StaticSingleThreadedExecutor uses spin_once in spin #2470

jmachowinski opened this issue Mar 31, 2024 · 1 comment · May be fixed by #2473

Comments

@jmachowinski
Copy link
Contributor

jmachowinski commented Mar 31, 2024

This change seems to have been made in #2142

https://github.com/ros2/rclcpp/blob/c5bc4b65284c71a86fc1758cc7eeb22204aa2bdd/rclcpp/src/rclcpp/executors/static_single_threaded_executor.cpp#L41C1-L43C4

  while (rclcpp::ok(this->context_) && spinning.load()) {
    this->spin_once_impl(std::chrono::nanoseconds(-1));
  }

I guess it should be

  while (rclcpp::ok(this->context_) && spinning.load()) {
    this->spin_all(std::chrono::nanoseconds(0));
  }

@mjcarroll @wjwwood

@alsora
Copy link
Collaborator

alsora commented Mar 31, 2024

I think that in theory, with #2142, the performance of the SingleThreadedExecutor should have become comparable to the StaticSingleThreadedExecutor, which could thus be removed.

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 a pull request may close this issue.

2 participants