Ask Your Question
3

Controller manager won't load the controllers (effort_controllers and joint_state_controller)

asked 2017-06-22 01:35:09 -0600

Alba Garcia gravatar image

updated 2017-06-22 20:26:00 -0600

Hi, I'm trying to run a simulation in gazebo of the Crane+robot,

After having a lot of trouble initializing the controller manager (sneaky namespace issue) I finally get it running. I check it with rosservice list | grep controller_manager and everything looks fine:

/controller_manager/list_controller_types
/controller_manager/list_controllers
/controller_manager/load_controller
/controller_manager/reload_controller_libraries
/controller_manager/switch_controller
/controller_manager/unload_controller

However, when I go check if my controllers are running with rosrun controller_manager controller_manager list I get:

No controllers are loaded in mechanism control

The end of my output looks like this:

   [ INFO] [1498111743.053574972, 0.212000000]: Loaded gazebo_ros_control.
    [WARN] [1498111835.614948, 92.563000]: Controller Spawner couldn't find the expected controller_manager ROS interface.
    [crane/controller_spawner-4] process has finished cleanly
    log file: /home/albagr/.ros/log/425536cc-5711-11e7-8542-7446a0a300e6/crane-controller_spawner-4*.log
    [ERROR] [1498111846.979653545, 103.904000000]: Could not load controller 'joint2_effort_controller' because the type was not specified. Did you load the controller configuration on the parameter server (namespace: '/joint2_effort_controller')?

What I understand from this is that although the controller manager has been initialized, it can't load the controllers for some reason. When I try to load controllers individually with rosrun controller_manager controller_manager load [controller] the last error from the output appears. I've checked and all ros-kinetic-ros-control ros-kinetic-ros-controllers ros-kinetic-joint-state-controller ros-kinetic-effort-controllers and ros-kinetic-position-controllers packages are installed and the joint type is correct. I've also added the hardwareInterface tags in the urdf file as in here,

<transmission name="joint5_trans">
        <type>transmission_interface/SimpleTransmission</type>
        <joint name="joint5">
            <hardwareInterface>hardware_interface/EffortJointInterface</hardwareInterface>
        </joint>
        <actuator name="joint5_motor">
            <mechanicalReduction>2</mechanicalReduction>
            <hardwareInterface>hardware_interface/EffortJointInterface</hardwareInterface>
        </actuator>
 </transmission>

I don't know where else to look. If you could help me out I'll really appreciate it. Thank you!

Edit:

My .yaml file

crane:

#Publish all joint states------------
 joint_state_controller:
  type: joint_state_controller/JointStateController
  publish_rate: 50

#Effort controllers------------------
 joint1_effort_controller:
  type: effort_controllers/JointEffortController
  joint: joint1
  pid: {p: 0.75, i: 0.5, d: 0.01}
 joint2_effort_controller:
  type: effort_controllers/JointEffortController
  joint: joint2
  pid: {p: 0.75, i: 0.5, d: 0.01}
 joint3_effort_controller:
  type: effort_controllers/JointEffortController
  joint: joint3
  pid: {p: 0.75, i: 0.5, d: 0.01}
 joint4_effort_controller:
  type: effort_controllers/JointEffortController
  joint: joint4
  pid: {p: 0.75, i: 0.5, d: 0.01}
 joint5_effort_controller:
  type: effort_controllers/JointEffortController
  joint: joint5
  pid: {p: 0.75, i: 0.5, d: 0.01}

and my launch file

<launch>
  <!-- Load joint controller configurations from YAML file to parameter server -->
  <rosparam file="$(find crane_control)/config/crane_control.yaml" command="load" ns="/crane"/>

  <!-- load the controllers -->
  <node name="controller_spawner"
    pkg="controller_manager"
    type="spawner" respawn="false"
    output="screen" ns="/crane"
    args="--namespace=/crane joint_state_controller joint1_effort_controller joint2_effort_controller joint3_effort_controller joint4_effort_controller joint5_effort_controller --timeout 100"/>

 <!-- convert joint states to TF transforms for rviz, etc --> 
  <node name="robot_state_publisher" pkg="robot_state_publisher" type="robot_state_publisher" respawn="false" output="screen"> 
    <param name="/crane/robot_description" command="$(find xacro)/xacro.py '$(find crane_urdf)/src/crane+.xacro'" />
    <remap from="/joint_states" to="/crane/joint_states" /> 
  </node>
</launch>

EDIT:

