[humble] Autostarting lifecycle nodes and example launch file demo (backport #430)#476
[humble] Autostarting lifecycle nodes and example launch file demo (backport #430)#476mergify[bot] wants to merge 2 commits intohumblefrom
Conversation
|
Cherry-pick of 3569f0d has failed: To fix up this pull request, you can check it out locally. See documentation: https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/reviewing-changes-in-pull-requests/checking-out-pull-requests-locally |
|
Note: #449 is a follow-up fix to the PR that this backports, so it should be backported after this too. |
|
@emersonknapp since you requested this backport, would you be willing to fix the merge conflicts? |
|
@christophebedard done! |
|
@Mergifyio rebase |
* autostarting lifecycle nodes and example Signed-off-by: Steve Macenski <stevenmacenski@gmail.com> * fix linting Signed-off-by: Steve Macenski <stevenmacenski@gmail.com> * fix linting Signed-off-by: Steve Macenski <stevenmacenski@gmail.com> * removing an unused variable Signed-off-by: Steve Macenski <stevenmacenski@gmail.com> * initializing a member client as none like sub Signed-off-by: Steve Macenski <stevenmacenski@gmail.com> * completing auto-start feature for composition nodes Signed-off-by: Steve Macenski <stevenmacenski@gmail.com> * linting Signed-off-by: Steve Macenski <stevenmacenski@gmail.com> * final linting fix Signed-off-by: Steve Macenski <stevenmacenski@gmail.com> * Resolving issue with StateTransition messages Signed-off-by: Steve Macenski <stevenmacenski@gmail.com> * removing Node's autostart Signed-off-by: Steve Macenski <stevenmacenski@gmail.com> * Fixing lifecyclenode type Signed-off-by: Steve Macenski <stevenmacenski@gmail.com> * update docstring Signed-off-by: Steve Macenski <stevenmacenski@gmail.com> * adding in composable lifecycle node Signed-off-by: Steve Macenski <stevenmacenski@gmail.com> * Adding docstring Signed-off-by: Steve Macenski <stevenmacenski@gmail.com> * require autostart non-None Signed-off-by: Steve Macenski <stevenmacenski@gmail.com> * remove unused imports Signed-off-by: Steve Macenski <stevenmacenski@gmail.com> * review comments continued Signed-off-by: Steve Macenski <stevenmacenski@gmail.com> * is lifecycle node and autostart to lifecycle-only classes Signed-off-by: Steve Macenski <stevenmacenski@gmail.com> * final bits Signed-off-by: Steve Macenski <stevenmacenski@gmail.com> * whoops, remove the Avatar-inspired printout Signed-off-by: Steve Macenski <stevenmacenski@gmail.com> * finish linting Signed-off-by: Steve Macenski <stevenmacenski@gmail.com> * review fix Signed-off-by: Steve Macenski <stevenmacenski@gmail.com> * remove old import Signed-off-by: Steve Macenski <stevenmacenski@gmail.com> --------- Signed-off-by: Steve Macenski <stevenmacenski@gmail.com> (cherry picked from commit 3569f0d) # Conflicts: # launch_ros/launch_ros/actions/load_composable_nodes.py # launch_ros/launch_ros/event_handlers/on_state_transition.py
Signed-off-by: Emerson Knapp <emerson.b.knapp@gmail.com>
✅ Branch has been successfully rebased |
6613fc7 to
4ffc49c
Compare
|
Pulls: #476 |
|
@ros-pull-request-builder retest this please |
| *, | ||
| entities: SomeActionsType, | ||
| target_lifecycle_node: LifecycleNode = None, | ||
| entities: SomeEntitiesType, |
There was a problem hiding this comment.
This isn't imported and it doesn't exist in Humble: https://github.com/ros2/launch/blob/rolling/launch/launch/some_entities_type.py
|
what's the status of this PR @emersonknapp @christophebedard ? |
|
Ah, sorry I've let it linger so long. There's a couple utilities that this diff depends on that aren't in this backport so it doesn't work right now. Requires just a bit of manual tweaking, should be easy but I haven't been able to get to it yet. Maybe a priority in the next week or two, since I mention it briefly in my roscon talk 😅 |
This resolves #418 which implements autostarting lifecycle nodes. This is complete and ready for a review
You'll notice a couple of key changes worth explaining:
There is a new
is_lifecycle_nodeattribute of the node and lifecycle nodes which is needed to remove a circular dependency on the LifecycleNode within theLifecycleTransitionclass which only is type checking. I replace this type check with checking if a non-None object (1) has the attribute at all and (2) has a lifecycle attribute with appropriate logging between the difference of a non-lifecycle node being attempted vs a non-node. This has been tested as well to function using the demos.You will also notice that I refactored lifecycle node to have a separate util
LifecycleEventManager, who handles the event emitting, handling, and topic listening for lifecycle nodes. This way, this can be used in lifecycle-components as well! No changes were made here except removing theself.__current_statevariable which was completely unused. TheLifecycleEventManageris only created if the node requests autostart at Launch time and otherwise has no overhead nor exposes the interfaces/event handler/emitter if its a non-lifecycle node.The component nodes don't add a
/before the node names with the namespaces. This messes with the node event matcher. I add in a leading/so that theaction.node_name == node_namewhich has the/forcably applied in the node event matcherI tested
LifecycleNode,ComposableNodeContainer,LoadCompoableNodesfor all cases:autostart=Trueautostart=False, andautostartfield not supplied. You can also run any experiments you like using the 2 extra launch files I provide in the examples directory which shows all the features at work/This is an automatic backport of pull request Autostarting lifecycle nodes and example launch file demo #430 done by Mergify.