0
$\begingroup$

Rosanswers logo

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!


Originally posted by or.rivlin on ROS Answers with karma: 3 on 2020-03-30

Post score: 0


Original comments

Comment by gvdhoorn on 2020-03-30:
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?

Comment by or.rivlin on 2020-03-31:
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.
$\endgroup$

1 Answer 1

0
$\begingroup$

Rosanswers logo

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.


Originally posted by gvdhoorn with karma: 86574 on 2020-03-31

This answer was ACCEPTED on the original site

Post score: 2


Original comments

Comment by or.rivlin on 2020-03-31:
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!

Comment by gvdhoorn on 2020-03-31:\

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.

Comment by or.rivlin on 2020-03-31:
Thanks a lot, that helped!

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.