Without this patch, the ROS-TCP-Connector and the ROS-TCP-Endpoint shows the following error.
Unity
Connection to 127.0.0.1:10000 failed - System.IO.IOException: Unable to write data to the transport connection: The socket has been shut down. ---> System.Net.Sockets.SocketException: The socket has been shut down
at System.Net.Sockets.Socket.Send (System.Byte[] buffer, System.Int32 offset, System.Int32 size, System.Net.Sockets.SocketFlags socketFlags) [0x00016] in <0463b2ef957545c0a51b42f372cd4fbb>:0
at System.Net.Sockets.NetworkStream.Write (System.Byte[] buffer, System.Int32 offset, System.Int32 size) [0x0009b] in <0463b2ef957545c0a51b42f372cd4fbb>:0
--- End of inner exception stack trace ---
at System.Net.Sockets.NetworkStream.Write (System.Byte[] buffer, System.Int32 offset, System.Int32 size) [0x000e2] in <0463b2ef957545c0a51b42f372cd4fbb>:0
at Unity.Robotics.ROSTCPConnector.SysCommandSender.SendInternal (Unity.Robotics.ROSTCPConnector.MessageGeneration.MessageSerializer m_MessageSerializer, System.IO.Stream stream) [0x00016] in /path/to/the/project/Library/PackageCache/com.unity.robotics.ros-tcp-connector@c27f00c6cf/Runtime/TcpConnector/OutgoingMessageSender.cs:39
at Unity.Robotics.ROSTCPConnector.ROSConnection+<ConnectionThread>d__115.MoveNext () [0x001e9] in /path/to/the/project/Library/PackageCache/com.unity.robotics.ros-tcp-connector@c27f00c6cf/Runtime/TcpConnector/ROSConnection.cs:824
UnityEngine.Debug:Log (object)
Unity.Robotics.ROSTCPConnector.ROSConnection/<ConnectionThread>d__115:MoveNext () (at Library/PackageCache/com.unity.robotics.ros-tcp-connector@c27f00c6cf/Runtime/TcpConnector/ROSConnection.cs:854)
System.Threading._ThreadPoolWaitCallback:PerformWaitCallback ()
ROS
[INFO] [1653965598.855207]: Disconnected from 127.0.0.1
Exception in thread Thread-26:
Traceback (most recent call last):
File "/usr/lib/python2.7/threading.py", line 801, in __bootstrap_inner
self.run()
File "/path/to/the/catkin_ws/src/ros_tcp_endpoint/src/ros_tcp_endpoint/client.py", line 222, in run
self.tcp_server.handle_syscommand(destination, data)
File "/path/to/the/catkin_ws/src/ros_tcp_endpoint/src/ros_tcp_endpoint/server.py", line 112, in handle_syscommand
function = getattr(self.syscommands, topic[2:])
AttributeError: SysCommands instance has no attribute 'remove_subscriber'
After applying this patch, the Unity shows no error and the following message shows in the ROS console.
[INFO] [1653966364.216153]: UnregisterSubscriber(cmd_vel) OK
Checklist
[x] Ensured this PR is up-to-date with the dev branch
Proposed change(s)
Add missing "remove_subscriber" function which is called by
UnsubscribeAll()
implemented here:https://github.com/Unity-Technologies/ROS-TCP-Connector/pull/196/files#diff-fbf6c2f2a1a7feb6b363ab04f47f6ea0f3ceefa1c75138f030c78deb84aab60fR161-R167
https://github.com/Unity-Technologies/ROS-TCP-Connector/pull/196/files#diff-05890041157eb5ce2693b5736e8d08f41110bea75e83609a2b4f97eeb26ce7a4R369-R388
Useful links (GitHub issues, JIRA tickets, forum threads, etc.)
Provide any relevant links here.
Types of change(s)
Testing and Verification
Test Configuration:
Procedure:
I think you can use
rostopic pub
instead ofteleop_twist_keyboard
.UnsubscribeAll();
in Unity (with ROS-TCP-Connector v0.7.0) like this:ref: https://github.com/unity3d-jp/Unity-ROS-MobileRobot-UI-Tutorial/blob/main/MobileRobotUITutorialProject/Assets/Scripts/CmdVelSubscriber.cs
Without this patch, the ROS-TCP-Connector and the ROS-TCP-Endpoint shows the following error.
Unity
ROS
After applying this patch, the Unity shows no error and the following message shows in the ROS console.
Checklist
dev
branchdev
branchOther comments