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

Add support for node composition #139

Open
nnmm opened this issue Apr 30, 2022 · 3 comments
Open

Add support for node composition #139

nnmm opened this issue Apr 30, 2022 · 3 comments

Comments

@nnmm
Copy link
Contributor

nnmm commented Apr 30, 2022

See https://docs.ros.org/en/rolling/Concepts/About-Composition.html and https://docs.ros.org/en/rolling/Tutorials/Composition.html

@esteve
Copy link
Collaborator

esteve commented May 2, 2022

This one might be a bit tricky, but doable anyway. The tricky part is that in rclcpp and rclpy, nodes inherit from Node, which obviously we can't in Rust. The way I solved this in rcljava is by creating an interface called ComposableNode, which contains a reference to the Node base class.

For Rust, we can have a similar trait, with a default implementation, e.g.

pub trait Node {
  fn create_publisher(&self, ...) {}
}

impl Node for MyNode {
  fn do_stuff(&self) {
    let publisher = self.create_publisher(...);
  }
}

@nnmm
Copy link
Contributor Author

nnmm commented Jun 5, 2022

This issue hinges on #126.

@nnmm
Copy link
Contributor Author

nnmm commented Aug 20, 2022

One thing I realized is that if we don't use a global context, component nodes will have to communicate across participants, which might be more expensive, not sure.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants