Skip to content

Instantly share code, notes, and snippets.

@jamuraa
Created November 22, 2012 00:33
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jamuraa/f0da3bc34c7418a45e2e to your computer and use it in GitHub Desktop.
Save jamuraa/f0da3bc34c7418a45e2e to your computer and use it in GitHub Desktop.
Problematic URF
<?xml version="1.0"?>
<robot
xmlns="http://www.ros.org/wiki/urdf"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="https://raw.github.com/laas/urdf_validator/master file:urdf.xsd"
xmlns:xacro="http://www.ros.org/wiki/xacro"
name="microvision">
<include filename="$(find microvision_description)/urdf/gazebo.urdf.xacro" />
<xacro:property name="inches" value="0.0254" />
<xacro:property name="pi" value="3.14159265" />
<xacro:macro name="default_inertial" params="mass">
<inertial>
<mass value="${mass}" />
<inertia ixx="1.0" ixy="0.0" ixz="0.0" iyy="1.0" iyz="0.0" izz="1.0" />
</inertial>
</xacro:macro>
<!-- base_footprint for navigation, it is on the ground directly below base_link origin.
It also serves the purpose of putting the root gazebo element on the 0 point of the z plane, which
means physics doesn't launch ourselves out of the floor when we spawn the model -->
<link name="base_footprint">
<visual>
<origin xyz="0 0 0" rpy="0 0 0" />
<geometry>
<box size="0.001 0.001 0.001" />
</geometry>
</visual>
<collision>
<origin xyz="0 0 0.01" rpy="0 0 0" /> <!-- 1cm off the floor, so we won't collide -->
<geometry>
<box size="0.001 0.001 0.001" />
</geometry>
</collision>
</link>
<!--- Base TUBE is around 2.5" Radius -->
<link name="base_link">
<visual>
<origin rpy="${0.5*pi} ${-0.5*pi} ${0*pi}" xyz="${-3.75*inches} ${0*inches} ${-3.65*inches}" />
<geometry>
<mesh filename="package://microvision_description/meshes/stl/microvision_robot_1_no_camlaser.stl" />
</geometry>
<!--
<origin rpy="${0.5*pi} ${0*pi} ${0*pi}" xyz="0 0 0" />
<geometry>
<cylinder radius="${2.5*inches}" length="${8*inches}" />
</geometry>
-->
<material name="clearish">
<color rgba="1 1 1 0.5" />
</material>
</visual>
<collision>
<origin rpy="${0.5*pi} ${0*pi} ${0*pi}" xyz="0 0 0" />
<geometry>
<cylinder radius="${2.5*inches}" length="${8*inches}" />
</geometry>
</collision>
<inertial>
<mass value="20.0" />
<inertia ixx="1.0" ixy="0.0" ixz="0.0" iyy="1.0" iyz="0.0" izz="1.0" />
<origin rpy="0 0 0" xyz="-0.05 0 0" />
</inertial>
</link>
<!-- center of robot is 3.625 inches from the ground, because the rubber wheels are 7.25in diameter. -->
<joint name="base_footprint_to_base_link" type="fixed">
<origin xyz="0 0 0.092075" rpy="0 0 0" />
<parent link="base_footprint" />
<child link="base_link" />
</joint>
<xacro:macro name="microvision_wheel" params="prefix parent mirror">
<link name="${prefix}_wheel">
<visual>
<origin rpy="0 0 ${mirror * 0.5 * pi}" xyz="0 0 0" />
<geometry>
<!-- Wheels are made of three parts: two .25in plates with dia 7in,
which sandwich a .25in nitrile rubber groove with dia 7.25,
the simple model models these as the rubber only. -->
<mesh filename="package://microvision_description/meshes/stl/wheel_assy.stl" />
</geometry>
<material name="nitrilerubber">
<color rgba="0.65 0.34 0.45 1" />
</material>
</visual>
<collision>
<origin rpy="0 0 ${mirror * 0.5 * pi}" xyz="0 0 0" />
<geometry>
<!-- Wheels are made of three parts: two .25in plates with dia 7in,
which sandwich a .25in nitrile rubber groove with dia 7.25,
the simple model models these as the rubber only. -->
<mesh filename="package://microvision_description/meshes/stl/wheel_assy.stl" />
</geometry>
</collision>
<xacro:default_inertial mass="1.0" />
</link>
<gazebo reference="${prefix}_wheel">
<mu1 value="10" />
<mu2 value="10" />
<kp value="100000000.0" />
<kd value="10000.0" />
<fdir value="1 0 0" />
</gazebo>
<!-- Assume a .25 in gap between the body and the wheel, meaning the center of the
wheel is: 3.995 (half of the body) + 0.25 (air gap) + 0.25 (inner wheel plate) + 0.125 (half of the rubber) =
4.62in from the origin. -->
<joint name="${prefix}_wheel_joint" type="continuous">
<axis xyz="0 1 0" />
<origin rpy="0 0 0" xyz="0 ${0.117348 * mirror} 0" />
<parent link="${parent}" />
<child link="${prefix}_wheel" />
</joint>
</xacro:macro>
<xacro:microvision_wheel prefix="left" parent="base_link" mirror="1" />
<xacro:microvision_wheel prefix="right" parent="base_link" mirror="-1" />
<!-- The tail is connected to a linear actuator, a Firgelli L12
This is the 30mm version.. If we have another version, we can just add the MM
to the X axis
The measurements are from the datasheet (in mm):
x - length - stroke + 7 + 37 + 9 = 83mm
y - height - 18
z - width - 15
-->
<link name="linear_actuator_body">
<visual>
<geometry>
<mesh filename="package://microvision_description/meshes/stl/firgelli_l12_body.stl" />
</geometry>
<!-- the axis of this body is in the center of the mounting hole -->
<origin rpy="${0.5*pi} 0 0" xyz="0 0 0" />
<material name="blue">
<color rgba="0.00 0.00 0.66 1" />
</material>
</visual>
<collision>
<geometry>
<mesh filename="package://microvision_description/meshes/stl/firgelli_l12_body.stl" />
</geometry>
<origin rpy="${0.5*pi} 0 0" xyz="0 0 0" />
</collision>
<xacro:default_inertial mass="0.034" />
</link>
<!-- TODO: Assuming it's attached in the center of the back of the box, on the top edge,
which is what it looks like by the pictures -->
<joint name="base_link_to_linear_actuator" type="fixed">
<parent link="base_link" />
<child link="linear_actuator_body" />
<!-- 2 inches of the box + 9 mm = 2.35433 -->
<origin rpy="0 ${-0.5*pi} 0" xyz="${-3.43*inches} 0 ${2.05*inches}" />
</joint>
<link name="linear_actuator_piston">
<visual>
<geometry>
<mesh filename="package://microvision_description/meshes/stl/firgelli_l12_slide.stl" />
</geometry>
<!-- place the axis on the end -->
<origin xyz="-0.003 -0.0045 0.0045" rpy="${0.5*pi} ${0*pi} 0" />
<material name="red aluminum">
<color rgba="0.66 0.11 0.11 1" />
</material>
</visual>
<collision>
<geometry>
<mesh filename="package://microvision_description/meshes/stl/firgelli_l12_slide.stl" />
</geometry>
<!-- place the axis on the end -->
<origin xyz="-0.003 -0.0045 0.0045" rpy="${0.5*pi} ${0*pi} 0" />
</collision>
<xacro:default_inertial mass="0.004" />
</link>
<joint name="linear_actuator_body_to_piston" type="prismatic">
<parent link="linear_actuator_body" />
<child link="linear_actuator_piston" />
<limit lower="-0.030" upper="0" effort="1000.0" velocity="0.05" />
<axis xyz="1 0 0" />
<origin rpy="0 0 0" xyz="-0.0825 0 0" />
</joint>
<!-- TODO: the actuator is connected to the tail piece partway through. -->
<link name="tail_piece">
<visual>
<geometry>
<mesh filename="package://microvision_description/meshes/stl/tail_assembly.stl" />
</geometry>
<!-- put the origin where the pin goes -->
<origin xyz="0.0088 -0.006 -0.013" rpy="0 ${pi} ${0.5*pi}" />
<material name="aluminum">
<color rgba="0.66 0.66 0.66 0.5" />
</material>
</visual>
<collision>
<geometry>
<mesh filename="package://microvision_description/meshes/stl/tail_assembly.stl" />
</geometry>
<origin xyz="0.0088 -0.006 -0.013" rpy="0 ${pi} ${0.5*pi}" />
</collision>
<xacro:default_inertial mass="1.00" />
</link>
<joint name="tail_actuator_joint" type="revolute">
<!-- tail attaches to the bottom back plate of the main body, right above the bottom of the robot main body -->
<origin rpy="0 0.7161 0" xyz="${-2.25*inches} 0 ${-1.918*inches}" />
<limit lower="-0.8451" upper="0" effort="1000.0" velocity="0.392" />
<axis xyz="0 1 0" />
<parent link="base_link" />
<child link="tail_piece" />
<mimic joint="linear_actuator_body_to_piston" multiplier="1" offset="0" />
</joint>
<link name="laser">
<visual>
<origin rpy="${0.5*pi} ${0*pi} ${0.5*pi}" xyz="0 0 0" />
<geometry>
<mesh filename="package://microvision_description/meshes/stl/rangefinder_with_shield.stl" />
</geometry>
<material name="aluminum" />
</visual>
<collision>
<geometry>
<box size="0.0635 0.06985 0.08255" />
</geometry>
</collision>
<xacro:default_inertial mass="0.160" />
</link>
<!-- Let's give the laser no friction for now, just because we don't want to stick like glue to the floor. -->
<xacro:gazebo_frictionless link_name="laser" />
<joint name="laser_joint" type="fixed">
<!-- laser base center is 2.4375in from the center of the robot, on the left as you are behind it -->
<origin xyz="0.0 0.061925 0.07" rpy="0 0 0" />
<parent link="base_link" />
<child link="laser" />
</joint>
<microvision_sim_laser />
<microvision_sim_microvision />
</robot>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment