You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Creating publishers, subscribers, etc., inside a ROS node implementation is a common practice. I did the same with an ImageTransport object, but this resulted in a circular dependency. When you pass a node (using shared_from_this()) to ImageTransport, it holds a reference to the ROS node, and this node holds a reference to the image transport object, thereby creating a circular dependency.
A common solution to avoid circular dependencies is to use weak pointers. What's your opinion on this?
The text was updated successfully, but these errors were encountered:
Creating publishers, subscribers, etc., inside a ROS node implementation is a common practice. I did the same with an
ImageTransport
object, but this resulted in a circular dependency. When you pass a node (usingshared_from_this()
) toImageTransport
, it holds a reference to the ROS node, and this node holds a reference to the image transport object, thereby creating a circular dependency.A common solution to avoid circular dependencies is to use weak pointers. What's your opinion on this?
The text was updated successfully, but these errors were encountered: