Skip to content

Commit cc1fc80

Browse files
committed
Add base parameter to Ouster URDF
1 parent 4c9fefe commit cc1fc80

File tree

1 file changed

+43
-30
lines changed

1 file changed

+43
-30
lines changed

clearpath_sensors_description/urdf/ouster_os1.urdf.xacro

Lines changed: 43 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
name
2222
parent_link
2323
cap:=halo
24+
base:=base
2425
*origin
2526
samples_h:=1024 min_ang_h:=${-pi} max_ang_h:=${pi}
2627
samples_v:=64 min_ang_v:=${-21.2 * pi/180} max_ang_v:=${21.2 * pi/180}
@@ -32,9 +33,16 @@
3233
<xacro:property name="lidar_height" value="0.05835"/>
3334
<xacro:property name="lidar_diameter" value="0.087"/>
3435

35-
<xacro:property name="base_mass" value="0."/>
36-
<xacro:property name="base_height" value="0.0225"/>
37-
<xacro:property name="base_length" value="0.110"/>
36+
<xacro:if value="${base == 'base'}">
37+
<xacro:property name="base_mass" value="0.0"/>
38+
<xacro:property name="base_height" value="0.0225"/>
39+
<xacro:property name="base_length" value="0.110"/>
40+
</xacro:if>
41+
<xacro:unless value="${base == 'base'}">
42+
<xacro:property name="base_mass" value="0.0"/>
43+
<xacro:property name="base_height" value="0.0"/>
44+
<xacro:property name="base_length" value="0.0"/>
45+
</xacro:unless>
3846

3947
<xacro:property name="fins_mass" value="0.079"/>
4048
<xacro:property name="fins_height" value="0.022"/>
@@ -46,33 +54,38 @@
4654

4755

4856
<!-- Base Link -->
49-
<link name="${name}_base_link">
50-
<inertial>
51-
<mass value="${base_mass}"/>
52-
<origin xyz="0 0 ${base_height/2}"/>
53-
<xacro:ouster_box_inertia
54-
mass="${base_mass}"
55-
x="${base_length}"
56-
y="${base_length}"
57-
z="${base_height}"
58-
/>
59-
</inertial>
60-
<visual>
61-
<material name="ouster_grey">
62-
<color rgba="0.8 0.8 0.8 1.0"/>
63-
</material>
64-
<origin xyz="0 0 ${base_height}"/>
65-
<geometry>
66-
<mesh filename="package://clearpath_sensors_description/meshes/ouster/os1_base.dae"/>
67-
</geometry>
68-
</visual>
69-
<collision>
70-
<origin xyz="0 0 ${base_height/2}"/>
71-
<geometry>
72-
<box size="${base_length} ${base_length} ${base_height}"/>
73-
</geometry>
74-
</collision>
75-
</link>
57+
<xacro:if value="${base == 'base'}">
58+
<link name="${name}_base_link">
59+
<inertial>
60+
<mass value="${base_mass}"/>
61+
<origin xyz="0 0 ${base_height/2}"/>
62+
<xacro:ouster_box_inertia
63+
mass="${base_mass}"
64+
x="${base_length}"
65+
y="${base_length}"
66+
z="${base_height}"
67+
/>
68+
</inertial>
69+
<visual>
70+
<material name="ouster_grey">
71+
<color rgba="0.8 0.8 0.8 1.0"/>
72+
</material>
73+
<origin xyz="0 0 ${base_height}"/>
74+
<geometry>
75+
<mesh filename="package://clearpath_sensors_description/meshes/ouster/os1_base.dae"/>
76+
</geometry>
77+
</visual>
78+
<collision>
79+
<origin xyz="0 0 ${base_height/2}"/>
80+
<geometry>
81+
<box size="${base_length} ${base_length} ${base_height}"/>
82+
</geometry>
83+
</collision>
84+
</link>
85+
</xacro:if>
86+
<xacro:unless value="${base == 'base'}">
87+
<link name="${name}_base_link" />
88+
</xacro:unless>
7689

7790
<!-- Lidar Link -->
7891
<link name="${name}_link">

0 commit comments

Comments
 (0)