Testing URDF files

Found a neat little website for testing URDF files (as long as they don't include external model files) http://mymodelrobot.appspot.com .

This allows you to build a URDF file and then test it out, move the joints, and change the settings to make the model exactly like you want it for your simulations. I thought this was so cool and wondered if there was a way to visualize URDF files which are made from STL files. I found such a way trough the wiki: http://wiki.ros.org/ros3djs/Tutorials/VisualizingAURDF .

Using these tools make the process so much easier by allowing one to make the model and change where the wheels are without having to start RVIS or Gazebo, check the model, close the program modify the URDF file, and repeat until I am happy with the model.

I used the my model robot page (link above) to help understand the URDF format. This gave me a basic idea of how to create one and how the settings should be for the one using STL files. With a little bit of modifications, I changed the PI_robot into the lawnmower like this:

<?xml version="1.0"?>

<robot name="lawnmow">

<!-- * * * Link Definitions * * * -->

<link name="base_link">

<visual>

<origin xyz="0 0 0.278" rpy="0 0.12 0"/>

<geometry>

<box size="0.657359 0.4441 0.085"/>

</geometry>

<material name="red">

<color rgba="1 0 0 1"/>

</material>

</visual>

</link>

<link name="rr_wheel">

<visual>

<origin xyz="0 0 0" rpy="1.58 0 0"/>

<geometry>

<cylinder radius="0.167022" length="0.07"/>

</geometry>

<material name="black">

<color rgba="0 0 0 0"/>

</material>

</visual>

</link>

<link name="lr_wheel">

<visual>

<origin xyz="0 0 0" rpy="1.58 0 0"/>

<geometry>

<cylinder radius="0.167022" length="0.07"/>

</geometry>

<material name="black">

<color rgba="0 0 0 0"/>

</material>

</visual>

</link>

<link name="lf_wheel">

<visual>

<origin xyz="0 0 0" rpy="1.58 0 0"/>

<geometry>

<cylinder radius="0.0889" length="0.07"/>

</geometry>

<material name="black">

<color rgba="0 0 0 0"/>

</material>

</visual>

</link>

<link name="rf_wheel">

<visual>

<origin xyz="0 0 0" rpy="1.58 0 0"/>

<geometry>

<cylinder radius="0.0889" length="0.07"/>

</geometry>

<material name="black">

<color rgba="0 0 0 0"/>

</material>

</visual>

</link>

<!-- * * * Joint Definitions * * * -->

<joint name="rr_wheel_joint" type="fixed">

<parent link="base_link"/>

<child link="rr_wheel"/>

<origin xyz="-0.25 0.26 .18" rpy="0 0 0"/>

</joint>

<joint name="lr_wheel_joint" type="fixed">

<parent link="base_link"/>

<child link="lr_wheel"/>

<origin xyz="-0.25 -0.26 .18" rpy="0 0 0"/>

</joint>

<joint name="lf_wheel_joint" type="fixed">

<parent link="base_link"/>

<child link="lf_wheel"/>

<origin xyz="0.25 -0.19 .1" rpy="0 0 0"/>

</joint>

<joint name="rf_wheel_joint" type="fixed">

<parent link="base_link"/>

<child link="rf_wheel"/>

<origin xyz="0.25 0.19 .1" rpy="0 0 0"/>

</joint>

</robot>

This can be copied and pasted over the code in the model my robot website.

You can see how this looks almost nothing like the original code. The biggest parts I want to focus on are the orientation and position.

  • Position is a function of the origin xyz part to move the part in a direction - or + x,y, and/or z.
  • Orientation is a function of the rpy part to move the part in an angle around the x,y, and/or z.

It seems that link position is done in the joint definitions, while link orientation is done in the joint definitions.


Next time we will build a URDF with the better looking .STL files and inertial properties.


1/4/17