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

Reduce TransformListener nodes #440

Closed
gezp opened this issue Jul 29, 2021 · 4 comments
Closed

Reduce TransformListener nodes #440

gezp opened this issue Jul 29, 2021 · 4 comments

Comments

@gezp
Copy link
Contributor

gezp commented Jul 29, 2021

hi, I'm working for Summer Student Program of Navigation2 : reduce the number of nodes running in Nav2 (tickets in Nav2), due to Node is overhead in ROS2.

When i reduce amcl_node nodes, i notice that the constructor of TransformListener has a argument spin_thread with default value true, which create a internal node to subscribe tf topic and a dedicated thread to spin this node.

i think the best way is to use new callback group and executor with dedicated thread so that we could avoid creating internal node which is overhead.

  • If spin_thread, then create new callback group, and use executor to spin callback group instead of node.
  • If not spin_thread, then its on the application to spin (no change)

After implementing this feature, we can use TransformListener in Node (for example AmclNode) like this to avoid creating internal Node.

tf_buffer_ = std::make_shared<tf2_ros::Buffer>(get_clock());
tf_listener_ = std::make_shared<tf2_ros::TransformListener>(
   *tf_buffer_, shared_from_this(), true);

any discussion is welcome, and i will make a PR if this feature is good.

@SteveMacenski
Copy link
Contributor

Our goal is to make each server in Nav2 only have a single ROS node and making best practices use of executors. TF creates a node in the Listener which we argue should not be there and instead use an input node + an executor as needed.

@clalancette
Copy link
Contributor

Now that we've merged #442, can we close this one?

@SteveMacenski
Copy link
Contributor

Indeed

@clalancette
Copy link
Contributor

Thanks, closing.

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