odrive_ros2_control: Could not contact service /controller_manager/list_controllers

I’m getting some weird errors while launching, errors mention “Could not contact service /controller_manager/list_controllers”.

➜  ros2_ws ros2 launch odrive_bringup odrive.launch.py              
[INFO] [launch]: All log files can be found below /home/richard/.ros/log/2021-09-15-15-08-53-286219-richard-GL65-9SEK-10069
[INFO] [launch]: Default logging verbosity is set to INFO
[INFO] [ros2_control_node-1]: process started with pid [10073]
[INFO] [robot_state_publisher-2]: process started with pid [10075]
[INFO] [spawner.py-3]: process started with pid [10077]
[INFO] [spawner.py-4]: process started with pid [10079]
[robot_state_publisher-2] Parsing robot urdf xml string.
[robot_state_publisher-2] Link link0 had 0 children
[robot_state_publisher-2] [INFO] [1631711333.470852643] [robot_state_publisher]: got segment link0
[robot_state_publisher-2] [INFO] [1631711333.470911564] [robot_state_publisher]: got segment world
[spawner.py-3] Traceback (most recent call last):
[spawner.py-3]   File "/opt/ros/foxy/lib/controller_manager/spawner.py", line 186, in <module>
[spawner.py-3]     sys.exit(main())
[spawner.py-3]   File "/opt/ros/foxy/lib/controller_manager/spawner.py", line 109, in main
[spawner.py-3]     if is_controller_loaded(node, controller_manager_name, controller_name):
[spawner.py-3]   File "/opt/ros/foxy/lib/controller_manager/spawner.py", line 51, in is_controller_loaded
[spawner.py-3]     controllers = list_controllers(node, controller_manager).controller
[spawner.py-3]   File "/opt/ros/foxy/lib/python3.8/site-packages/controller_manager/controller_manager_services.py", line 49, in list_controllers
[spawner.py-3]     return service_caller(node, f'{controller_manager_name}/list_controllers',
[spawner.py-3]   File "/opt/ros/foxy/lib/python3.8/site-packages/controller_manager/controller_manager_services.py", line 29, in service_caller
[spawner.py-3]     raise RuntimeError(f'Could not contact service {service_name}')
[spawner.py-3] RuntimeError: Could not contact service /controller_manager/list_controllers
[spawner.py-4] Traceback (most recent call last):
[spawner.py-4]   File "/opt/ros/foxy/lib/controller_manager/spawner.py", line 186, in <module>
[spawner.py-4]     sys.exit(main())
[spawner.py-4]   File "/opt/ros/foxy/lib/controller_manager/spawner.py", line 109, in main
[spawner.py-4]     if is_controller_loaded(node, controller_manager_name, controller_name):
[spawner.py-4]   File "/opt/ros/foxy/lib/controller_manager/spawner.py", line 51, in is_controller_loaded
[spawner.py-4]     controllers = list_controllers(node, controller_manager).controller
[spawner.py-4]   File "/opt/ros/foxy/lib/python3.8/site-packages/controller_manager/controller_manager_services.py", line 49, in list_controllers
[spawner.py-4]     return service_caller(node, f'{controller_manager_name}/list_controllers',
[spawner.py-4]   File "/opt/ros/foxy/lib/python3.8/site-packages/controller_manager/controller_manager_services.py", line 29, in service_caller
[spawner.py-4]     raise RuntimeError(f'Could not contact service {service_name}')
[spawner.py-4] RuntimeError: Could not contact service /controller_manager/list_controllers
[ERROR] [spawner.py-4]: process has died [pid 10079, exit code 1, cmd '/opt/ros/foxy/lib/controller_manager/spawner.py joint0_velocity_controller -c /controller_manager --ros-args'].
[ERROR] [spawner.py-3]: process has died [pid 10077, exit code 1, cmd '/opt/ros/foxy/lib/controller_manager/spawner.py joint_state_broadcaster --controller-manager /controller_manager --ros-args'].

Looking at discussions about this error I found a discussion talking about the stability of the spawn.py of the controller_manager ros-controls/ros2_control#475

They mention it could be because it’s running on a slower PC but I’m running the same code on raspberry pi and my laptop PC with powerful specs that shouldn’t be a problem and yet both platforms yield the same result.

I’ve also tried the fix that they proposed by incrementing the wait time but it just won’t work. Any idea?

About this issue

  • Original URL
  • State: closed
  • Created 3 years ago
  • Comments: 17 (4 by maintainers)

Most upvoted comments

I have added support for firmware 0.5.3

The ros2_control_demos works fine me. I found that the problem originates from the the hardware_interface, the ODrive fails to initialize and hangs on the this linehttps://github.com/Factor-Robotics/odrive_ros2_control/blob/6cd7acf84d4ba3680e79bd386781661ff8fdcc5d/odrive_hardware_interface/src/odrive_usb.cpp#L84

This ether blocks processing for the controller_manager or doesn’t allow it to start up correctly.

This is my setup:

Ubuntu 20.04.3 LTS ros2 foxy libusb-1.0-0-dev odrivetool version 0.5.3 ODrive firmware 0.5.3 hardware 3.6 56V variant

The usb library was already installed, using the original cable and I’m able to run odrivetool normally without sudo. I get the same results running on a freshly installed ubuntu server image on raspebrry py 4 8gb variant.

Thank you for the fantastic package. Just out of curiosity, what was the reason that made the package incompatible with 0.5.4? If I understand the previous discussion correctly, the issue was the protocol header file. Is it because some endpoints are changed?

Yes, there are only minor differences as far as I remember, but that would also break compatibility. I want to skip 0.5.4, and will add support for 0.5.5 and CAN communication later, after I finish the project at hand.

What version of libusb are you using? For me this libusb-1.0-0-dev worked on Ubuntu 20.04.

sudo apt-get install libusb-1.0-0-dev