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.18 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="1.0" ixy="0.0" ixz="0.0" iyy="1.0" iyz="0.0" izz="1.0"/>
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.0408/2}" 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.0" 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.005" ixy="0" ixz="0" iyy="0.005" iyz="0" izz="0.005"/>
165 <gazebo reference="${pos}_${side}_wheel">
168 <kp value="1000000.0" />
170 <fdir1 value="1 0 0"/>
173 <joint name="${pos}_${side}_wheel_joint" type="continuous">
174 <parent link="base_link"/>
175 <child link="${pos}_${side}_wheel"/>
177 <origin xyz="${xyz}" rpy="${rpy}"/>
180 <transmission name="${pos}_${side}_wheel_trans" type="SimpleTransmission">
181 <type>transmission_interface/SimpleTransmission</type>
182 <joint name="${pos}_${side}_wheel_joint">
183 <hardwareInterface>VelocityJointInterface</hardwareInterface>
185 <actuator name="{pos}_${side}_wheel_motor">
186 <mechanicalReduction>1</mechanicalReduction>
191 <xacro:wheel pos="rear" side="left" xyz="-0.07525 0.12 -0.025" rpy="${-5*PI/180} 0 0" />
192 <xacro:wheel pos="rear" side="right" xyz="-0.07525 -0.12 -0.025" rpy="${5*PI/180} 0 0" />
193 <xacro:wheel pos="front" side="left" xyz=" 0.07525 0.12 -0.025" rpy="${-5*PI/180} 0 0" />
194 <xacro:wheel pos="front" side="right" xyz=" 0.07525 -0.12 -0.025" rpy="${5*PI/180} 0 0" />
197 <plugin name="gazebo_ros_control" filename="libgazebo_ros_control.so">
198 <robotNamespace>/</robotNamespace>
199 <robotSimType>gazebo_ros_control/DefaultRobotHWSim</robotSimType>
202 <plugin name="imu_controller" filename="libgazebo_ros_imu.so">
203 <alwaysOn>true</alwaysOn>
204 <updateRate>20.0</updateRate>
205 <bodyName>base_imu_link</bodyName>
206 <topicName>imu</topicName>
207 <gaussianNoise>0.05</gaussianNoise>
208 <frameName>base_imu_link</frameName>
209 <xyzOffsets>0 0 0</xyzOffsets>
210 <rpyOffset>0 0 0</rpyOffset>
211 <serviceName>/default_imu</serviceName>
215 <xacro:macro name="range_sensor" params="name ros_topic update_rate minRange maxRange fov radiation">
216 <gazebo reference="${name}">
217 <sensor type="ray" name="${name}_sensor">
218 <pose>0 0 0 0 0 0</pose>
219 <update_rate>${update_rate}</update_rate>
220 <visualize>false</visualize>
225 <resolution>1</resolution>
226 <min_angle>-${fov/2}</min_angle>
227 <max_angle>${fov/2}</max_angle>
231 <resolution>1</resolution>
232 <min_angle>-${fov/2}</min_angle>
233 <max_angle>${fov/2}</max_angle>
237 <min>${minRange}</min>
238 <max>${maxRange}</max>
239 <resolution>0.01</resolution>
242 <plugin filename="libgazebo_ros_range.so" name="gazebo_ros_range">
243 <gaussianNoise>0.005</gaussianNoise>
244 <alwaysOn>true</alwaysOn>
245 <updateRate>${update_rate}</updateRate>
246 <topicName>${ros_topic}</topicName>
247 <frameName>${name}</frameName>
249 <radiation>${radiation}</radiation>
255 <xacro:range_sensor name="sonar_forward" ros_topic="range_forward" update_rate="10" minRange="0.04" maxRange="0.5" fov="${20*PI/180}" radiation="ultrasound" />
256 <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" />
257 <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" />
258 <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" />