Robotics StackExchange | Archived questions

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

I am using ROS Kinetic and Ubuntu 16.04 I am following this tutorial for adding ar tag in gazebo: https://www.youtube.com/watch?v=WDhIaVOUwsk&t=803s

When I run roslaunch multiscenariorobot spawnartrack_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:

<launch>

<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)" />
</include>

</launch>

And spawnroboturdf_jr.launch is:

<launch>

<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"/>
</launch>

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

Asked by krule on 2018-04-30 12:13:39 UTC

Comments

Answers

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.

Asked by PeteBlackerThe3rd on 2018-05-01 05:47:36 UTC

Comments

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.

Asked by gvdhoorn on 2018-05-01 07:49:34 UTC