Ask Your Question
0

Segmentation fault when launching ros_controllers.launch

asked 2020-09-20 07:38:58 -0500

carlosg gravatar image

updated 2020-09-20 12:06:13 -0500

gvdhoorn gravatar image

Hi I am having an error when launching the ros_controllers.launch file that causes gazebo to crash in ROS Melodic, Ubuntu 18.04. The behaviour is the following:

  • gazebo.launch of the moveit_config pkg is launched (urdf is spawned correctly)
  • The ros_controllers.launch file is launched afterwards in a new terminal (this file is not inside gazebo.launch anymore)
  • Then the controller spawner node dies showing this warning :

    [WARN] [1600602932.213752, 16.517000]: Controller Spawner error while taking down controllers: unable to connect to service: [Errno 111] Connection refused
    
  • After this gazebo crashes

Specifically it is showing this traceback:

Traceback (most recent call last):
  File "/opt/ros/melodic/lib/controller_manager/spawner", line 212, in <module>
    if __name__ == '__main__': main()
  File "/opt/ros/melodic/lib/controller_manager/spawner", line 204, in main
    resp = switch_controller(loaded, [], 2, False, 0.0)
  File "/opt/ros/melodic/lib/python2.7/dist-packages/rospy/impl/tcpros_service.py", line 442, in __call__
    return self.call(*args, **kwds)
  File "/opt/ros/melodic/lib/python2.7/dist-packages/rospy/impl/tcpros_service.py", line 532, in call
    raise ServiceException("transport error completing service call: %s"%(str(e)))
rospy.service.ServiceException: transport error completing service call: unable to receive data from sender, check sender's logs for details
[INFO] [1600602932.203508, 16.517000]: Shutting down spawner. Stopping and unloading controllers...

The log file shows this:

[rosout][INFO] 2020-09-20 12:22:39,391: Controller Spawner: Loaded controllers: joint_state_controller, printer_arm1_controller, printer_arm2_controller, printer_arm3_controller, printer_arm4_controller, printer_hand1_controller, printer_hand2_controller, printer_hand3_controller, printer_hand4_controller
[rospy.core][INFO] 2020-09-20 12:22:39,682: signal_shutdown [atexit]
[rosout][INFO] 2020-09-20 12:22:39,683: Shutting down spawner. Stopping and unloading controllers...
[rospy.internal][WARNING] 2020-09-20 12:22:39,686: Unknown error initiating TCP/IP socket to carlos-Lenovo-ideapad-320-15ISK:47803 (http://carlos-Lenovo-ideapad-320-15ISK:40505/): Traceback (most recent call last):
  File "/opt/ros/melodic/lib/python2.7/dist-packages/rospy/impl/tcpros_base.py", line 562, in connect
    self.read_header()
  File "/opt/ros/melodic/lib/python2.7/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/melodic/lib/python2.7/dist-packages/rosgraph/network.py", line 357, in read_ros_handshake_header
    d = sock.recv(buff_size)
error: [Errno 104] Connection reset by peer
[rospy.internal][INFO] 2020-09-20 12:22:39,687: topic[/clock] removing connection to http://carlos-Lenovo-ideapad-320-15ISK:40505/
[rosout][INFO] 2020-09-20 12:22:39,684: Stopping all controllers...
[rospy.internal][WARNING] 2020-09-20 12:22:39,692: Unknown error initiating TCP/IP socket to carlos-Lenovo-ideapad-320-15ISK:47803 (rosrpc://carlos-Lenovo-ideapad-320-15ISK:47803): Traceback (most recent call last):
  File "/opt/ros/melodic/lib/python2.7/dist-packages/rospy/impl/tcpros_base.py", line 560, in connect
    self.socket.connect((dest_addr, dest_port))
  File "/usr/lib/python2.7/socket.py", line 228, in meth
    return getattr(self._sock,name)(*args)
error: [Errno 111] Connection refused
[rosout][WARNING] 2020-09-20 12:22:39,692: Controller Spawner error while taking down controllers: unable to connect to service: [Errno 111] Connection refused

Loading the joint_state_controller by launching the controller spawner works, just my custom controllers do not. It already worked before so I am not sure ... (more)

edit retag flag offensive close merge delete

Comments

Loading the joint_state_controller by launching the controller spawner works, just my custom controllers do not. It already worked before so I am not sure what it is causing now, namespaces are still the same as before and therefore should be correct. Also I have tried apt update / apt upgrade without success.

have you rebuilt your workspace after updating packages?

If you haven't, this may be a simple case of ABI incompatibility.

gvdhoorn gravatar image gvdhoorn  ( 2020-09-20 12:06:48 -0500 )edit

Yes I have used catkin build on my workspace. It took me just a few seconds as I just have a couple of packages. Hoped that would fix it too.

carlosg gravatar image carlosg  ( 2020-09-20 12:46:50 -0500 )edit

But have you cleaned your workspace first? The linker may not pick up on the fact that there are updates installed to libraries it has already linked.

If you're using catkin_tools, a catkin clean -y && catkin build should be an easy test.

gvdhoorn gravatar image gvdhoorn  ( 2020-09-21 02:49:39 -0500 )edit

I wasn't aware of that, just tried it out and it looked better in the beginning. However I was unable to connect to the move_group action, after this error the segmentation fault appeared again. Launching a second time resulted in the same behaviour as before cleaning and building.

carlosg gravatar image carlosg  ( 2020-09-21 05:15:16 -0500 )edit

Not sure why but after setting pid values for the controllers, the segmentation error disappeared. However now rviz loads the robot in collision state despite of having set the start state to a previously defined one.

carlosg gravatar image carlosg  ( 2020-09-25 11:20:36 -0500 )edit

1 Answer

Sort by ยป oldest newest most voted
0

answered 2021-06-01 07:08:45 -0500

heshui gravatar image

These days i have this problem, too. I used the controller successfully last month but it broke down sometime. I think it maybe a problem with networt connection. And I can't use rosdep update successfully many times. It worked sometime still. Could you have some ideas about that?

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower

Stats

Asked: 2020-09-20 07:38:58 -0500

Seen: 299 times

Last updated: Sep 20 '20