How to solve "Controller Spawner couldn't find the expected controller_manager ROS interface." warning?

asked 2020-02-23 14:48:32 -0500

Burhan gravatar image

Ubuntu version: 18.04.3 Ros version: Melodic

Hi. I am trying to control my robot model in rviz. I have achieved to control it by using sliders through "joint_state_publisher". However, now I want to control the joints by sending command through joint position controllers. This is my urdf file (I just show that in order to indicate my robot name):

<?xml version="1.0" ?>
<robot name="mrm_description" xmlns:xacro="http://www.ros.org/wiki/xacro">
.... (links, transmission and joints)
</robot>

When I try to launch my robot model in rviz using roslaunch it is launched successfully. However, the node named "controller_spawner" isn't initiated. When this section is reached it waits a little bit and then "Controller Spawner couldn't find the expected controller_manager ROS interface." The warning message:

INFO] [1582488295.560399]: Controller Spawner: Waiting for service controller_manager/load_controller
[WARN] [1582488325.855090]: Controller Spawner couldn't find the expected controller_manager ROS interface.
[controller_spawner-4] process has finished cleanly

My launch file: <launch>

<rosparam file="$(find mrm_description)/config/robotManipulator_control.yaml" command="load" /> 
<param name="robot_description" command="$(find xacro)/xacro '$(find mrm_description)/urdf/mrm.xacro'"/>

<node name="rviz" pkg="rviz" type="rviz" args="-d $(find mrm_description)/launch/config.rviz"/>

<node name="controller_spawner" pkg="controller_manager" type="spawner" respawn="false"
output = "screen" args="
                        /mrm_description/joint_state_controller
                        /mrm_description/base_waist_joint_position_controller
                        /mrm_description/waist_forearm_joint_position_controller
                        /mrm_description/forearm_forearmRotation_joint_position_controller
                        /mrm_description/forearmRotation_wrist_joint_position_controller
                        /mrm_description/wrist_wristRotation_joint_position_controller
                        --shutdown-timeout 3"/>

<node name="robot_state_publisher" pkg="robot_state_publisher" type="state_publisher" />

</launch>

I checked whether there is missing installation, but everything related with package is satisfied:

ros@ros-VirtualBox:~/simulation_ws$ rosdep check controller_manager
All system dependencies have been satisfied

I searched about the solution of the problem in Google and applied the suggestions. None of them worked. Additionally most of them were for Gazebo simulation which is not in my case. So, from here I really don't have any clue about what to do. Thank you for your help :)

edit retag flag offensive close merge delete

Comments

Hi @Burhan,

Have you tested your set up in a non-virtual environment?. I see several possibilities:

  1. Your VM resources are not enough and cannot load properly all controllers at once.
  2. You are not loading a proper controllers config file and the controller manager is unable to find them in the parameter server.
  3. You are launching the controllers names appending the namespace and not loading the ros control interface with that same namespace.
Weasfas gravatar image Weasfas  ( 2020-02-24 08:44:53 -0500 )edit

Thank you for your suggestions.

  1. I tested my code in construct_sim website which provides you with 8 hour free ros environment. I got the same result.
  2. I tested the working project from the "construct" YouTube channel which provides ros lessons. However, their code also stuck at the same point on my computer and gave the same warning.
  3. I didn't understand the ros control interface part. How can I check the namespace of it?

And also I would like to ask whether you can test my code in order to see if it works for you. Anyway, I put the link to my project in github. Thank you :)

Link to the project

Burhan gravatar image Burhan  ( 2020-02-24 11:52:39 -0500 )edit

Hi @Burhan

I took a look at your package and I have some questions.

Are you trying to control a Real platform or simulated one?

Why you are implementing a hardware interface for ros control if you already have a set of well known controllers that are known to work properly.

Also check the description and the your TF because it seems that is not properly loaded.

Weasfas gravatar image Weasfas  ( 2020-02-25 10:14:21 -0500 )edit

I try to make connection between rviz model and the real robot. So, they can send each other the positions.

There is no problem with description file. If I include the joint_state_publisher node before rviz node, then everything will be fine. I don't know why, but it makes like that. I have solved the problem of "Controller Spawner couldn't find the expected controller_manager ROS interface." by implementing hardware_interface, but now spawner cannot load the joint controllers. I try to solve that. The warning is "Could not load controller 'joint_state_controller' because the type was not specified. Did you load the controller configuration on the parameter server". I try to find the cause of the problem. Thank you very much :)

Burhan gravatar image Burhan  ( 2020-02-26 04:55:37 -0500 )edit

Ok. Let me explain, If you load a set of controllers the manager will expect a specific interface. If you load the controllers and you do not have an interface provided by either Gazebo or a real robot the controller manager will not be able to load since there is no hardware interface to load things. Furthermore, the fact that the description is ok with the joint_state_publisher means that you need the proper interfaces loaded in your environment either by a simulation or a real platform. If you do this you will not need the JSP since the controllers will assume the join states publish task.

Another thing that can be happening is the fact that you do not have installed in you machine the controllers you want to use. Since you are using the joint_state_publisher and effort controllers make sure you have installed those packages in your operational environment ...(more)

Weasfas gravatar image Weasfas  ( 2020-02-26 06:26:53 -0500 )edit

I understood. Thank you very much for your clarification. And in terms of git, yes. It is the first time I use github, so that is why I did like that.

Burhan gravatar image Burhan  ( 2020-02-26 07:00:55 -0500 )edit