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

Running controller_manager spawner with /mybot/robot_description?

asked 2014-12-04 17:43:53 -0600

lucasw gravatar image

updated 2020-11-21 11:21:57 -0600

Should I be able to have controller_manager spawner running inside the /mybot namespace and have it find /mybot/robot_description? Right now with Ubuntu 14.04 and Indigo I am only getting

  Could not find parameter robot_description on parameter server
  Failed to parse urdf file
  Initializing ... failed
  ...

If I load the robot_description to /robot_description even while keeping the spawner in the /mybot namespace it will work again, suggesting that something downstream from the spawner is only looking at a hardcoded /robot_description rather than respecting namespaces.


Update:

I've done a little digging and it seems perhaps the problem lies in a service call to load_controller loses namespace information, the service provider (which is in /gazebo) just looks up "robot_description". It seems like if I where to launch gazebo within the /mybot namespace it would find the description (and break other things maybe), but then if that were the only way to do that then that means multiple robots with different robot_descriptions wouldn't be possible?

In my urdf I have a gazebo_ros_control plugin loading with the <robotparam> set to /mybot/robot_description - should that make the loading of the controller work (though it isn't for me currently)? I do see messages like Starting gazebo_ros_control plugin in namespace: /mybot and gazebo_ros_control pulgin is waiting for model URDF in parameter [/mybot/robot_description] on the ROS param server.


Update

I've replicated making everything run inside this with my forked copy of gazebo_ros_demos https://github.com/lucasw/gazebo_ros_... , I can successfully launch gazebo with

roslaunch rrbot_gazebo rrbot_world.launch

And that works in the current state, though I had to put /mybot in more places than I'd like (rather than being able to put it an one level in the launch file and no lower level configuration files having to know about it and just operating on relative namespaces. (gazebo gets launched via empty_world.launch and that doesn't work within a namespace (more descriptive comments in the launch file)

But I can't get the controller nodes to launch properly from here:

roslaunch rrbot_control rrbot_control.launch

If I don't put the spawner inside mybot (and everything else is) I get:

[INFO] /opt/ros/indigo/lib/controller_manager/spawner:121 : Controller Spawner: Waiting for service controller_manager/load_controller [WARN] /opt/ros/indigo/lib/controller_manager/spawner:138 : Controller Spawner couldn't find the expected controller_manager ROS interface.

or if I do try to load the spawner within mybot:

/opt/ros/indigo/lib/robot_state_publisher/robot_state_publisher
[INFO] /opt/ros/indigo/lib/controller_manager/spawner:121 : Controller Spawner: Waiting for service controller_manager/load_controller
[INFO] /opt/ros/indigo/lib/controller_manager/spawner:126 : Controller Spawner: Waiting for service controller_manager/switch_controller
[INFO] /opt/ros/indigo/lib/controller_manager/spawner:134 : Controller Spawner: Waiting for service controller_manager/unload_controller
[INFO] /opt/ros/indigo/lib/controller_manager/spawner:189 : Loading controller: joint_state_controller
[ERROR] /opt/ros/indigo/lib/controller_manager/spawner:195 : Failed to load joint_state_controller
[INFO] /opt/ros/indigo/lib/controller_manager/spawner:189 : Loading controller: joint1_position_controller
[ERROR] /opt/ros/indigo/lib/controller_manager/spawner:195 : Failed to load joint1_position_controller
[INFO ...
(more)
edit retag flag offensive close merge delete

Comments

Lucas, did you ever find a solution to this? Thanks.

crzx5 gravatar image crzx5  ( 2015-03-09 16:20:05 -0600 )edit

I alse meet this problem, can you give me some help about it . thanks very much.

congleetea gravatar image congleetea  ( 2015-05-02 04:11:47 -0600 )edit

To understand the situation: In which namespace is the gazebo_ros_control plugin being spawned? /mybot?. If you load the robot description under /mybot/robot_description the plugin fails to load, but if you do it under /robot_description it works?.

Adolfo Rodriguez T gravatar image Adolfo Rodriguez T  ( 2015-05-25 03:24:51 -0600 )edit

I didn't ever solve this directly, I just restructured to avoid it. I'm going to have to recreate this int the form of a simple example to demonstrate it.

lucasw gravatar image lucasw  ( 2015-06-15 07:57:32 -0600 )edit

I've updated the question to link to github where I've recreated the problem.

lucasw gravatar image lucasw  ( 2015-06-15 15:21:39 -0600 )edit

Hy, have you solved this point because I'm having exactly the same problem on Jade. I did this tutorial http://gazebosim.org/tutorials?tut=ro... but the warning is hold "Controller spawner couldn't find the expected controller_manager ROS interface". Thanks a lot

bahom gravatar image bahom  ( 2016-01-09 08:25:48 -0600 )edit

Having the same problem on Jade. Any ideas?

filipposanfilippo gravatar image filipposanfilippo  ( 2016-04-20 10:34:18 -0600 )edit

3 Answers

Sort by ยป oldest newest most voted
2

answered 2015-06-16 11:24:16 -0600

Adolfo Rodriguez T gravatar image

The spawner should be taking its namespace into account when looking for its associated controller_manager. So if the spawner node and the controller_manager are in the same namespace (e.g., / or /my_robot), things should work.

If you observe a different behavior, please open an issue, preferably accompanied with a patch.

edit flag offensive delete link more

Comments

When I put them in the same namespace, then I'm back at /gazebo urdf model.cpp 'Could not find parameter robot_description on parameter server'. If I put another copy of robot_description at the root it is found and it works, but that defeats my purpose of putting it into another namespace.

lucasw gravatar image lucasw  ( 2015-06-17 14:21:25 -0600 )edit

I think the spawner is working fine, the problem is on the other end https://github.com/ros-simulation/gaz... - if I set robotParam to the exact absolute location /mybot/robot_description it still doesn't find it.

lucasw gravatar image lucasw  ( 2015-06-17 14:36:28 -0600 )edit

But it is strange because gazebo_ros_control had on startup found the right robot_description and was happy, it was just when the service call arrived to start a controller where it looked for it again (why? Didn't it already have it?) in the wrong place and failed.

lucasw gravatar image lucasw  ( 2015-06-17 14:57:50 -0600 )edit

@lucasw Were you able to find a solution to this?

webvenky gravatar image webvenky  ( 2015-09-14 22:22:00 -0600 )edit

I haven't tried it but I think this shows it having been fixed https://github.com/ros-simulation/gaz... - I'm in kinetic and it still wasn't working though using the ubuntu packages (or was my config bag?), I'll try the source later.

lucasw gravatar image lucasw  ( 2016-08-15 10:17:49 -0600 )edit

@lucasw Did you compile from source yet? I used sudo apt-get install ros-indigo-ros-control ros-indigo-ros-controllers today and it still says it couldn't find the parameter.

Mav16 gravatar image Mav16  ( 2017-02-20 19:46:42 -0600 )edit
2

answered 2016-08-21 05:16:18 -0600

must_off gravatar image

Had the same problem for a long time and nothing posted here helped. The solution which worked for me: setting timeout while launching the node <node name="base_controller_spawner" pkg="controller_manager" type="spawner" args="joint_publisher velocity_controller --timeout 50 "/>

edit flag offensive delete link more

Comments

1

This solved the problem for me when loading multiple spawners under different namespaces in the same launch file. Thanks!

kleinma gravatar image kleinma  ( 2017-06-05 11:00:30 -0600 )edit
0

answered 2018-07-24 08:53:20 -0600

weihao gravatar image

updated 2018-07-25 07:15:55 -0600

In the launch file, put every thing in a group namespace solved this for me in ros-kinetic, gazebo-7.

Here is my launch file:

<?xml version="1.0" encoding="utf-8"?>
<launch>
<group ns="humanoid">
    <param name="robot_description" textfile="$(find baxter_hug)/gazebo_models/humanoid/humanoid.urdf" />
    <node name="urdf_spawner_humanoid" pkg="gazebo_ros" type="spawn_model" respawn="false" output="screen" 
        args="-urdf -model humanoid -param robot_description -x 1"/>

    <!-- loads the controllers -->
    <rosparam file="$(find baxter_hug)/gazebo_models/humanoid/config.yaml" command="load" />
    <node name="controller_spawner_humanoid" pkg="controller_manager" type="spawner"
        respawn="false" output="screen" 
        args="leftleg_joint_position_controller joint_state_controller --shutdown-timeout 3"/> 
</group>
</launch>

And you need to write the robotParam in .urdf file:

<plugin name="gazebo_ros_control_humanoid" filename="libgazebo_ros_control.so">
     <robotNamespace>/humanoid</robotNamespace>
     <robotParam>humanoid/robot_description</robotParam>
</plugin>

<transmission name="leftleg_trans">
    <type>transmission_interface/SimpleTransmission</type>
    <actuator name="motor2">
      <mechanicalReduction>1</mechanicalReduction>
    </actuator>
    <joint name="LeftLeg_joint">
      <hardwareInterface>hardware_interface/VelocityJointInterface</hardwareInterface>
    </joint>
</transmission>

config.yaml: (Note: do not add namespace in the beginning!!!)

leftleg_joint_position_controller:
    type: velocity_controllers/JointPositionController
    joint: LeftLeg_joint
    pid: {p: 1.0, i: 0.1, d: 0.1}

For ros-indigo, gazebo-2 this solution fails because the joint_position_controller.cpp use urdf.initParam() while ros-kinetic use urdf.initParamWithNodeHandle().

// Get URDF info about joint
  urdf::Model urdf;
  if (!urdf.initParam("robot_description"))
  {
    ROS_ERROR("Failed to parse urdf file");
    return false;
  }

There is no initParamWithNodeHandle() in urdf for ros-indigo. If you want to use the controller with other name (like /humanoid/robot_description) I suggest to change the searching name in joint_position_controller.cpp and build a new controller lib file.

edit flag offensive delete link more

Question Tools

5 followers

Stats

Asked: 2014-12-04 17:43:53 -0600

Seen: 12,271 times

Last updated: Jul 25 '18