-
Notifications
You must be signed in to change notification settings - Fork 422
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
Node::remove_<subscription, publisher, service, client> #205
Comments
The opposite of create is not remove... so at least I think the names of the functions should be destroy if you're going to have them. Since they are scoped and the callback group objects which keep track of them store them as weak pointers: https://github.com/ros2/rclcpp/blob/master/rclcpp/include/rclcpp/callback_group.hpp#L100 So when they are destroyed, they are effectively removed from any tracking. |
Reading more of the source (and remembering more) I think the idea is that there should not be remove or destroy functions, but I think we are missing some clean up which should happen in the destructors of these things, for example they might ought to wake up any blocking wait calls so the wait set can be remade without the recently destroyed objects. Like here: https://github.com/ros2/rclcpp/blob/master/rclcpp/src/rclcpp/subscription.cpp#L41-L60 |
Hmm, yeah, when I originally created this ticket I might have also been thinking of functions to remove a subscription/client/service from a node and manage the state in the node that tracks those entities (like this https://github.com/ros2/rclcpp/blob/master/rclcpp/include/rclcpp/node.hpp#L273-L276), without destroying the node itself. |
Searching, those might be dead code now:
It is declared, initialized, and incremented, but otherwise never referenced or decremented anywhere in |
oh, interesting. and they are private. We should definitely clean that up. |
@wjwwood is that still an ongoing discussion? It looks to me as if using shared_ptr/weak_ptr doesn't require any destroy functions. |
Have the functions mentioned been removed? If not then I’d say the task in this issue is not done yet. I don’t think any more discussion needs to be done. |
* Document rcl_take_response() populates the header
* Introduce new SequentialReader interface Signed-off-by: Anas Abou Allaban <[email protected]> Introduce new SequentialReader interface Signed-off-by: Anas Abou Allaban <[email protected]> Introduce new SequentialReader interface Signed-off-by: Anas Abou Allaban <[email protected]> Introduce new SequentialReader interface Signed-off-by: Anas Abou Allaban <[email protected]> * Address commments: - Rewrite history - Move sequential reader implementation to header/source - Change namespaces - Linting Signed-off-by: Anas Abou Allaban <[email protected]> * Add visiblity control header Signed-off-by: Anas Abou Allaban <[email protected]> * Address structural review feedback Signed-off-by: Prajakta Gokhale <[email protected]> * Remove extraneous newline Signed-off-by: Prajakta Gokhale <[email protected]> * Add new BaseReaderInterface * Add new reader interface * Use the interface in sequential reader Signed-off-by: Prajakta Gokhale <[email protected]> * Remove extra newline Signed-off-by: Prajakta Gokhale <[email protected]> * Final reader class implementation (ros2#4) * final reader class Signed-off-by: Karsten Knese <[email protected]> * adaptations for rosbag2_transport Signed-off-by: Karsten Knese <[email protected]> * address review comments Signed-off-by: Karsten Knese <[email protected]> * Make BaseReaderInterface public Signed-off-by: Prajakta Gokhale <[email protected]> * Rebase on writer changes Signed-off-by: Karsten Knese <[email protected]> * Introduce new SequentialReader interface Signed-off-by: Anas Abou Allaban <[email protected]> Introduce new SequentialReader interface Signed-off-by: Anas Abou Allaban <[email protected]> Introduce new SequentialReader interface Signed-off-by: Anas Abou Allaban <[email protected]> Introduce new SequentialReader interface Signed-off-by: Anas Abou Allaban <[email protected]> * Address commments: - Rewrite history - Move sequential reader implementation to header/source - Change namespaces - Linting Signed-off-by: Anas Abou Allaban <[email protected]> * Final reader class implementation (ros2#4) * final reader class Signed-off-by: Karsten Knese <[email protected]> * adaptations for rosbag2_transport Signed-off-by: Karsten Knese <[email protected]> * address review comments Signed-off-by: Karsten Knese <[email protected]> * rebase Signed-off-by: Karsten Knese <[email protected]> * structurial changes for rosbag2 Signed-off-by: Karsten Knese <[email protected]> * rosbag2_transport adaptations Signed-off-by: Karsten Knese <[email protected]> * fixes for rebasing Signed-off-by: Karsten Knese <[email protected]> * pragma for windows Signed-off-by: Karsten Knese <[email protected]> * remove unused file Signed-off-by: Karsten Knese <[email protected]>
It looks to me like everything has been done here (with destructors), and |
Node
has several functions for creating entities (subscription, publisher, service, client, timer) but not for removing them. This seems like an oversight. I think we should addremove
functions, and entities should also remove themselves fromNode
in their destructor.The text was updated successfully, but these errors were encountered: