-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
Do We Still Need lifecycle_publisher->on_activate()
?
#4641
Comments
I don't see any |
The sequnce of adding publishers to
The sequence for triggering
|
This is also starting to jog my memory. It looks like those are implemented in I don't see where the base class Wouldn't we need to call the base class instance of |
We need to call Therefore, pose_pub_->on_activate();
particle_cloud_pub_->on_activate(); can be replaced with: LifecycleNode::on_activate(state); The pull request #1863 added the feature of "Automatically transition lifecycle entities when node transitions." This feature was demonstrated in an example node. We can also call the default |
Thanks for explaining the code. It helped us gain a clear understanding of the ROS 2 normal publisher ( The key points are summarized below for closing the ticket.
|
@alanxuefei If you're open to a PR, you could add in the I'm pretty ambivalent on it, if you like it better, then happy to merge it! |
Sure, I will open PRs and refactor some nodes later. It’s a minor enhancement, but it’s worth trying. |
Definitely! |
@alanxuefei any chance you've had a few moments to work on this for a PR? 😄 I'm working to get Nav2's ticket count below 60 this week |
My computer is currently occupied by an experiment that converts images into a 3D voxel grid using deep learning. Later, I plan to integrate it with the voxel layer in the Navigation2 costmap. Since this ticket is low priority, we can close it for now. Once my computer is free and I have more time, I will re-open the ticket and refactor the code. |
The following code (from 5 years ago) may be outdated because the lifecycle of
lifecycle_publisher
has been managed by theLifecycleNode
for the past 2 years.We built a publisher without
on_activate()
and it works.The following steps outline the management of the
lifecycle_publisher
within theLifecycleNode
:The
LifecycleNode::create_publisher
method registers a publisher as a managed entity within theLifecycleNode
.When the
LifecycleNode
is activated, it invokes theon_activate()
method of each managed entity, including publishers.The
LifecycleNode
calls theon_activate()
method for each of its managed entities, such as publishers.The text was updated successfully, but these errors were encountered: