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

Revision history [back]

click to hide/show revision 1
initial version

As you can read on the schunk_description wiki page:

This package contains the description (mechanical, kinematic, visual, etc.) of different schunk components. The files in this package are parsed and used by a variety of other components. Most users will not interact directly with this package.

One of the consequences of this setup seems to be that the package only contains xacro macros and no top-level entities that would invoke those macros to create a valid urdf file (you probably got a "URDF/COLLADA file is not a valid robot model" together with a "No name given for the robot" error from the Setup Assistant).

This makes me feel if I want moveit work, I should first be able to create .urdf files.

That is partly true: the Setup Assistant needs a valid urdf, and you'll only get that if you create the top-level xacro that invokes the schunk_lwa macro. Something like the following should work:

<?xml version="1.0" ?>

  <robot name="my_robot" xmlns:xacro="http://ros.org/wiki/xacro">
  <!-- we 'import' the macro definition from that file -->
  <xacro:include filename="$(find schunk_description)/urdf/lwa/lwa.urdf.xacro"/>

  <!-- this could be anything, but you need a 'parent' link -->
  <link name="world" />

  <!-- here we 'call' the macro and supply it with the required arguments -->
  <xacro:schunk_lwa parent="world" name="my_lwa">
    <origin rpy="0 0 0" xyz="0 0 0" />
  </xacro:schunk_lwa>
</robot>

Call this my_lwa.xacro (or something), place it in a package that is on your ROS_PACKAGE_PATH (basically, it should be in your ROS workspace) and load it in the Setup Assistant. It should then be able to load your LWA.

As you can read on the schunk_description wiki page:

This package contains the description (mechanical, kinematic, visual, etc.) of different schunk components. The files in this package are parsed and used by a variety of other components. Most users will not interact directly with this package.

One of the consequences of this setup seems to be that the package only contains xacro macros and no top-level entities that would invoke those macros to create a valid urdf file (you probably got a "URDF/COLLADA file is not a valid robot model" together with a "No name given for the robot" error from the Setup Assistant).

This makes me feel if I want moveit work, I should first be able to create .urdf files.

That is partly true: the Setup Assistant needs a valid urdf, and you'll only get that if you create the a top-level xacro that invokes the schunk_lwa macro. Something like the following should work:

<?xml version="1.0" ?>

  <robot name="my_robot" xmlns:xacro="http://ros.org/wiki/xacro">
  <!-- we 'import' the macro definition from that file -->
  <xacro:include filename="$(find schunk_description)/urdf/lwa/lwa.urdf.xacro"/>

  <!-- this could be anything, but you need a 'parent' link -->
  <link name="world" />

  <!-- here we 'call' the macro and supply it with the required arguments -->
  <xacro:schunk_lwa parent="world" name="my_lwa">
    <origin rpy="0 0 0" xyz="0 0 0" />
  </xacro:schunk_lwa>
</robot>

Call this my_lwa.xacro (or something), place it in a package that is on your ROS_PACKAGE_PATH (basically, it should be in your ROS workspace) and load it in the Setup Assistant. It should then be able to load your LWA.

Note: I use the term top-level xacro file to refer to any xacro that doesn't (only) declare xacro macros itself. All files that can be converted to a valid urdf using rosrun xacro xacro .. I consider top-level.

As you can read on the schunk_description wiki page:

This package contains the description (mechanical, kinematic, visual, etc.) of different schunk components. The files in this package are parsed and used by a variety of other components. Most users will not interact directly with this package.

One of the consequences of this setup seems to be that the package only contains xacro macros and no top-level entities that would invoke those macros to create a valid urdf file (you probably got a "URDF/COLLADA file is not a valid robot model" together with a "No name given for the robot" error from the Setup Assistant).

This makes me feel if I want moveit work, I should first be able to create .urdf files.

That is partly true: the Setup Assistant needs a valid urdf, and you'll only get that if you create a top-level xacro that invokes the schunk_lwa macro. Something like the following should work:

<?xml version="1.0" ?>

  <robot name="my_robot" xmlns:xacro="http://ros.org/wiki/xacro">
  <!-- we 'import' the macro definition from that file -->
  <xacro:include filename="$(find schunk_description)/urdf/lwa/lwa.urdf.xacro"/>

  <!-- this could be anything, but you need a 'parent' link -->
  <link name="world" />

  <!-- here we 'call' the macro and supply it with the required arguments -->
  <xacro:schunk_lwa parent="world" name="my_lwa">
    <origin rpy="0 0 0" xyz="0 0 0" />
  </xacro:schunk_lwa>
</robot>

Call this my_lwa.xacro (or something), place it in a package that is on your ROS_PACKAGE_PATH (basically, it should be in your ROS workspace) and load it in the Setup Assistant. It should then be able to load your LWA.

Note: I use the term top-level xacro file to refer to any xacro that doesn't (only) declare xacro macros itself. All files that can be converted to a valid urdf using rosrun xacro xacro .. I consider top-level.

So just to conclude: there is nothing wrong with the xacros in schunk_description, they are just not top-level xacros, meaning you cannot use them directly, but only as building blocks in other xacros.

As you can read on the schunk_description wiki page:

This package contains the description (mechanical, kinematic, visual, etc.) of different schunk components. The files in this package are parsed and used by a variety of other components. Most users will not interact directly with this package.

One of the consequences of this setup seems to be that the package only contains xacro macros and no top-level entities that would invoke those macros to create a valid urdf file (you probably got a "URDF/COLLADA file is not a valid robot model" together with a "No name given for the robot" error from the Setup Assistant).

This makes me feel if I want moveit work, I should first be able to create .urdf files.

That is partly true: the Setup Assistant needs a valid urdf, and you'll only get that if you create a top-level xacro that invokes the schunk_lwa macro. Something like the following should work:

<?xml version="1.0" ?>
 <robot name="my_robot" xmlns:xacro="http://ros.org/wiki/xacro">
   <!-- we 'import' the macro definition from that file -->
  <xacro:include filename="$(find schunk_description)/urdf/lwa/lwa.urdf.xacro"/>

  <!-- this could be anything, but you need a 'parent' link -->
  <link name="world" />

  <!-- here we 'call' the macro and supply it with the required arguments -->
  <xacro:schunk_lwa parent="world" name="my_lwa">
    <origin rpy="0 0 0" xyz="0 0 0" />
  </xacro:schunk_lwa>
</robot>

Call this my_lwa.xacro (or something), place it in a package that is on your ROS_PACKAGE_PATH (basically, it should be in your ROS workspace) and load it in the Setup Assistant. It should then be able to load your LWA.

Note: I use the term top-level xacro file to refer to any xacro that doesn't (only) declare xacro macros itself. All files that can be converted to a valid urdf using rosrun xacro xacro .. I consider top-level.

So just to conclude: there is nothing wrong with the xacros in schunk_description, they are just not top-level xacros, meaning you cannot use them directly, but only as building blocks in other xacros.