ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | Q&A
Ask Your Question

Problem with xacro files

asked 2018-07-03 22:01:44 -0600

timmx gravatar image

updated 2018-07-03 22:05:55 -0600

I'm following this tutorial:

and get this when trying to launch:

timmx@timmx-NV52L:~/catkin_ws/src/mybot_description/urdf$ roslaunch  mybot_gazebo mybot_world.launch 
... logging to /home/timmx/.ros/log/f8a88710-7f35-11e8-80fd-20689d9ebc85/roslaunch-timmx-NV52L-27035.log
Checking log directory for disk usage. This may take awhile.
Press Ctrl-C to interrupt
Done checking log file disk usage. Usage is <1GB.

xacro: Traditional processing is deprecated. Switch to --inorder processing!
To check for compatibility of your document, use option --check-order.
For more infos, see
xacro:arg: missing attribute 'default'
when processing file: /home/timmx/catkin_ws/src/mybot_description/urdf/mybot.xacro
Invalid <param> tag: Cannot load command parameter [robot_description]: command [/opt/ros/kinetic/share/xacro/ '/home/timmx/catkin_ws/src/mybot_description/urdf/mybot.xacro'] returned with code [2]. 

Param xml is <param command="$(find xacro)/ '$(find mybot_description)/urdf/mybot.xacro'" name="robot_description"/>
The traceback for the exception was written to the log file

I have written the following files:


<?xml version="1.0"?>
<robot name="mybot" xmlns:xacro="">
  <!-- First ROS-Gazebo robot -->

  <xacro:property name="PI" value="3.1415926535897931"/>
  <xacro:property name="chassisHeight" value="0.1"/>
  <xacro:property name="chassisLength" value="0.4"/>
  <xacro:property name="chassisWidth" value="0.2"/>
  <xacro:property name="chassisMass" value="50"/>

  <xacro:property name="casterRadius" value="0.05"/>
  <xacro:property name="casterMass" value="5"/>

  <xacro:property name="wheelWidth" value="0.05"/>
  <xacro:property name="wheelRadius" value="0.1"/>
  <xacro:property name="wheelPos" value="0.2"/>
  <xacro:property name="wheelMass" value="5"/>

  <xacro:property name="cameraSize" value="0.05"/>
  <xacro:property name="cameraMass" value="0.1"/>

  <xacro:arg name="gui" value="true"/>

  <xacro:include filename="$(find mybot_description)/urdf/mybot.gazebo" />
  <xacro:include filename="$(find mybot_description)/urdf/materials.xacro" />
  <xacro:include filename="$(find mybot_description)/urdf/macros.xacro" />

  <link name="footprint" />

  <joint name="base_joint" type="fixed">
    <parent link="footprint"/>
    <child link="chassis"/>

  <link name="chassis">
      <origin xyz="0 0 ${wheelRadius}" rpy="0 0 0" />
        <box size="${chassisLength} ${chassisWidth} ${chassisHeight}" />
      <origin xyz="0 0 ${wheelRadius}" rpy="0 0 0"/>
        <box size="${chassisLength} ${chassisWidth} ${chassisHeight}" />
      <material name="orange"/>
      <origin xyz="0 0 ${wheelRadius}" rpy="0 0 0"/>
      <mass value="${chassisMass}"/>
      <box_inertia m="${chassisMass}" x="${chassisLength}" y="${chassisWidth}" z="${chassisHeight}"/>



<?xml version="1.0"?>
<robot name="mybot_macros" xmlns:xacro="">
        <!-- Put here the robot description -->

  <xacro:macro name="cylinder_inertia" params="m r h">
    <inertia ixx="${m * (3 * r * r + h * h) / 12}" ixy="0" ixz="0"
      iyy="${m * (3 * r * r + h * h) / 12}" iyz="0"
      izz="${m * r * r / 2}"

  <xacro:macro name="box_inertia" params="m x y z">
    <inertia ixx="${m * (y * y + z * z) / 12}" ixy="0" ixz="0"
      iyy="${m * (x * x + z * z) / 12}" iyz="0"
      izz="${m * (x * x + z * z) / 12}"

  <xacro:macro name="sphere_inertia" params="m r">
    <inertia ixx="${2 * m * r * r / 5}" ixy="0 ...
edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted

answered 2018-07-04 01:44:40 -0600

Reamees gravatar image

updated 2018-07-04 02:20:45 -0600


Actually just delete the line:

<xacro:arg name="gui" value="true"/>

As far as I can tell it is a launch parameter for Gazebo. So it shouldn't be in your robot description at all.

(original answer)

In mybot.xacro change the line

<xacro:arg name="gui" value="true"/>


<xacro:arg name="gui" default="true"/>

It is somewhat explained in the ros wiki for xacros in point 6:

edit flag offensive delete link more


Thank you :)

timmx gravatar image timmx  ( 2018-07-04 13:21:32 -0600 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools



Asked: 2018-07-03 22:01:44 -0600

Seen: 5,834 times

Last updated: Jul 04 '18