Skip to content
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

Publishers / subscribers are never closed when connection closes #139

Open
Raphtor opened this issue Apr 12, 2022 · 0 comments
Open

Publishers / subscribers are never closed when connection closes #139

Raphtor opened this issue Apr 12, 2022 · 0 comments

Comments

@Raphtor
Copy link

Raphtor commented Apr 12, 2022

Describe the bug
If I connect to the endpoint via the Unity player, create subscribers/publishers, and then close the connection (i.e by stopping Unity), the subscribers/publishers are never destroyed and remain in the list of ros2 topic list and ros2 node list.

To Reproduce
Steps to reproduce the behavior:

  1. Launch Unity
  2. Launch docker container with endpoint
  3. Click play in Unity with scripts that register publishers/subscribers
  4. ros2 topic list and ros2 node list show correct subscribers/publishers
  5. Stop Unity editor execution
  6. ros2 topic list and ros2 node list still show subscribers/publishers, despite the log message
    [INFO] [1649729856.926835838] [UnityEndpoint]: Disconnected from 172.17.0.1

Console logs / stack traces
Docker container endpoint

root@0c49719e8970:/home/dev_ws# ros2 run ros_tcp_endpoint default_server_endpoint --ros-args -p ROS_IP:=0.0.0.0
[INFO] [1649731919.301293293] [UnityEndpoint]: Starting server on 0.0.0.0:10000
[INFO] [1649731924.108205420] [UnityEndpoint]: Connection from 172.17.0.1
[INFO] [1649731924.260963087] [UnityEndpoint]: RegisterSubscriber(/cmd_vel, <class 'geometry_msgs.msg._twist.Twist'>) OK
[INFO] [1649731924.278215629] [UnityEndpoint]: RegisterSubscriber(/tf, <class 'tf2_msgs.msg._tf_message.TFMessage'>) OK
[INFO] [1649731924.287839920] [UnityEndpoint]: RegisterPublisher(/cmd_vel, <class 'geometry_msgs.msg._twist.Twist'>) OK
[INFO] [1649731924.302599337] [UnityEndpoint]: RegisterPublisher(/pose_stamped, <class 'geometry_msgs.msg._pose_stamped.PoseStamped'>) OK
[WARN] [1649731924.304394170] [rcl.logging_rosout]: Publisher already registered for provided node name. If this is due to multiple nodes with the same name then all logs for that logger name will go out over the existing publisher. As soon as any node with that name is destructed it will unregister the publisher, preventing any further logs for that name from being published on the rosout topic.
[INFO] [1649731924.319359004] [UnityEndpoint]: RegisterPublisher(/cmd_vel, <class 'geometry_msgs.msg._twist.Twist'>) OK
[WARN] [1649731924.321670712] [rcl.logging_rosout]: Publisher already registered for provided node name. If this is due to multiple nodes with the same name then all logs for that logger name will go out over the existing publisher. As soon as any node with that name is destructed it will unregister the publisher, preventing any further logs for that name from being published on the rosout topic.
[INFO] [1649731924.341157712] [UnityEndpoint]: RegisterPublisher(/pose_stamped, <class 'geometry_msgs.msg._pose_stamped.PoseStamped'>) OK
[ERROR] [1649731932.677630258] [UnityEndpoint]: Exception: No more data available
[INFO] [1649731932.679670758] [UnityEndpoint]: Disconnected from 172.17.0.1

Environment (please complete the following information, where applicable):

  • Unity Version: [e.g. Unity 2021.2.19f1]
  • Unity machine OS + version: Mac Montery (M1)
  • ROS machine OS + version: Ubuntu 20.04 Foxy
  • ROS–Unity communication: Docker
  • Branch or version: 0.7.0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant