decorations.urdf.xacro 7.81 KB
Newer Older
1
2
3
4
5
<?xml version="1.0"?>
<!--
Software License Agreement (BSD)

\file      decorations.urdf.xacro
TheDash's avatar
TheDash committed
6
\authors   Paul Bovbel <pbovbel@clearpathrobotics.com>, Devon Ash <dash@clearpathrobotics.com>
7
8
9
10
11
12
\copyright Copyright (c) 2015, Clearpath Robotics, Inc., All rights reserved.

Redistribution and use in source and binary forms, with or without modification, are permitted provided that
the following conditions are met:
 * Redistributions of source code must retain the above copyright notice, this list of conditions and the
   following disclaimer.
13
 * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the
14
15
16
17
18
19
20
21
22
23
24
25
26
27
   following disclaimer in the documentation and/or other materials provided with the distribution.
 * Neither the name of Clearpath Robotics nor the names of its contributors may be used to endorse or promote
   products derived from this software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WAR-
RANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, IN-
DIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-->
<robot name="husky_decorations" xmlns:xacro="http://ros.org/wiki/xacro">

28
  <xacro:macro name="husky_decorate">
29

30
31
    <xacro:property name="husky_front_bumper_extend" value="$(optenv HUSKY_FRONT_BUMPER_EXTEND 0)" />
    <xacro:property name="husky_rear_bumper_extend" value="$(optenv HUSKY_REAR_BUMPER_EXTEND 0)" />
32

TheDash's avatar
TheDash committed
33
34
    <!-- Spawn Husky chassis -->
    <link name="top_chassis_link">
35
36
37
      <visual>
        <origin xyz="0 0 0" rpy="0 0 0" />
        <geometry>
38
          <mesh filename="package://husky_description/meshes/top_chassis.dae" />
39
40
41
        </geometry>
      </visual>
    </link>
TheDash's avatar
TheDash committed
42
43
44

    <!-- Attach chassis to the robot -->
    <joint name="top_chassis_joint" type="fixed">
45
      <parent link="base_link" />
TheDash's avatar
TheDash committed
46
      <child link="top_chassis_link" />
47
48
    </joint>

49
50
51
52
53
54
55
56
57
    <xacro:if value="$(optenv HUSKY_USER_RAIL_ENABLED true)">
      <!-- Spawn user rails -->
      <link name="user_rail_link">
        <visual>
          <geometry>
            <mesh filename="package://husky_description/meshes/user_rail.dae" />
          </geometry>
        </visual>
      </link>
TheDash's avatar
TheDash committed
58

59
60
61
62
63
64
65
      <!-- Attach user rails to base link -->
      <joint name="user_rail" type="fixed">
        <origin xyz="0.272 0 0.245" rpy="0 0 0" />
        <parent link="base_link" />
        <child link="user_rail_link" />
      </joint>
    </xacro:if>
66

TheDash's avatar
TheDash committed
67
    <!-- Spawn front bumper link -->
68
    <link name="front_bumper_link">
69
70
      <visual>
        <geometry>
71
          <mesh filename="package://husky_description/meshes/bumper.dae" />
72
73
74
        </geometry>
      </visual>
    </link>
TheDash's avatar
TheDash committed
75
76

    <!-- Attach front bumper -->
77
    <joint name="front_bumper" type="fixed">
78
      <origin xyz="${0.48 + husky_front_bumper_extend} 0 0.091" rpy="0 0 0" />
79
      <parent link="base_link" />
80
      <child link="front_bumper_link" />
81
82
    </joint>

83
    <xacro:if value="${husky_front_bumper_extend}">
84
85
86
      <link name="front_bumper_extension_link">
          <visual>
              <geometry>
87
                  <mesh filename="package://husky_description/meshes/bumper_extension.dae" />
88
89
90
91
92
              </geometry>
          </visual>
      </link>

      <joint name="front_bumper_extension" type="fixed">
93
        <origin xyz="${0.48 + husky_front_bumper_extend} 0 0.091" rpy="0 0 0" />
94
95
96
97
98
        <parent link="base_link" />
        <child link="front_bumper_extension_link" />
      </joint>
    </xacro:if>

TheDash's avatar
TheDash committed
99
    <!-- Spawn rear bumper link -->
100
    <link name="rear_bumper_link">
101
102
      <visual>
        <geometry>
103
          <mesh filename="package://husky_description/meshes/bumper.dae" />
