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

ros_control fails (couldn't find the expected controller_manager)

asked 2016-02-24 10:55:02 -0500

donmrsir gravatar image

updated 2016-02-25 10:02:43 -0500

Hi!

I am trying to run a custom humanoid robot (foo) in Gazebo. I have the urdf running correctly (in Rviz and Gazebo the robot spawns without problems. However i am not able of doing the correct set up of the control in Gazebo. When the robot spawns it falls to the ground. The only warning i have is the following:

[WARN]  Controller Spawner couldn't find the expected controller_manager ROS interface.

So i suppose the problem is that the control is not loaded. I have searched for similar problems, and i have made sure that the plugin is correctly configured. The output of rosservice list | grep controller_manager is

/foo/controller_manager/list_controllers
/foo/controller_manager/load_controller
/foo/controller_manager/reload_controller_libraries
/foo/controller_manager/switch_controller
/foo/controller_manager/unload_controller

I have also checked the namespaces, but i can not see anything wrong. I have the following code for the spawn of the robot:

   <!-- Joint trajectory controllers -->
   <rosparam command="load" file="$(find foo_control)/config/joint_trajectory_controllers.yaml"/>         
   <param name="robot_description" command="$(find xacro)/xacro.py $(find foo_gazebo_description)/robots/foo_humanoid.urdf.xacro" /> 

  <node pkg="gazebo_ros" type="spawn_model" name="spawn_$(arg robot_name)" args="-param robot_description 
    -urdf
    -x $(arg robot_initial_pose/x)
    -y $(arg robot_initial_pose/y)
    -z $(arg robot_initial_pose/z)
    -R $(arg robot_initial_pose/roll)
    -P $(arg robot_initial_pose/pitch)
    -Y $(arg robot_initial_pose/yaw)
    -model $(arg robot_name)
    -robot_namespace /foo"
     respawn="false">
  </node>

The following for the control:

  <!-- Force-torque sensors controller -->
  <rosparam file="$(find foo_control)/config/effort_controller.yaml" command="load"/>

  <!-- Controllers that come up started
   <node name="bringup_controllers_spawner"
        pkg="controller_manager" type="spawner" output="screen"
        args="force_torque_sensor_controller
              joint_state_controller" /> -->
  <!-- load the controllers -->

  <node name="controller_spawner" pkg="controller_manager" type="spawner" respawn="false"
    output="screen" ns="/foo" args="
    waist_yaw_position_controller 
    waist_pitch_position_controller (etc..)"/> 

<!-- Robot state publisher -->
 <node pkg="robot_state_publisher" type="state_publisher" name="robot_state_publisher">
 <param name="publish_frequency" type="double" value="50.0" />
 <param name="tf_prefix" type="string" value="" />
 <remap from="/joint_states" to="/foo/joint_states" />

I think all the stuff is loaded in the foo namespace. If any of you have any clue about why this could be happenning, you will be welcome.

Thank you in advance!

UPDATE

Added the terminal info when lauching my simulation:

image description

Although it says ros_control is loaded there are no controllers spawned by the controller (no controller topics)

edit retag flag offensive close merge delete

Comments

It would be helpful to upload your full package to repository (e.g. github). If not possible, try launching gazebo_ros_demos. If they are not working it means that your setup is corrupted.

yasagitov gravatar image yasagitov  ( 2016-02-25 06:25:18 -0500 )edit

Thanks for all the help!, yes i can run the rrbot tutorials. I also confirmed that although it says that the gazebo_ros_control is loaded, none of the actuals controllers are loaded in the robot, since there are no controllers topics as happens with the rrbot.

donmrsir gravatar image donmrsir  ( 2016-02-25 09:59:56 -0500 )edit

I will try to find a solution, but if the problem persists maybe use a github repository for sharing the code can be an option :D. Anyway any help still welcome!

donmrsir gravatar image donmrsir  ( 2016-02-25 10:01:16 -0500 )edit

3 Answers

Sort by ยป oldest newest most voted
1

answered 2016-02-24 15:09:46 -0500

yasagitov gravatar image

updated 2016-02-24 15:12:41 -0500

Check if all neccessary packages are installed, looks like ros-distro-gazebo-ros-control (where distro is your distro name) is missing.

If this package is missing in your distro you should compile it from source as indicated in the tutorial.

edit flag offensive delete link more

Comments

Hi! thank you for the answer!, but i have already installed that package, also as as i said the ros controllers are started, but it seems that they cant be loaded to the robot. I do not why.

donmrsir gravatar image donmrsir  ( 2016-02-24 16:32:00 -0500 )edit

Have you added neccessary tags to urdf?

<gazebo>
  <plugin name="gazebo_ros_control" filename="libgazebo_ros_control.so">
    <robotNamespace>/MYROBOT</robotNamespace>
  </plugin>
</gazebo>
yasagitov gravatar image yasagitov  ( 2016-02-24 16:34:52 -0500 )edit

Hi! Yes! i already have it in my urdf, and it is detected by ROS, since, as adolfo said in this question question , without this plugin the controller services i paste in my question, should not being published.

donmrsir gravatar image donmrsir  ( 2016-02-25 03:44:06 -0500 )edit

I update the question with some info if that helps :D

donmrsir gravatar image donmrsir  ( 2016-02-25 04:52:16 -0500 )edit
0

answered 2016-02-25 10:47:35 -0500

donmrsir gravatar image

I have tried the same package in other computer (quite better than the one i am using), and the control works, at least all the controllers are loaded... So i dont know why this happened, i will try to see if i can find what is failing in my old computer, and post here the solution. Anyway thanks to @asagitov for all the help!

edit flag offensive delete link more

Comments

did you figure out what was wrong with the old setup? I'm stuck on a very similar problem. Everything is loaded, but I get that warning message and I couldn't find the controllers in rqt. rosservice list | grep controller_manager lists out similar ones with my robot namespace as above.

robot_commander gravatar image robot_commander  ( 2017-03-29 16:55:19 -0500 )edit

hi!,

The last year, I have been working in a different project since, so i have not made any progress with this, sorry. For me the solution was to use a different computer. I still dont know why. Maybe you can open a new question with your case. Btw, i didnt try the yin solution yet.

donmrsir gravatar image donmrsir  ( 2017-03-30 03:24:48 -0500 )edit

I see, okay. thanks for the reply!

robot_commander gravatar image robot_commander  ( 2017-03-30 09:43:01 -0500 )edit
0

answered 2016-10-18 08:05:39 -0500

yin gravatar image
  <!-- load the controllers -->
  <node name="controller_spawner" pkg="controller_manager" type="spawner" respawn="false"
    output="screen" ns="/arm" args="joint_state_controller"/>

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


  <!-- ros_control plugin -->
  <gazebo>
    <plugin name="gazebo_ros_control" filename="libgazebo_ros_control.so">
      <robotNamespace>/arm</robotNamespace>
      <robotSimType>gazebo_ros_control/DefaultRobotHWSim</robotSimType>
    </plugin>
  </gazebo>

the namespace must be same, /arm arm: /arm

edit flag offensive delete link more

Question Tools

2 followers

Stats

Asked: 2016-02-24 10:55:02 -0500

Seen: 4,459 times

Last updated: Oct 18 '16