Add a tutorial on Lifecycle nodes
Extend the Intermediate tutorials with a chapter on implementing Lifecycle nodes and designing APIs using NodeInterfaces such that the APIs work with both regular Nodes and LifecycleNodes.
- [ ] Add a tutorial on implementing lifecycle nodes, their various on_* methods, transitioning states via cli commands & launch actions.
- [x] Add a tutorial designing APIs using
NodeInterfaces: https://github.com/ros2/ros2_documentation/pull/4992
Just for clarity here, you are asking for an example node that implements both the standard node interface and the lifecycle node interface.
Roughly this means that the standard node interface performs the primary state's / transitions when it is instantiated as a standard node? If this is the case, it might be helpful to have a paster template that people can re-use as a starting point.
Do you have a good example of NodeInterfaces being used with a lifecycle node out in the wild? Even tests might be helpful here.
I was alluding to following the pattern described by @methylDragon in his lightning talk.
This would encourage more users to use LifecycleNodes while keeping other APIs compatible with both Node and LifecycleNode.
Perfect. Thanks. I can work with this! I may even be able to find a new contributor to do it.
This issue has been mentioned on ROS Discourse. There might be relevant details there:
https://discourse.ros.org/t/ros-news-for-the-week-of-january-13th-2024/41608/1
This issue has been mentioned on ROS Discourse. There might be relevant details there:
https://discourse.ros.org/t/ros-news-for-the-week-of-january-20th-2025/41719/1
I may even be able to find a new contributor to do it.
Is there a way I can be of assistance? Im not an expert by any means but i would like to get my hands dirty with this one.
@NickTziaros by all means! Give it a shot.
Make sure to take a look at the docs readme and the contributing guide. Make sure to put your editor into whitespace mode as the linter is really particular.
Thanks for the help @NickTziaros.
So we're still missing a tutorial on implementing lifecycle nodes, their various on_* methods, transitioning states via cli commands & launch actions. @NickTziaros's addition can be extended to include these topics. Should we keep this ticket open or open a separate one?
@Yadunund good eye, let's reopen this.
I've updated the description accordingly 👍🏼
Good catch @Yadunund. Sorry about that.
On the other hand we really need to work towards smaller, faster pull requests and this fits that pattern.
So we're still missing a tutorial on implementing lifecycle nodes, their various on_* methods, transitioning states via cli commands & launch actions
I might as well make this one too :D
I made a PR #5038, adding
+Output:
+
above
[INFO] [Simple_Node]: Node name: Simple_Node
[INFO] [Simple_LifeCycle_Node]: Node name: Simple_LifeCycle_Node
for consistency. Somehow I missed it the first time.
I noticed that there is already a quite thorough tutorial on Lifecycle nodes code in the Demo section under Managing nodes with managed lifecycles. Wouldn't it be redundant if we added another? Additionaly, the link rosindex is broken.
@NickTziaros I think we're fine with a little redundancy but we should cross reference the two.
With respect to ROS Index we've been doing some work to improve index search and remove redundant package listings. I think this is the package that we should have there.