104
105
106
        </geometry>
      </visual>
    </link>
TheDash's avatar
TheDash committed
107
108

    <!-- Attach rear bumper -->
109
    <joint name="rear_bumper" type="fixed">
110
      <origin xyz="${-0.48 - husky_rear_bumper_extend} 0 0.091" rpy="0 0 ${M_PI}" />
111
      <parent link="base_link" />
112
      <child link="rear_bumper_link" />
113
    </joint>
114

115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
    <xacro:if value="${husky_rear_bumper_extend}">
      <link name="rear_bumper_extension_link">
          <visual>
              <geometry>
                  <mesh filename="package://husky_description/meshes/bumper_extension.dae" />
              </geometry>
          </visual>
      </link>

      <joint name="rear_bumper_extension" type="fixed">
        <origin xyz="${-0.48 - husky_rear_bumper_extend} 0 0.091" rpy="0 0 ${M_PI}" />
        <parent link="base_link" />
        <child link="rear_bumper_extension_link" />
      </joint>
    </xacro:if>

131
132
    <xacro:if value="$(optenv HUSKY_TOP_PLATE_ENABLED true)">
      <!-- Spawn the top plate -->
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
      <xacro:if value="$(optenv HUSKY_LARGE_TOP_PLATE false)">
        <link name="top_plate_link">
          <visual>
            <origin xyz="0 0 0" rpy="0 0 0" />
            <geometry>
              <mesh filename="package://husky_description/meshes/large_top_plate.dae" />
            </geometry>
          </visual>
          <collision>
            <origin xyz="0 0 0" rpy="0 0 0"/>
            <geometry>
              <mesh filename="package://husky_description/meshes/large_top_plate_collision.stl" />
            </geometry>
          </collision>
        </link>
        <!-- Attach top plate -->
        <joint name="top_plate_joint" type="fixed">
          <parent link="base_link" />
          <child link="top_plate_link"/>
          <origin xyz="0.0812 0 0.225" rpy="0 0 0"/>
        </joint>
154
155
156
157
158
159
160
161
162
163
164
165
        <!-- Top plate front link -->
        <joint name="top_plate_front_joint" type="fixed">
          <parent link="top_plate_link" />
          <child link="top_plate_front_link"/>
          <origin xyz="0.4125 0 0.00672" rpy="0 0 0"/>
        </joint>
        <!-- Top plate rear link-->
        <joint name="top_plate_rear_joint" type="fixed">
          <parent link="top_plate_link" />
          <child link="top_plate_rear_link"/>
          <origin xyz="-0.4125 0 0.00672" rpy="0 0 0"/>
        </joint>
166
167
168
169
170
171
172
173
174
175
176
177
178
      </xacro:if>

      <xacro:unless value="$(optenv HUSKY_LARGE_TOP_PLATE false)">
        <link name="top_plate_link">
          <visual>
            <origin xyz="0 0 0" rpy="0 0 0" />
            <geometry>
              <mesh filename="package://husky_description/meshes/top_plate.dae" />
            </geometry>
          </visual>
          <collision>
            <origin xyz="0 0 0" rpy="0 0 0"/>
            <geometry>
179
              <mesh filename="package://husky_description/meshes/top_plate.stl" />
180
181
182
183
184
185
186
187
188
            </geometry>
          </collision>
        </link>
        <!-- Attach top plate -->
        <joint name="top_plate_joint" type="fixed">
          <parent link="base_link" />
          <child link="top_plate_link"/>
          <origin xyz="0.0812 0 0.245" rpy="0 0 0"/>
        </joint>
189
190
191
192
193
194
195
196
197
198
199
200
        <!-- Top plate front link -->
        <joint name="top_plate_front_joint" type="fixed">
          <parent link="top_plate_link" />
          <child link="top_plate_front_link"/>
          <origin xyz="0.36367 0 0.00639" rpy="0 0 0"/>
        </joint>
        <!-- Top plate rear link-->
        <joint name="top_plate_rear_joint" type="fixed">
          <parent link="top_plate_link" />
          <child link="top_plate_rear_link"/>
          <origin xyz="-0.36633 0 0.00639" rpy="0 0 0"/>
        </joint>
201
      </xacro:unless>
202
203
      <link name="top_plate_front_link"/>
      <link name="top_plate_rear_link"/>
204
    </xacro:if>
205
206
207
208

  </xacro:macro>

</robot>