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

Invalid <param> tag: Cannot load command parameter [robot_description]:

asked 2018-04-30 12:13:39 -0600

krule gravatar image

updated 2018-05-01 01:44:08 -0600

jayess gravatar image

I am using ROS Kinetic and Ubuntu 16.04 I am following this tutorial for adding ar tag in gazebo:

When I run roslaunch multi_scenario_robot spawn_ar_track_jr.launch I get this

cat: '$(arg': No such file or directory
cat: urdf_robot_file: No such file or directory
while processing /home/filip/catkin_ws/src/multi_robot_scenario/launch/spawn_robot_urdf_jr.launch:
Invalid <param> tag: Cannot load command parameter [robot_description]: command [cat $(arg urdf_robot_file] returned with code [1]. 
Param xml is param command="cat $(arg urdf_robot_file)" name="robot_description"/> The traceback for the exception was written to the log file

My launch file is:


<arg name="x" default="0.0" />
<arg name="y" default="0.5" />
<arg name="z" default="0.5" />
<arg name="roll" default="1.57" />
<arg name="pitch" default="0" />
<arg name="yaw" default="0" />

<arg name="urdf_robot_file" default="$(find multi_robot_scenario)/ar_tag_5.urdf" />
<arg name="robot_name" default="ar_5"/>

<include file="$(find multi_robot_scenario)/launch/spawn_robot_urdf_jr.launch">
    <arg name="x" value="$(arg x)"/>
    <arg name="y" value="$(arg y)"/>
    <arg name="z" value="$(arg z)"/>
    <arg name="pitch" value="$(arg pitch)"/>
    <arg name="roll" value="$(arg roll)"/>
    <arg name="yaw" value="$(arg yaw)"/>

    <arg name="urdf_robot_file" value="$(arg urdf_robot_file" />
    <arg name="robot_name" value="$(arg robot_name)" />


And spawn_robot_urdf_jr.launch is:


<arg name="x" default="0.0" />
<arg name="y" default="0.0" />
<arg name="z" default="0.0" />
<arg name="roll" default="0" />
<arg name="pitch" default="0" />
<arg name="yaw" default="0" />

<arg name="urdf_robot_file" default="" />
<arg name="robot_name" default="" />

<param name="robot_description" command="cat $(arg urdf_robot_file)" />

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

Can someone please help? I wasn't able to find out what to do.

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted

answered 2018-05-01 05:47:36 -0600

The important error messages in this case are:

cat: '$(arg': No such file or directory
cat: urdf_robot_file: No such file or directory

which are caused by the way the command attribute is being parsed on this line:

<param name="robot_description" command="cat $(arg urdf_robot_file)" />

The space is making the cat command interpret the two strings as separate parameters. You need to put the argument lookup into quotation marks, but since this is inside an XML tag these quotes need to be escaped as shown below:

<param name="robot_description" command="cat &quot;$(arg urdf_robot_file)&quot;" />

hopefully this will solve your problem.

edit flag offensive delete link more


I would actually just suggest to use textfile instead of command: roslaunch/XML/param - Attributes - textfile. A static urdf is essentially just a plain text file.

gvdhoorn gravatar image gvdhoorn  ( 2018-05-01 07:49:34 -0600 )edit

Question Tools

1 follower


Asked: 2018-04-30 12:13:39 -0600

Seen: 1,741 times

Last updated: May 01 '18