-
Notifications
You must be signed in to change notification settings - Fork 91
Autostarting lifecycle nodes and example launch file demo (backport #430) #438
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
|
@methylDragon if you have some time, could you review this backport with an eye towards likelihood of regressions in jazzy? @SteveMacenski fyi |
|
Friendly ping @methylDragon |
|
Thanks! I look forward to this! |
|
#449 should be backported after this, too. |
|
@Mergifyio rebase |
* autostarting lifecycle nodes and example Signed-off-by: Steve Macenski <[email protected]> * fix linting Signed-off-by: Steve Macenski <[email protected]> * fix linting Signed-off-by: Steve Macenski <[email protected]> * removing an unused variable Signed-off-by: Steve Macenski <[email protected]> * initializing a member client as none like sub Signed-off-by: Steve Macenski <[email protected]> * completing auto-start feature for composition nodes Signed-off-by: Steve Macenski <[email protected]> * linting Signed-off-by: Steve Macenski <[email protected]> * final linting fix Signed-off-by: Steve Macenski <[email protected]> * Resolving issue with StateTransition messages Signed-off-by: Steve Macenski <[email protected]> * removing Node's autostart Signed-off-by: Steve Macenski <[email protected]> * Fixing lifecyclenode type Signed-off-by: Steve Macenski <[email protected]> * update docstring Signed-off-by: Steve Macenski <[email protected]> * adding in composable lifecycle node Signed-off-by: Steve Macenski <[email protected]> * Adding docstring Signed-off-by: Steve Macenski <[email protected]> * require autostart non-None Signed-off-by: Steve Macenski <[email protected]> * remove unused imports Signed-off-by: Steve Macenski <[email protected]> * review comments continued Signed-off-by: Steve Macenski <[email protected]> * is lifecycle node and autostart to lifecycle-only classes Signed-off-by: Steve Macenski <[email protected]> * final bits Signed-off-by: Steve Macenski <[email protected]> * whoops, remove the Avatar-inspired printout Signed-off-by: Steve Macenski <[email protected]> * finish linting Signed-off-by: Steve Macenski <[email protected]> * review fix Signed-off-by: Steve Macenski <[email protected]> * remove old import Signed-off-by: Steve Macenski <[email protected]> --------- Signed-off-by: Steve Macenski <[email protected]> (cherry picked from commit 3569f0d)
✅ Branch has been successfully rebased |
733c3e4 to
271691d
Compare
|
I've taken a look. Regression-wise, there aren't many actual tests for this, but it looks fine. The autostart feature is fairly separate. I rebased and I'll trigger a fresh round of CI. |
|
Pulls: #438 |
|
@christophebedard I'd make sure to also merge in the fix from #449 as that's an important fix |
|
I was going to process them separately to keep the (backporting) history clean, but yeah. I've created #453 to backport #449 and rebased it on this commit. I triggered CI for the combination of both backports in #453 (comment). Once that looks good, we can merge them both: #438 then #453. |
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.