2 <robot name="wild_thumper" xmlns:xacro="http://ros.org/wiki/xacro">
3 <xacro:property name="PI" value="3.1415926535897931" />
5 <link name="base_footprint">
8 <box size="0.28 0.31 0.000001"/>
10 <material name="grey">
11 <color rgba="0.5 0.5 0.5 0.5"/>
16 <link name="base_link">
19 <box size="0.23 0.12 0.09"/>
23 <origin xyz="-0.00275 0 0" rpy="0 0 0"/>
25 <mesh filename="package://wild_thumper/meshes/wild_thumper_4wd.stl" />
29 <origin xyz="-0.00275 0 -0.02" rpy="0 0 0"/>
31 <inertia ixx="0.012708" ixy="0.0" ixz="0.0" iyy="0.0084375" iyz="0.0" izz="0.017771"/>
35 <link name="base_imu_link">
38 <box size="0.041 0.028 0.002"/>
41 <color rgba="1 0 0 1"/>
46 <link name="mounting_plate">
49 <box size="0.23 0.12 0.001"/>
57 <mesh filename="package://wild_thumper/meshes/rplidar_a2.stl" scale="0.001 0.001 0.001"/>
59 <origin xyz="0.0 0.0 0" rpy="0 0 0"/>
60 <material name="black">
61 <color rgba="0 0 0 1"/>
66 <link name="sonar_forward_left">
69 <box size="0.016 0.044 0.02"/>
71 <origin xyz="${0.016/2} 0 0" rpy="0 0 0"/>
72 <material name="green">
73 <color rgba="0 1 0 0.8"/>
78 <link name="sonar_forward_right">
81 <box size="0.016 0.044 0.02"/>
83 <origin xyz="${0.016/2} 0 0" rpy="0 0 0"/>
84 <material name="green">
85 <color rgba="0 1 0 0.8"/>
90 <link name="sonar_backward">
93 <box size="0.016 0.044 0.02"/>
95 <origin xyz="${0.016/2} 0 0" rpy="0 0 0"/>
96 <material name="green">
97 <color rgba="0 1 0 0.8"/>
102 <joint name="base_link_joint" type="fixed">
103 <parent link="base_footprint"/>
104 <child link="base_link"/>
105 <origin xyz="0.0 0.0 0.082" rpy="0 0 0"/>
108 <joint name="mounting_plate_joint" type="fixed">
109 <parent link="base_link"/>
110 <child link="mounting_plate"/>
111 <origin xyz="0.0 0.0 0.044" rpy="0 0 0"/>
114 <joint name="imu_joint" type="fixed">
115 <parent link="mounting_plate"/>
116 <child link="base_imu_link"/>
117 <origin xyz="0.06 -0.03 0.058" rpy="0 0 0"/>
120 <joint name="sonar_forward_left_joint" type="fixed">
121 <parent link="mounting_plate"/>
122 <child link="sonar_forward_left"/>
123 <origin xyz="0.115 0.05 -0.012" rpy="0 ${-5*PI/180} 0"/>
126 <joint name="sonar_forward_right_joint" type="fixed">
127 <parent link="mounting_plate"/>
128 <child link="sonar_forward_right"/>
129 <origin xyz="0.115 -0.05 -0.012" rpy="0 ${-5*PI/180} 0"/>
132 <joint name="sonar_backward_joint" type="fixed">
133 <parent link="mounting_plate"/>
134 <child link="sonar_backward"/>
135 <origin xyz="-0.115 0.0 -0.012" rpy="0 ${-175*PI/180} 0"/>
138 <joint name="lidar_joint" type="fixed">
139 <parent link="mounting_plate"/>
140 <child link="lidar"/>
141 <origin xyz="0.075 0.01 ${0.0408/2}" rpy="0 0 ${-110*PI/180}"/>
144 <xacro:macro name="wheel" params="pos side xyz rpy">
145 <link name="${pos}_${side}_wheel">
147 <origin xyz="0 0 0" rpy="0 0 0"/>
149 <mesh filename="package://wild_thumper/meshes/wheel_${side}.stl" />
153 <origin xyz="0 0 0" rpy="${PI/2} 0 0"/>
155 <cylinder radius="0.06" length="0.06"/>
159 <origin xyz="0 0 0" rpy="0 0 0"/>
161 <inertia ixx="0.00024" ixy="0" ixz="0" iyy="0.00036" iyz="0" izz="0.00024"/>
165 <gazebo reference="${pos}_${side}_wheel">
168 <kp value="1000000.0" />
170 <fdir1 value="0 1 0"/>
171 <minDepth>0.005</minDepth>
174 <joint name="${pos}_${side}_wheel_joint" type="continuous">
175 <parent link="base_link"/>
176 <child link="${pos}_${side}_wheel"/>
178 <origin xyz="${xyz}" rpy="${rpy}"/>
181 <transmission name="${pos}_${side}_wheel_trans" type="SimpleTransmission">
182 <type>transmission_interface/SimpleTransmission</type>
183 <joint name="${pos}_${side}_wheel_joint">
184 <hardwareInterface>VelocityJointInterface</hardwareInterface>
186 <actuator name="{pos}_${side}_wheel_motor">
187 <mechanicalReduction>1</mechanicalReduction>
192 <xacro:wheel pos="rear" side="left" xyz="-0.07525 0.12 -0.025" rpy="${-5*PI/180} 0 0" />
193 <xacro:wheel pos="rear" side="right" xyz="-0.07525 -0.12 -0.025" rpy="${5*PI/180} 0 0" />
194 <xacro:wheel pos="front" side="left" xyz=" 0.07525 0.12 -0.025" rpy="${-5*PI/180} 0 0" />
195 <xacro:wheel pos="front" side="right" xyz=" 0.07525 -0.12 -0.025" rpy="${5*PI/180} 0 0" />
198 <plugin name="gazebo_ros_control" filename="libgazebo_ros_control.so">
199 <robotNamespace>/</robotNamespace>
200 <robotSimType>gazebo_ros_control/DefaultRobotHWSim</robotSimType>
203 <plugin name="imu_controller" filename="libgazebo_ros_imu.so">
204 <alwaysOn>true</alwaysOn>
205 <updateRate>20.0</updateRate>
206 <bodyName>base_imu_link</bodyName>
207 <topicName>imu</topicName>
208 <gaussianNoise>0.05</gaussianNoise>
209 <frameName>base_imu_link</frameName>
210 <xyzOffsets>0 0 0</xyzOffsets>
211 <rpyOffset>0 0 0</rpyOffset>
212 <serviceName>/default_imu</serviceName>
216 <xacro:macro name="range_sensor" params="name ros_topic update_rate minRange maxRange fov radiation">
217 <gazebo reference="${name}">
218 <sensor type="ray" name="${name}_sensor">
219 <pose>0 0 0 0 0 0</pose>
220 <update_rate>${update_rate}</update_rate>
221 <visualize>false</visualize>
226 <resolution>1</resolution>
227 <min_angle>-${fov/2}</min_angle>
228 <max_angle>${fov/2}</max_angle>
232 <resolution>1</resolution>
233 <min_angle>-${fov/2}</min_angle>
234 <max_angle>${fov/2}</max_angle>
238 <min>${minRange}</min>
239 <max>${maxRange}</max>
240 <resolution>0.01</resolution>
243 <plugin filename="libgazebo_ros_range.so" name="gazebo_ros_range">
244 <gaussianNoise>0.005</gaussianNoise>
245 <alwaysOn>true</alwaysOn>
246 <updateRate>${update_rate}</updateRate>
247 <topicName>${ros_topic}</topicName>
248 <frameName>${name}</frameName>
250 <radiation>${radiation}</radiation>
256 <xacro:range_sensor name="sonar_forward_left" ros_topic="range_forward_left" update_rate="10" minRange="0.04" maxRange="0.5" fov="${20*PI/180}" radiation="ultrasound" />
257 <xacro:range_sensor name="sonar_forward_right" ros_topic="range_forward_right" update_rate="10" minRange="0.04" maxRange="0.5" fov="${20*PI/180}" radiation="ultrasound" />
258 <xacro:range_sensor name="sonar_backward" ros_topic="range_backward" update_rate="10" minRange="0.04" maxRange="0.5" fov="${20*PI/180}" radiation="ultrasound" />
259 <xacro:range_sensor name="ir_left" ros_topic="range_left" update_rate="10" minRange="0.04" maxRange="0.3" fov="${5*PI/180}" radiation="infrared" />
260 <xacro:range_sensor name="ir_right" ros_topic="range_right" update_rate="10" minRange="0.04" maxRange="0.3" fov="${5*PI/180}" radiation="infrared" />
262 <gazebo reference="lidar">
263 <sensor type="ray" name="head_rplidar_a2_sensor">
264 <pose>0 0 0 0 0 0</pose>
265 <visualize>false</visualize>
266 <update_rate>12</update_rate>
270 <samples>360</samples>
271 <resolution>1</resolution>
272 <min_angle>-3.12413907051</min_angle>
273 <max_angle>3.14159274101</max_angle>
279 <resolution>0.01</resolution>
282 <type>gaussian</type>
284 <stddev>0.01</stddev>
287 <plugin name="gazebo_ros_head_rplidar_a2_controller" filename="libgazebo_ros_laser.so">
288 <topicName>/scan</topicName>
289 <frameName>lidar</frameName>