Skip to content

Instantly share code, notes, and snippets.

@jones2126
Last active May 16, 2021 16:55
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 jones2126/ea6e3a2393ffc6f55a32ef9e22c2fe06 to your computer and use it in GitHub Desktop.
Save jones2126/ea6e3a2393ffc6f55a32ef9e22c2fe06 to your computer and use it in GitHub Desktop.
ROS Ag Lawn Tractor URDF file
<?xml version="1.0"?>
<robot name="lawn_tractor" xmlns:xacro='http://www.ros.org/wiki/xacro'>
<!-- TODO: collision link element to be added -->
<!-- TODO: inertial link element to be added -->
<!-- define base link, center of rear axle for an ackermann vehicle -->
<link name="base_link">
<visual>
<origin xyz='0.55 0 0' rpy='0 0 ${pi}' />
<geometry>
<mesh filename="package://lawn_tractor_sim/meshes/lawn_tractor.dae" scale='1 1 1'/>
</geometry>
</visual>
</link>
<!-- define base footprint (virtual link) -->
<link name="base_footprint" />
<!-- define gps link -->
<link name="gps">
<visual>
<origin xyz='0 0 0' rpy='0 0 0' />
<geometry>
<sphere radius='0.05' />
</geometry>
<material name='red'>
<color rgba='1 0 0 0.5' />
</material>
</visual>
</link>
<!-- define camera link
<link name="camera">
<visual>
<origin xyz='0 0 0' rpy='0 0 0' />
<geometry>
<sphere radius='0.05' />
</geometry>
<material name='red'>
<color rgba='1 0 0 0.5' />
</material>
</visual>
</link> -->
<!-- define ultrasonic sensor link
<link name="base_laser_link">
<visual>
<origin xyz='0 0 0' rpy='0 0 0' />
<geometry>
<sphere radius='0.05' />
</geometry>
<material name='red'>
<color rgba='1 0 0 0.5' />
</material>
</visual>
</link> -->
<!-- xacro macro definition -->
<!-- default inertia -->
<xacro:macro name='default_inertia' params='mass x:=0 y:=0 z:=0'>
<inertial>
<origin xyz='${x} ${y} ${z}' />
<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>
<!-- define base footprint joint -->
<joint name="base_footprint_joint" type="fixed">
<parent link="base_footprint"/>
<child link="base_link"/>
<origin xyz="0 0 0.25" rpy="0 0 0" />
</joint>
<!-- define gps joint -->
<joint name="gps_joint" type="fixed">
<parent link="base_link"/>
<child link="gps"/>
<origin xyz="0.46 0 0.61" rpy="0 0 0" />
</joint>
<!-- define camera joint
<joint name="camera_joint" type="fixed">
<parent link="base_link"/>
<child link="camera"/>
<origin xyz="1.5 0 0.5" rpy="${-pi/2} 0 ${-pi/2}" />
</joint> -->
<!-- define ultrasonic sensor joint -->
<!--joint name="range_joint" type="fixed">
<parent link="base_link"/>
<child link="base_laser_link"/>
<origin xyz="1.5 0 0.75" rpy="0 0 0" />
</joint> -->
</robot>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment