Skip to content

Commit ce5f461

Browse files
committed
Make Wheel dimension specific
1 parent d81dd4f commit ce5f461

File tree

4 files changed

+15
-16
lines changed

4 files changed

+15
-16
lines changed

common_xacro/urdf/wheel/wheel.xacro

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,16 +5,18 @@
55
<!-- Mounting Location: Center of cylinder -->
66
<!-- Joint Type: continuous -->
77
<!-- Param name: the name of the wheel -->
8-
<!-- Param mass: mass of the wheel -->
9-
<!-- Param radius: radius of the wheel -->
10-
<!-- Param width: width of the wheel -->
118
<!-- Param parent: name of the parent link, defaulted to base_link -->
129
<!-- Param joint_origin: location of the wheel relative to parent link -->
1310
<robot xmlns:xacro="http://ros.org/wiki/xacro" name="wheel">
14-
<xacro:macro name="wheel" params="name mass radius width parent:=base_link *joint_origin">
11+
<xacro:macro name="wheel" params="name parent:=base_link *joint_origin">
1512
<!-- Includes -->
1613
<xacro:include filename="$(find common_xacro)/urdf/physics/inertia.xacro"/>
1714

15+
<!-- Constants -->
16+
<xacro:property name="radius" value="${6.1875*0.0254}"/>
17+
<xacro:property name="width" value="${4*0.0254}"/>
18+
<xacro:property name="mass" value="5"/>
19+
1820
<!-- Wheel link -->
1921
<link name="${name}_link">
2022
<xacro:cylinder_inertia mass="${mass}" radius="${radius}" height="${width}">

marvin_simulation/urdf/constants.xacro

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -31,11 +31,8 @@
3131
<xacro:property name="caster_z_offset" value="${-0.875*0.0254}"/>
3232

3333
<!-- Wheel Constants -->
34-
<xacro:property name="track_width" value="${31*0.0254}"/>
35-
36-
<xacro:property name="wheel_radius" value="${6.1875*0.0254}"/>
37-
<xacro:property name="wheel_width" value="${4*0.0254}"/>
38-
<xacro:property name="wheel_mass" value="5"/>
34+
<xacro:property name="wheel_x_offset" value="${15.5*0.0254}"/>
35+
<xacro:property name="wheel_z_offset" value="${1.8125*0.0254}"/>
3936

4037
<!-- Lidar Constants -->
4138
<xacro:property name="lidar_height" value="${32.55*0.0254}"/>

marvin_simulation/urdf/marvin.xacro

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -31,11 +31,11 @@
3131

3232
<!-- Wheels -->
3333
<xacro:include filename="$(find common_xacro)/urdf/wheel/wheel.xacro"/>
34-
<xacro:wheel name="right_wheel" mass="${wheel_mass}" radius="${wheel_radius}" width="${wheel_width}">
35-
<origin xyz="0 -${track_width / 2} ${wheel_radius-chassis_z_offset}" rpy="0 0 0" />
34+
<xacro:wheel name="right_wheel">
35+
<origin xyz="0 ${-wheel_x_offset} ${wheel_z_offset}" rpy="0 0 0" />
3636
</xacro:wheel>
37-
<xacro:wheel name="left_wheel" mass="${wheel_mass}" radius="${wheel_radius}" width="${wheel_width}">
38-
<origin xyz="0 ${track_width/2} ${wheel_radius-chassis_z_offset}" rpy="0 0 0" />
37+
<xacro:wheel name="left_wheel">
38+
<origin xyz="0 ${wheel_x_offset} ${wheel_z_offset}" rpy="0 0 0" />
3939
</xacro:wheel>
4040

4141

@@ -64,7 +64,7 @@
6464
<link name="encoder" />
6565

6666
<joint name="encoder_joint" type="fixed">
67-
<origin xyz="0 0 ${wheel_radius-chassis_z_offset}" rpy="0 0 0" />
67+
<origin xyz="0 0 ${wheel_z_offset}" rpy="0 0 0" />
6868
<parent link="base_link" />
6969
<child link="encoder" />
7070
<axis xyz="0 1 0" />

marvin_simulation/urdf/plugins.xacro

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@
99

1010
<left_joint>left_wheel_joint</left_joint>
1111
<right_joint>right_wheel_joint</right_joint>
12-
<wheel_separation>${track_width}</wheel_separation>
13-
<wheel_diameter>${2 * wheel_radius}</wheel_diameter>
12+
<wheel_separation>${2 * wheel_x_offset}</wheel_separation>
13+
<wheel_diameter>${2 * 6.1875*0.0254}</wheel_diameter>
1414
<publish_tf>true</publish_tf>
1515
<publish_wheel_tf>true</publish_wheel_tf>
1616

0 commit comments

Comments
 (0)