-
Notifications
You must be signed in to change notification settings - Fork 78
lifecycle api, types, tests & example #722
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for implementing this HUGE pull request and I look through it quickly, generally looks good! As I don't understand lifecycle comprehensively, I'd like to invite @koonpeng to review it, thanks!
this is quite a large PR, I may need some time to review this 😅. I don't have experience with lifecycle nodes as well so I will just try to review based on my knowledge of rcl. |
@koonpeng @minggangw et al, please ping me if I can be of assistance during the review. At work I usually start reviews by asking the dev how comfortable he/she is with a specific unit of code, are there any hot spots or overly complex areas that he has concerns. With that I'll share 2 areas that need discussion:
edited @wayneparrott - Please hold off on further review. While describing design issue #2 below I identified a simplification which I will submit an update later today.
|
The latest commit should be the one. It includes @minggangw earlier suggestions; especially see rclhandler.cpp free_ptr_. In lifecycle.js I switch to using lazy initialization of a couple of message interfaces which I feel is a good simplification from my initial commit. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Echoing back to SetAccessors
, I wonder if it's possible to bind all the rcl structs to js objects.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have no further comments, lgtm, and thanks for implementing this important feature, great progress!
I think we could move forward, @koonpeng any comments? @wayneparrott please merge it when it's good to go (soft reminder: please select "Squash and merge" option) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
Key Changes based on @minggangw comments and rethinking clunky initialalization of StateInterface and TransitionInterface. rcl_handle.hpp/cpp * added `free_ptr_` bool property to RclHandle lifecycle.js * removed initialize() function and refactored to use lazy initialization of StateInterface and TransitionInterface * update shutdown() to use rcl_lifecycle_shutdown_label
lifecycle api, types, tests & example.
This PR implements the ROS2 Lifecycle Node (managed node) as described in the ROS2 Managed Node design and implemented by the rclcpp lifecycle implementation.
Key changes:
index.js (updated)
index.ts (updated)
lifecycle.js (new)
index.d.ts (new)
rcl_lifecycle_bindings.hpp (new)
rcl_lifecycle_bindings.cpp (new)
lifecycle_publisher.js (new)
lifecycle_publisher.d.ts (new)
publisher.js (updated)
test-lifecycle.js (new)
test-lifecycle-publisher.js (new)
main.ts (updated)
lifecycle-node-example.js (new)
Fix #589