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

adding robot_description to parameter server

asked 2013-04-24 03:32:51 -0600

da-na gravatar image

Hi there!

I'd like to add robot_description to parameter server and frankly speaking, after reading the tutorial about making urdf, I still have no idea, how to do that.

In my launch file I did:

<launch>

  <node pkg="robot_state_publisher" type="state_publisher" name="robot_state_publisher">
    **<remap from="robot_description" to="$(find museumGuide)/urdf_model/peoplebot.xml" />**

    <remap from="joint_state" to="joint_state"/>
    <param name="publish_frequency" type="double" value="15.0"/>
    <param name="tf_prefix" type="string" value=""/>
  </node>

</launch>

But apparently this line remap from="robot_description" to="$(find museumGuide)/urdf_model/peoplebot.xml" / is wrong, as I get error:

remap to [/home/peoplebot/fuerte_wrkspc/sandbox/museumGuide/urdf_model/peoplebot.xml] is not a valid ROS name

I'd be gratefull for your help! Thanks in advance,

da-na

edit retag flag offensive close merge delete

2 Answers

Sort by ยป oldest newest most voted
17

answered 2013-04-24 04:40:43 -0600

updated 2016-09-19 10:22:06 -0600

The remap command is only used to "rename" parameters that are already loaded to the parameter server. In your case, you want to load new data to the parameter server, so you'll need to do something different.

There are multiple ways to load URDF data from a file to the parameter server:

1) Use <param> with the command attribute, as shown in this URDF tutorial:

<launch>
    <param name="robot_description" command="cat $(find museumGuide)/urdf_model/peoplebot.xml" />
    <node name="robot_state_publisher" pkg="robot_state_publisher" type="state_publisher" />
</launch>

2) Use <param> with the <textfile> argument as shown here:

  <param name="robot_description" textfile="$(find museumGuide)/urdf_model/peoplebot.xml"/>

I think it is generally preferred to use option #2. That's also the method that is used for packages generated by the internal ROS wizards for Arm Navigation and MoveIt.

Edit:
In response to Cerin's comment below, here's a 3rd option showing how to load an XACRO file to the parameter server:

3) Use <param> with the command attribute and the xacro script, as shown in the very first example on the XACRO Tutorial page:

  <param name="robot_description" command="$(find xacro)/xacro '$(find mypackage)/path/to/robot.xacro'" />
edit flag offensive delete link more

Comments

Thank you, it worked :)

da-na gravatar image da-na  ( 2013-04-24 08:05:46 -0600 )edit

thanks it worked me too!

Satoshi Iwashi gravatar image Satoshi Iwashi  ( 2013-11-19 22:02:48 -0600 )edit

How can we do this using 'rosparam load'?

2ROS0 gravatar image 2ROS0  ( 2016-06-06 14:22:01 -0600 )edit

How would you load a urdf xacro file/

Cerin gravatar image Cerin  ( 2016-09-18 16:41:01 -0600 )edit
1

answered 2017-10-17 20:19:40 -0600

jayess gravatar image

I'm late to the game, but an alternative way to add a robot_description to the parameter server is through the command line

rosparam load my_robot.urdf robot_description

According to the wiki, the syntax

rosparam load <yaml-file> [namespace]

is for a yaml file, but this works just as well with a urdf file. The wiki does have a warning though

NOTE: this will add to the currently set values.

I tried loading it twice to see if I would get the two descriptions loaded under one parameter and I didn't.

edit flag offensive delete link more

Question Tools

5 followers

Stats

Asked: 2013-04-24 03:32:51 -0600

Seen: 22,407 times

Last updated: Oct 17 '17