decorations.urdf.xacro 6.4 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_bumper_extend" value="$(optenv HUSKY_FORWARD_BUMPER_EXTEND 0)" />

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

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

TheDash's avatar
TheDash committed
48
    <!-- Spawn user rails -->
49
    <link name="user_rail_link">
50
51
      <visual>
        <geometry>
52
          <mesh filename="package://husky_description/meshes/user_rail.dae" />
53
54
55
        </geometry>
      </visual>
    </link>
TheDash's avatar
TheDash committed
56
57

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

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

    <!-- Attach front bumper -->
74
    <joint name="front_bumper" type="fixed">
75
      <origin xyz="${0.48 + husky_bumper_extend / 100.0} 0 0.091" rpy="0 0 0" />
76
      <parent link="base_link" />
77
      <child link="front_bumper_link" />
78
79
    </joint>

80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
    <xacro:if value="${husky_bumper_extend}">
      <link name="front_bumper_extension_link">
          <visual>
              <geometry>
                  <mesh filename="package://husky_description/meshes/bumper_extension.dae" scale="${husky_bumper_extend} 1 1"/>
              </geometry>
          </visual>
      </link>

      <joint name="front_bumper_extension" type="fixed">
        <origin xyz="${0.405 + husky_bumper_extend / 200.0} 0 0.091" rpy="0 0 0" />
        <parent link="base_link" />
        <child link="front_bumper_extension_link" />
      </joint>
    </xacro:if>

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

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

112
113
    <xacro:if value="$(optenv HUSKY_TOP_PLATE_ENABLED true)">
      <!-- Spawn the top plate -->
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
      <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>
          <collision>
            <!-- Extra collision tag for widgets on top plate -->
            <geometry>
              <box size="0.32 0.41 0.09" rpy="0 0 0"/>
            </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>
      </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>
              <mesh filename="package://husky_description/meshes/top_plate.dae" />
            </geometry>
          </collision>
          <collision>
            <!-- Extra collision tag for widgets on top plate -->
            <geometry>
              <box size="0.32 0.41 0.09" rpy="0 0 0"/>
            </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>
      </xacro:unless>

173
    </xacro:if>
174
175
176
177

  </xacro:macro>

</robot>