First of all thumbs UP for open-sourcing Webots and in particular for the ROS integration! 🥇
I get errors such as this when running my launch file which is adapted from the Pioneer one and using ros
controller for the world used in Tutorial 6: 4-Wheeled Robot
[INFO] [1630803265.662890]: Controller Spawner: Waiting for service controller_manager/switch_controller
[INFO] [1630803265.665831]: Controller Spawner: Waiting for service controller_manager/unload_controller
[INFO] [1630803265.670367]: Loading controller: robot_diff_drive_controller
Traceback (most recent call last):
File "/opt/ros/noetic/lib/python3/dist-packages/rospy/impl/tcpros_base.py", line 562, in connect
self.read_header()
File "/opt/ros/noetic/lib/python3/dist-packages/rospy/impl/tcpros_base.py", line 657, in read_header
self._validate_header(read_ros_handshake_header(sock, self.read_buff, self.protocol.buff_size))
File "/opt/ros/noetic/lib/python3/dist-packages/rosgraph/network.py", line 357, in read_ros_handshake_header
d = sock.recv(buff_size)
ConnectionResetError: [Errno 104] Connection reset by peer
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/opt/ros/noetic/lib/python3/dist-packages/rospy/impl/tcpros_service.py", line 509, in call
transport.connect(dest_addr, dest_port, service_uri)
File "/opt/ros/noetic/lib/python3/dist-packages/rospy/impl/tcpros_base.py", line 589, in connect
raise TransportInitError(str(e)) #re-raise i/o error
rospy.exceptions.TransportInitError: [Errno 104] Connection reset by peer
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/opt/ros/noetic/lib/controller_manager/spawner", line 212, in <module>
if __name__ == '__main__': main()
File "/opt/ros/noetic/lib/controller_manager/spawner", line 190, in main
resp = load_controller(name)
File "/opt/ros/noetic/lib/python3/dist-packages/rospy/impl/tcpros_service.py", line 442, in __call__
return self.call(*args, **kwds)
File "/opt/ros/noetic/lib/python3/dist-packages/rospy/impl/tcpros_service.py", line 512, in call
raise ServiceException("unable to connect to service: %s"%e)
rospy.service.ServiceException: unable to connect to service: [Errno 104] Connection reset by peer
[INFO] [1630803265.967798]: Shutting down spawner. Stopping and unloading controllers...
[INFO] [1630803265.969545]: Stopping all controllers...
[WARN] [1630803265.972946]: Controller Spawner error while taking down controllers: unable to connect to service: [Errno 111]
Connection refused
[controller_spawner-2] process has died [pid 1348, exit code 1, cmd /opt/ros/noetic/lib/controller_manager/spawner robot_diff
_drive_controller __name:=controller_spawner __log:=/home/user/.ros/log/ce532610-0de3-11ec-b206-0242ac110002/controller_spawn
er-2.log].
log file: /home/user/.ros/log/ce532610-0de3-11ec-b206-0242ac110002/controller_spawner-2*.log
$ rosservice call /controller_manager/list_controllers
ERROR: Unable to communicate with service [/controller_manager/list_controllers], address [rosrpc://webots_ros:48629]
[ INFO] [1630803265.390873175]: Robot's unique name is robot.
[ INFO] [1630803265.407668736]: The controller is now connected to the ROS master.
I have attached my launch script and associated Webots world (the sample world where I modified the controller to ros
and set the specific controller_args identical to those in the Pioneer sample)