Skip to content

Commit dd941d5

Browse files
committed
Make IMU dimension specific
1 parent 80e4862 commit dd941d5

File tree

3 files changed

+14
-21
lines changed

3 files changed

+14
-21
lines changed

common_xacro/urdf/sensor/imu.xacro

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,15 @@
11
<?xml version="1.0"?>
22

3-
<!-- Brief: Standard IMU -->
3+
<!-- Brief: IMU -->
44
<!-- Shape, Collision, Inertia: Box with relevant collision and constant inertia -->
55
<!-- Mounting Location: Bottom center of the IMU -->
66
<!-- Joint Type: fixed -->
77
<!-- Plugin: libgazebo_ros_imu_sensor.so -->
88
<!-- Param name: the name of the IMU. Published topic is /{name}_controller/out -->
9-
<!-- Param mass: mass of the IMU -->
10-
<!-- Param length: length of the IMU -->
11-
<!-- Param width: width of the IMU -->
12-
<!-- Param height: height of the IMU -->
139
<!-- Param parent: name of the parent link, defaulted to base_link -->
1410
<!-- Param joint_origin: location of the IMU relative to parent link -->
1511
<robot xmlns:xacro="http://ros.org/wiki/xacro" name="caster">
16-
<xacro:macro name="imu" params="name mass length width height parent:=base_link *joint_origin">
12+
<xacro:macro name="imu" params="name parent:=base_link *joint_origin">
1713
<!-- Includes -->
1814
<xacro:include filename="$(find common_xacro)/urdf/physics/inertia.xacro"/>
1915

@@ -30,27 +26,27 @@
3026

3127
<!-- Imu link -->
3228
<link name="${name}_link">
33-
<xacro:box_inertia mass="${mass}" length="${length}" width="${width}" height="${height}">
29+
<xacro:box_inertia mass="0.025" length="0.05" width="0.03" height="0.01">
3430
<origin xyz="0 0 0" rpy="0 0 0" />
3531
</xacro:box_inertia>
3632

3733
<visual>
3834
<origin xyz="0 0 0" rpy="0 0 0"/>
3935
<geometry>
40-
<box size="${length} ${width} ${height}"/>
36+
<box size="0.05 0.03 0.01"/>
4137
</geometry>
4238
</visual>
4339

4440
<collision>
4541
<origin xyz="0 0 0" rpy="0 0 0"/>
4642
<geometry>
47-
<box size="${length} ${width} ${height}"/>
43+
<box size="0.05 0.03 0.01"/>
4844
</geometry>
4945
</collision>
5046
</link>
5147

5248
<joint name="${name}_joint" type="fixed">
53-
<origin xyz="0 0 ${height/2}" rpy="0 0 0"/>
49+
<origin xyz="0 0 0.005" rpy="0 0 0"/>
5450
<parent link="${name}_base_link" />
5551
<child link="${name}_link" />
5652
</joint>

marvin_simulation/urdf/constants.xacro

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -28,30 +28,27 @@
2828

2929
<!-- Caster Constants -->
3030
<xacro:property name="caster_x_offset" value="${-24.625*0.0254}" />
31+
3132
<xacro:property name="caster_radius" value="${3.5*0.0254}" />
3233
<xacro:property name="caster_mass" value="0.1" />
3334

3435
<!-- Wheel Constants -->
36+
<xacro:property name="track_width" value="${31*0.0254}" />
37+
3538
<xacro:property name="wheel_radius" value="${6.1875*0.0254}" />
3639
<xacro:property name="wheel_width" value="${4*0.0254}" />
3740
<xacro:property name="wheel_mass" value="5" />
38-
<xacro:property name="track_width" value="${31*0.0254}" />
3941

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

4345
<!-- Camera Constants -->
46+
<xacro:property name="camera_x_offset" value="${(4+2.66916)*0.0254}"/>
47+
<xacro:property name="camera_z_offset" value="${(31-1.80395)*0.0254}"/>
48+
<xacro:property name="camera_angle" value="${10 * 0.01745327777}"/>
49+
4450
<xacro:property name="camera_mass" value="0.230"/>
4551
<xacro:property name="camera_length" value="0.04310"/>
4652
<xacro:property name="camera_width" value="0.17525"/>
4753
<xacro:property name="camera_height" value="0.03025"/>
48-
<xacro:property name="camera_angle" value="${10 * 0.01745327777}"/>
49-
<xacro:property name="camera_x_offset" value="${(4+2.66916)*0.0254}"/>
50-
<xacro:property name="camera_z_offset" value="${(31-1.80395)*0.0254}"/>
51-
52-
<!-- IMU Constants -->
53-
<xacro:property name="imu_mass" value="0.025"/>
54-
<xacro:property name="imu_length" value="0.05"/>
55-
<xacro:property name="imu_width" value="0.03"/>
56-
<xacro:property name="imu_height" value="0.01"/>
5754
</robot>

marvin_simulation/urdf/marvin.xacro

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@
5555

5656
<!-- IMU -->
5757
<xacro:include filename="$(find common_xacro)/urdf/sensor/imu.xacro" />
58-
<xacro:imu name="imu" mass="${imu_mass}" length="${imu_length}" width="${imu_width}" height="${imu_height}">
58+
<xacro:imu name="imu">
5959
<origin xyz="${-chassis_tower_length / 2 - chassis_electrical_length/2} 0 ${chassis_electrical_height}" rpy="0 0 0" />
6060
</xacro:imu>
6161

0 commit comments

Comments
 (0)