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
rtt_roscomm cleaning up registered topics #61
Comments
Indeed because the pointer is returned as a shared pointer, the channel including the I will investigate this during the next days. What RTT version did you use for your tests? It could be a bug during the cleanup of stream connections. |
Thanks for addressing this issue. I was running the ros package To check if the topic was unregistered, I used |
I found that rtt_rostopic_ros_msg_transporter.hpp:217 is responsible for increasing the reference count of the @smits, do you remember why this line was necessary back in 2010? |
…scriber shutdown (fix orocos#61) The transport_test in package rtt_roscomm_tests verifies that both, the publisher and the subscriber, have been deregistered in roscpp after the port disconnect.
Dear @meyerj the fix you provided apparently does not suffice. The RosSubChannelElement is not a shared pointer (https://github.com/orocos/rtt_ros_integration/blob/indigo-devel/rtt_roscomm/include/rtt_roscomm/rtt_rostopic_ros_msg_transporter.hpp#L257) |
Similar to #59 it seems that the registered subscribers (maybe also publishers) are not correctly shutdown. This leads to a topic still showing the rtt_environment as a subscriber to the topic after unloading the component that had a stream to ros.
I analyzed a little and it appears that the Channel for a publisher gets its destructor called because it is shared pointer https://github.com/orocos/rtt_ros_integration/blob/indigo-devel/rtt_roscomm/include/rtt_roscomm/rtt_rostopic_ros_msg_transporter.hpp#L247
I think one should also call shutdown on the ros_pub in the destructor after it is removed from the instance https://github.com/orocos/rtt_ros_integration/blob/indigo-devel/rtt_roscomm/include/rtt_roscomm/rtt_rostopic_ros_msg_transporter.hpp#L129
the same for the ros_sub in its destructor. I started to implement that, but the biggest problem I faced is that the destructor of the Channel for a subscriber was never called https://github.com/orocos/rtt_ros_integration/blob/indigo-devel/rtt_roscomm/include/rtt_roscomm/rtt_rostopic_ros_msg_transporter.hpp#L220
due to the msg transport creating a standard pointer and not a shared_ptr for it https://github.com/orocos/rtt_ros_integration/blob/indigo-devel/rtt_roscomm/include/rtt_roscomm/rtt_rostopic_ros_msg_transporter.hpp#L258 Not sure if the fact that the return type is a shared_ptr counts, because I added prints in the destructor and they are not printed.
I now know this is a header that has a larger implication and I struggled to understand that I had to rebuild the typekits for the ros message I wanted to test this cleanup for. However, even after making it a shared pointer it did still not enter the destructor.
What am I missing ?
The text was updated successfully, but these errors were encountered: