Skip to content

Commit 0c02469

Browse files
committed
Iris: use merge include to work around joint state publisher issue
Signed-off-by: Rhys Mainwaring <rhys.mainwaring@me.com>
1 parent 89b95c3 commit 0c02469

1 file changed

Lines changed: 26 additions & 40 deletions

File tree

models/iris_with_gimbal/model.sdf

Lines changed: 26 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,21 @@
11
<?xml version='1.0'?>
22
<sdf version="1.9">
33
<model name="iris_with_gimbal">
4-
<include>
4+
<include merge="true">
55
<uri>model://iris_with_standoffs</uri>
6+
<name>iris</name>
7+
<pose degrees="true">0 0 0 0 0 0</pose>
68
</include>
79

8-
<include>
10+
<include merge="true">
911
<uri>model://gimbal_small_3d</uri>
1012
<name>gimbal</name>
1113
<pose degrees="true">0 -0.01 -0.124923 90 0 90</pose>
1214
</include>
1315

1416
<joint name="gimbal_joint" type="revolute">
15-
<parent>iris_with_standoffs::base_link</parent>
16-
<child>gimbal::base_link</child>
17+
<parent>base_link</parent>
18+
<child>gimbal_link</child>
1719
<axis>
1820
<limit>
1921
<lower>0</lower>
@@ -27,6 +29,7 @@
2729
<plugin filename="gz-sim-joint-state-publisher-system"
2830
name="gz::sim::systems::JointStatePublisher">
2931
</plugin>
32+
3033
<plugin filename="gz-sim-lift-drag-system"
3134
name="gz::sim::systems::LiftDrag">
3235
<a0>0.3</a0>
@@ -42,7 +45,7 @@
4245
<cp>0.084 0 0</cp>
4346
<forward>0 1 0</forward>
4447
<upward>0 0 1</upward>
45-
<link_name>iris_with_standoffs::rotor_0</link_name>
48+
<link_name>rotor_0</link_name>
4649
</plugin>
4750
<plugin filename="gz-sim-lift-drag-system"
4851
name="gz::sim::systems::LiftDrag">
@@ -59,7 +62,7 @@
5962
<cp>-0.084 0 0</cp>
6063
<forward>0 -1 0</forward>
6164
<upward>0 0 1</upward>
62-
<link_name>iris_with_standoffs::rotor_0</link_name>
65+
<link_name>rotor_0</link_name>
6366
</plugin>
6467

6568
<plugin filename="gz-sim-lift-drag-system"
@@ -77,7 +80,7 @@
7780
<cp>0.084 0 0</cp>
7881
<forward>0 1 0</forward>
7982
<upward>0 0 1</upward>
80-
<link_name>iris_with_standoffs::rotor_1</link_name>
83+
<link_name>rotor_1</link_name>
8184
</plugin>
8285
<plugin filename="gz-sim-lift-drag-system"
8386
name="gz::sim::systems::LiftDrag">
@@ -94,7 +97,7 @@
9497
<cp>-0.084 0 0</cp>
9598
<forward>0 -1 0</forward>
9699
<upward>0 0 1</upward>
97-
<link_name>iris_with_standoffs::rotor_1</link_name>
100+
<link_name>rotor_1</link_name>
98101
</plugin>
99102

100103
<plugin filename="gz-sim-lift-drag-system"
@@ -112,7 +115,7 @@
112115
<cp>0.084 0 0</cp>
113116
<forward>0 -1 0</forward>
114117
<upward>0 0 1</upward>
115-
<link_name>iris_with_standoffs::rotor_2</link_name>
118+
<link_name>rotor_2</link_name>
116119
</plugin>
117120
<plugin filename="gz-sim-lift-drag-system"
118121
name="gz::sim::systems::LiftDrag">
@@ -129,7 +132,7 @@
129132
<cp>-0.084 0 0</cp>
130133
<forward>0 1 0</forward>
131134
<upward>0 0 1</upward>
132-
<link_name>iris_with_standoffs::rotor_2</link_name>
135+
<link_name>rotor_2</link_name>
133136
</plugin>
134137

135138
<plugin filename="gz-sim-lift-drag-system"
@@ -147,7 +150,7 @@
147150
<cp>0.084 0 0</cp>
148151
<forward>0 -1 0</forward>
149152
<upward>0 0 1</upward>
150-
<link_name>iris_with_standoffs::rotor_3</link_name>
153+
<link_name>rotor_3</link_name>
151154
</plugin>
152155
<plugin filename="gz-sim-lift-drag-system"
153156
name="gz::sim::systems::LiftDrag">
@@ -164,24 +167,7 @@
164167
<cp>-0.084 0 0</cp>
165168
<forward>0 1 0</forward>
166169
<upward>0 0 1</upward>
167-
<link_name>iris_with_standoffs::rotor_3</link_name>
168-
</plugin>
169-
170-
<plugin filename="gz-sim-apply-joint-force-system"
171-
name="gz::sim::systems::ApplyJointForce">
172-
<joint_name>iris_with_standoffs::rotor_0_joint</joint_name>
173-
</plugin>
174-
<plugin filename="gz-sim-apply-joint-force-system"
175-
name="gz::sim::systems::ApplyJointForce">
176-
<joint_name>iris_with_standoffs::rotor_1_joint</joint_name>
177-
</plugin>
178-
<plugin filename="gz-sim-apply-joint-force-system"
179-
name="gz::sim::systems::ApplyJointForce">
180-
<joint_name>iris_with_standoffs::rotor_2_joint</joint_name>
181-
</plugin>
182-
<plugin filename="gz-sim-apply-joint-force-system"
183-
name="gz::sim::systems::ApplyJointForce">
184-
<joint_name>iris_with_standoffs::rotor_3_joint</joint_name>
170+
<link_name>rotor_3</link_name>
185171
</plugin>
186172

187173
<plugin name="ArduPilotPlugin"
@@ -199,7 +185,7 @@
199185
<gazeboXYZToNED degrees="true">0 0 0 180 0 90</gazeboXYZToNED>
200186

201187
<!-- Sensors -->
202-
<imuName>iris_with_standoffs::imu_link::imu_sensor</imuName>
188+
<imuName>imu_link::imu_sensor</imuName>
203189

204190
<!--
205191
incoming control command [0, 1]
@@ -209,7 +195,7 @@
209195
multiplier = 838 max rpm / 1 = 838
210196
-->
211197
<control channel="0">
212-
<jointName>iris_with_standoffs::rotor_0_joint</jointName>
198+
<jointName>rotor_0_joint</jointName>
213199
<useForce>1</useForce>
214200
<multiplier>838</multiplier>
215201
<offset>0</offset>
@@ -227,7 +213,7 @@
227213
</control>
228214

229215
<control channel="1">
230-
<jointName>iris_with_standoffs::rotor_1_joint</jointName>
216+
<jointName>rotor_1_joint</jointName>
231217
<useForce>1</useForce>
232218
<multiplier>838</multiplier>
233219
<offset>0</offset>
@@ -245,7 +231,7 @@
245231
</control>
246232

247233
<control channel="2">
248-
<jointName>iris_with_standoffs::rotor_2_joint</jointName>
234+
<jointName>rotor_2_joint</jointName>
249235
<useForce>1</useForce>
250236
<multiplier>-838</multiplier>
251237
<offset>0</offset>
@@ -263,7 +249,7 @@
263249
</control>
264250

265251
<control channel="3">
266-
<jointName>iris_with_standoffs::rotor_3_joint</jointName>
252+
<jointName>rotor_3_joint</jointName>
267253
<useForce>1</useForce>
268254
<multiplier>-838</multiplier>
269255
<offset>0</offset>
@@ -282,7 +268,7 @@
282268

283269
<!-- roll range is -30 to +30 deg -->
284270
<control channel="8">
285-
<jointName>gimbal::roll_joint</jointName>
271+
<jointName>roll_joint</jointName>
286272
<multiplier>1.047197551196</multiplier>
287273
<offset>-0.5</offset>
288274
<servo_min>1100</servo_min>
@@ -294,7 +280,7 @@
294280

295281
<!-- pitch range is -135 to +45 deg -->
296282
<control channel="9">
297-
<jointName>gimbal::pitch_joint</jointName>
283+
<jointName>pitch_joint</jointName>
298284
<multiplier>-3.14159265</multiplier>
299285
<offset>-0.75</offset>
300286
<servo_min>1100</servo_min>
@@ -306,7 +292,7 @@
306292

307293
<!-- yaw range is -160 to +160 deg -->
308294
<control channel="10">
309-
<jointName>gimbal::yaw_joint</jointName>
295+
<jointName>yaw_joint</jointName>
310296
<multiplier>-5.5850536</multiplier>
311297
<offset>-0.5</offset>
312298
<servo_min>1100</servo_min>
@@ -321,21 +307,21 @@
321307
<plugin
322308
filename="gz-sim-joint-position-controller-system"
323309
name="gz::sim::systems::JointPositionController">
324-
<joint_name>gimbal::roll_joint</joint_name>
310+
<joint_name>roll_joint</joint_name>
325311
<topic>/gimbal/cmd_roll</topic>
326312
<p_gain>2</p_gain>
327313
</plugin>
328314
<plugin
329315
filename="gz-sim-joint-position-controller-system"
330316
name="gz::sim::systems::JointPositionController">
331-
<joint_name>gimbal::pitch_joint</joint_name>
317+
<joint_name>pitch_joint</joint_name>
332318
<topic>/gimbal/cmd_pitch</topic>
333319
<p_gain>2</p_gain>
334320
</plugin>
335321
<plugin
336322
filename="gz-sim-joint-position-controller-system"
337323
name="gz::sim::systems::JointPositionController">
338-
<joint_name>gimbal::yaw_joint</joint_name>
324+
<joint_name>yaw_joint</joint_name>
339325
<topic>/gimbal/cmd_yaw</topic>
340326
<p_gain>2</p_gain>
341327
</plugin>

0 commit comments

Comments
 (0)