If I remove the namespace from here (launch file)

   <launch>
      <!-- Load joint controller configurations from YAML file to parameter server -->
      <rosparam file="$(find crane_control)/config/crane_control.yaml" command="load ...
(more)
edit retag flag offensive close merge delete

Comments

Can you give the lines in the crane+.xacro where you include the ros_control plugin?

SorinV gravatar image SorinV  ( 2017-06-22 06:25:48 -0600 )edit

You may have the same problem I had yesterday. All due to namespaces in the end. See here.

SorinV gravatar image SorinV  ( 2017-06-22 06:33:52 -0600 )edit

Sure thing

<gazebo>
    <plugin name="gazebo_ros_control" filename="libgazebo_ros_control.so">
    </plugin>
</gazebo>

It's funny because I saw your question this morning and that's what helped me solve the namespace issue. Still, the controllers don't initialize...But thanks for that!

Alba Garcia gravatar image Alba Garcia  ( 2017-06-22 07:26:43 -0600 )edit

Glad that helped you. So i figure there must be a problem in the launch files. For example you can try to spawn the controller only with one namespace param: either ns="/crane" either args="--namespace=/crane, but just one to see if it works.

SorinV gravatar image SorinV  ( 2017-06-22 09:22:51 -0600 )edit

It didn't change anything. I have the impression that the .yaml file is not loading. If I try to start the controller manually, it will ask for the type. If I enter the type manually, it'll then ask for the joint. The yaml file is supposed to be loaded on .launch Can anyone tell me what I'm missing?

Alba Garcia gravatar image Alba Garcia  ( 2017-06-22 19:36:40 -0600 )edit

For sure there is a problem with the .yaml, but I cannot see what can be. The difference I have is that I group the robot like so <group ns="/robot1"> </group> and I load inside the config and spawn everything. That seems to work for me.

SorinV gravatar image SorinV  ( 2017-06-23 02:10:53 -0600 )edit

have you found a solution for your problem?? I'm having the same issue...

Miriam gravatar image Miriam  ( 2018-05-21 13:36:17 -0600 )edit

I'm suffering exactly the same thing. I'm running my code in THE CONSTRUCT IDE so it isn't a case of not having the .so files library installed. Everything's right in that regard. I'm o-level frustrated at the moment.

afroRoboticist gravatar image afroRoboticist  ( 2019-02-26 09:50:19 -0600 )edit

4 Answers

Sort by ยป oldest newest most voted
0

answered 2020-01-20 16:04:36 -0600

1hada gravatar image

I see you already have what I was going to suggest but...... in my somename_control.launch file I had to put all the controllers and joint states ( that I had in my .yaml ) in order for it to work. Hopefully that helps someone !

<!-- load the controllers -->  <node name="controller_spawner" pkg="controller_manager" type="spawner" respawn="false"  output="screen" ns="/yournamespace" args="joint_state_controller
                  jointname1_position_controller
                  jointname2_position_controller
                  jointname3_position_controller
                  jointname4_position_controller
                  jointname5_position_controller"/>
edit flag offensive delete link more
0

answered 2017-06-23 07:20:22 -0600

Yogi_4 gravatar image

I faced the same issue yesterday and solved it by installing control pkgs,

sudo apt-get install ros-indigo-ros-control ros-indigo-ros-controllers
edit flag offensive delete link more

Comments

Thanks for your answer. Yes, I thought that might be the issue, but I checked several times and everything looks fine on that end.

Alba Garcia gravatar image Alba Garcia  ( 2017-06-25 23:04:31 -0600 )edit

type: "effort_controllers/JointTrajectoryController" try this as type in your yaml file

Yogi_4 gravatar image Yogi_4  ( 2017-06-26 02:38:12 -0600 )edit
0

answered 2020-04-25 11:43:30 -0600

Nichole Groener gravatar image

It may help to specify the namespace when you include the plugin:

<robotNamespace>/crane</robotNamespace>
edit flag offensive delete link more
0

answered 2020-03-01 21:09:10 -0600

Possibly if you change the directory "carne_control" to just "carne" the problem solve.

<rosparam file="$(find crane_control)/config/crane_control.yaml" command="load" ns="/crane"/>

change to

<rosparam file="$(find crane)/config/crane_control.yaml" command="load" ns="/crane"/>

Sorry for my english.

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

4 followers

Stats

Asked: 2017-06-22 01:35:09 -0600

Seen: 7,477 times

Last updated: Mar 01 '20