ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question
0

ROS melodic crash in controller_manager

asked 2020-03-30 14:09:32 -0500

or.rivlin gravatar image

updated 2020-03-30 14:31:11 -0500

gvdhoorn gravatar image

Hi everyone,

I recently set up my ros-melodic work environment (on Ubuntu) for a project and received the following error during controller switching in controller_manager:

Traceback (most recent call last):
File “/opt/ros/melodic/lib/controller_manager/spawner”, line 207, in
  if name == ‘main’: main()
File “/opt/ros/melodic/lib/controller_manager/spawner”, line 199, 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 439, in call
  return self.call(*args, **kwds)
File “/opt/ros/melodic/lib/python2.7/dist-packages/rospy/impl/tcpros_service.py”, line 495, in call
  request = rospy.msg.args_kwds_to_message(self.request_class, args, kwds)
File “/opt/ros/melodic/lib/python2.7/dist-packages/rospy/msg.py”, line 124, in args_kwds_to_message
  return data_class(*args)
File “/opt/ros/melodic/lib/python2.7/dist-packages/controller_manager_msgs/srv/_SwitchController.py”, line 59, in init
  super(SwitchControllerRequest, self).init(*args, **kwds)
File “/opt/ros/melodic/lib/python2.7/dist-packages/genpy/message.py”, line 301, in init
  raise TypeError(“Invalid number of arguments, args should be %s”%str(self.slots)+" args are"+str(args))
  TypeError: Invalid number of arguments, args should be [‘start_controllers’, ‘stop_controllers’, ‘strictness’] args are([‘joint_state_controller’, ‘PandaStatePublisher’], , 2, False, 0.0)

it seems that in line 199 of ‘/opt/ros/melodic/lib/controller_manager/spawner’ switch_control is called in the following manner:

resp = switch_controller(loaded, , 2, False, 0.0)

which causes the crash due to invalid number of arguments. I checked with a colleague that uses the same code and his version of ROS contains different inputs in that line. Could it be that some recent changes in ROS cause this crash? can anyone suggest some way to work around this?

Thanks!

edit retag flag offensive close merge delete

Comments

I would suggest to verify which versions of the controller_manager package you and your colleague have.

Assuming you've installed ROS using apt: what is the output of dpkg -l | grep melodic-controller-manager?

gvdhoorn gravatar image gvdhoorn  ( 2020-03-30 14:33:32 -0500 )edit

Thanks for the reply! I will check with my colleague as you suggested. The output I get when using your suggestion is:

ii  ros-melodic-controller-manager               0.17.0-1bionic.20200320.133159                  amd64        The controller manager.
ii  ros-melodic-controller-manager-msgs          0.15.1-0bionic.20190601.004956                  amd64        Messages and services for the controller manager.
or.rivlin gravatar image or.rivlin  ( 2020-03-31 00:24:50 -0500 )edit

1 Answer

Sort by » oldest newest most voted
2

answered 2020-03-31 02:15:14 -0500

gvdhoorn gravatar image

updated 2020-03-31 02:58:12 -0500

The output I get when using your suggestion is:

ii  ros-melodic-controller-manager               0.17.0-1bionic.20200320.133159                  amd64        The controller manager.
ii  ros-melodic-controller-manager-msgs          0.15.1-0bionic.20190601.004956                  amd64        Messages and services for the controller manager.

It looks like you've performed a partial upgrade -- notice how the controller_manager is at 0.17, while the messages are 0.15.

Please make sure to not do partial upgrades on ROS packages.

Upgrade everything ROS related and then try again.

edit flag offensive delete link more

Comments

Another colleague suggested a similar thing with a rosdep command that apparently did not really work. Could you kindly suggest the appropriate commands to upgrade all the ROS related packages to be the latest version? Thank you for you help!

or.rivlin gravatar image or.rivlin  ( 2020-03-31 02:33:07 -0500 )edit

Another colleague suggested a similar thing with a rosdep command that apparently did not really work.

rosdep is not a general package manager, it only checks presence of ROS package dependencies. It won't ask apt to install anything which is already present.

Could you kindly suggest the appropriate commands to upgrade all the ROS related packages to be the latest version?

Well, as you used apt to install ROS, what about running synaptic (if you have it installed), or simply sudo apt update && sudo apt upgrade?

Please note this is not ROS specific. It may be beneficial if you look up some documentation/tutorials on how to keep an Ubuntu system up-to-date, as it would be a generic -- and useful -- skill.

gvdhoorn gravatar image gvdhoorn  ( 2020-03-31 02:42:07 -0500 )edit

Thanks a lot, that helped!

or.rivlin gravatar image or.rivlin  ( 2020-03-31 05:23:13 -0500 )edit

Question Tools

Stats

Asked: 2020-03-30 14:09:32 -0500

Seen: 536 times

Last updated: Mar 31 '20