-
Notifications
You must be signed in to change notification settings - Fork 198
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
ROS2 - tf2_ros::TransformBroadcaster and rclcpp_lifecycle::LifecycleNode #70
Comments
@dirk-thomas no news about this bug? I think it is quiet important |
Nobody is working on this atm. Please consider contributing a pull request. |
@dirk-thomas I'm looking at it. I think that I can take two ways:
Any suggestion? |
I opted to try the solution 2. It seems to work. |
I believe only the node base interface won't suffice in this case. I guess you'd need also the topics interface of a node: https://github.com/ros2/rclcpp/blob/master/rclcpp/include/rclcpp/node_interfaces/node_topics_interface.hpp Creating a constructor for a lifecycle node might work for the problem above, but to me, it feels like not sustainable in case there's another node implementation (something else than lifecycle) coming in the future. All nodes however have a base-interface and most likely also a topics-interface. |
It's a solution that I do not really like for the same motivation you are saying, but I do not really understand how to overcome it. If you can guide me to a better solution I will try to implement it |
I can understand, that this is maybe not super trivial to figure out on your own. So sorry for that :) The design decision for a ROS 2 node was to use composition instead of inheritance. That being said, a regular node and a lifecycle node don't share a common base class but rather have the same internal components. |
@Myzhar do you have any plans to continue work on this? If not, I might try to implement the functionality according to @Karsten1987's suggestion. |
@rasmusan I'm sorry but i have not the time to work on this now. |
I think that introducing the NodeBaseInterface and NodeTopicsInterface is not sufficient. The publisher created by a LifecycleNode will still need to be activated/deactivated. Since TransformBroadcaster holds the created publisher, it should expose activated() and deactivated() methods so that it could reflect these calls to the publisher->on_activate() and on_deactivate. However, an rclcpp_lifecycle::Publisher supports these methods while an rclcpp::Publisher does not. So, my question is how shouldhelper classes like TransformBroadcaster, that create publishers support both lifecycle and non-lifecycle nodes? This seems like a general design issue for any helper class that creates publishers. Related to this proposal |
Feature request
Feature description
Add constructor for LifecycleNode to
tf2_ros::TransformBroadcaster
.Implementation considerations
Refer to ROS answer thread:
https://answers.ros.org/question/302459/ros2-tf2_rostransformbroadcaster-and-rclcpp_lifecyclelifecyclenode/
The text was updated successfully, but these errors were encountered: