-
Notifications
You must be signed in to change notification settings - Fork 37
/
gen3_macro.xacro
496 lines (491 loc) · 17.2 KB
/
gen3_macro.xacro
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
<?xml version="1.0"?>
<robot name="gen3_arm" xmlns:xacro="http://ros.org/wiki/xacro">
<!-- Propagate last link name information because it is the gripper's parent link -->
<xacro:property name="last_arm_link" value="end_effector_link"/>
<xacro:property name="PI" value="3.1415926535897931"/>
<xacro:macro name="load_arm" params="
parent
dof
vision
prefix
*origin
robot_ip
username:=admin
password:=admin
port:=10000
port_realtime:=10001
session_inactivity_timeout_ms:=6000
connection_inactivity_timeout_ms:=2000
use_internal_bus_gripper_comm:=true
gripper_joint_name
gripper_max_velocity:=100.0
gripper_max_force:=100.0
use_fake_hardware:=false
fake_sensor_commands:=false
sim_gazebo:=false
sim_ignition:=false
sim_isaac:=false
isaac_joint_commands:=/isaac_joint_commands
isaac_joint_states:=/isaac_joint_states
use_external_cable:=false
initial_positions:=${dict(joint_1=0.0,joint_2=0.0,joint_3=0.0,joint_4=0.0,joint_5=0.0,joint_6=0.0,joint_7=0.0)}" >
<!-- ros2 control include -->
<xacro:include filename="$(find kortex_description)/arms/gen3/${dof}dof/urdf/kortex.ros2_control.xacro" />
<xacro:kortex_ros2_control
name="${prefix}KortexMultiInterfaceHardware" prefix="${prefix}"
use_fake_hardware="${use_fake_hardware}"
fake_sensor_commands="${fake_sensor_commands}"
sim_gazebo="${sim_gazebo}"
sim_ignition="${sim_ignition}"
sim_isaac="${sim_isaac}"
isaac_joint_commands="${isaac_joint_commands}"
isaac_joint_states="${isaac_joint_states}"
tf_prefix=""
initial_positions="${initial_positions}"
robot_ip="${robot_ip}"
username="${username}"
password="${password}"
port="${port}"
port_realtime="${port_realtime}"
session_inactivity_timeout_ms="${session_inactivity_timeout_ms}"
connection_inactivity_timeout_ms="${connection_inactivity_timeout_ms}"
use_internal_bus_gripper_comm="${use_internal_bus_gripper_comm}"
gripper_max_velocity="${gripper_max_velocity}"
gripper_max_force="${gripper_max_force}"
gripper_joint_name="${gripper_joint_name}"/>
<joint name="${prefix}base_joint" type="fixed">
<xacro:insert_block name="origin" />
<parent link="${parent}"/>
<child link="${prefix}base_link" />
</joint>
<link name="${prefix}base_link">
<inertial>
<origin xyz="-0.000648 -0.000166 0.084487" rpy="0 0 0" />
<mass value="1.697" />
<inertia ixx="0.004622" ixy="9E-06" ixz="6E-05" iyy="0.004495" iyz="9E-06" izz="0.002079" />
</inertial>
<visual>
<origin xyz="0 0 0" rpy="0 0 0" />
<geometry>
<mesh filename="file://$(find kortex_description)/arms/gen3/${dof}dof/meshes/base_link.dae" />
</geometry>
<material name="">
<color rgba="0.75294 0.75294 0.75294 1" />
</material>
</visual>
<collision>
<origin xyz="0 0 0" rpy="0 0 0" />
<geometry>
<mesh filename="file://$(find kortex_description)/arms/gen3/${dof}dof/meshes/base_link.dae" />
</geometry>
</collision>
</link>
<link name="${prefix}shoulder_link">
<inertial>
<origin xyz="-2.3E-05 -0.010364 -0.07336" rpy="0 0 0" />
<mass value="1.3773" />
<inertia ixx="0.00457" ixy="1E-06" ixz="2E-06" iyy="0.004831" iyz="0.000448" izz="0.001409" />
</inertial>
<visual>
<origin xyz="0 0 0" rpy="0 0 0" />
<geometry>
<mesh filename="file://$(find kortex_description)/arms/gen3/${dof}dof/meshes/shoulder_link.dae" />
</geometry>
<material name="">
<color rgba="0.75294 0.75294 0.75294 1" />
</material>
</visual>
<collision>
<origin xyz="0 0 0" rpy="0 0 0" />
<geometry>
<mesh filename="file://$(find kortex_description)/arms/gen3/${dof}dof/meshes/shoulder_link.dae" />
</geometry>
</collision>
</link>
<xacro:if value="${use_external_cable}">
<joint
name="${prefix}joint_1"
type="revolute">
<origin xyz="0 0 0.15643" rpy="3.1416 2.7629E-18 -4.9305E-36" />
<parent
link="${prefix}base_link" />
<child
link="${prefix}shoulder_link" />
<axis
xyz="0 0 1" />
<limit
lower="${-2*PI}"
upper="${2*PI}"
effort="39"
velocity="1.3963" />
</joint>
</xacro:if>
<xacro:unless value="${use_external_cable}">
<joint
name="${prefix}joint_1"
type="continuous">
<origin xyz="0 0 0.15643" rpy="3.1416 2.7629E-18 -4.9305E-36" />
<parent
link="${prefix}base_link" />
<child
link="${prefix}shoulder_link" />
<axis
xyz="0 0 1" />
<limit
effort="39"
velocity="1.3963" />
</joint>
</xacro:unless>
<link name="${prefix}half_arm_1_link">
<inertial>
<origin xyz="-4.4E-05 -0.09958 -0.013278" rpy="0 0 0" />
<mass value="1.1636" />
<inertia ixx="0.011088" ixy="5E-06" ixz="0" iyy="0.001072" iyz="-0.000691" izz="0.011255" />
</inertial>
<visual>
<origin xyz="0 0 0" rpy="0 0 0" />
<geometry>
<mesh filename="file://$(find kortex_description)/arms/gen3/${dof}dof/meshes/half_arm_1_link.dae" />
</geometry>
<material name="">
<color rgba="0.75294 0.75294 0.75294 1" />
</material>
</visual>
<collision>
<origin xyz="0 0 0" rpy="0 0 0" />
<geometry>
<mesh filename="file://$(find kortex_description)/arms/gen3/${dof}dof/meshes/half_arm_1_link.dae" />
</geometry>
</collision>
</link>
<joint
name="${prefix}joint_2"
type="revolute">
<origin xyz="0 0.005375 -0.12838" rpy="1.5708 2.1343E-17 -1.1102E-16" />
<parent
link="${prefix}shoulder_link" />
<child
link="${prefix}half_arm_1_link" />
<axis
xyz="0 0 1" />
<limit lower="-2.41" upper="2.41" effort="39" velocity="1.3963" />
</joint>
<link name="${prefix}half_arm_2_link">
<inertial>
<origin xyz="-4.4E-05 -0.006641 -0.117892" rpy="0 0 0" />
<mass value="1.1636" />
<inertia ixx="0.010932" ixy="0" ixz="-7E-06" iyy="0.011127" iyz="0.000606" izz="0.001043" />
</inertial>
<visual>
<origin xyz="0 0 0" rpy="0 0 0" />
<geometry>
<mesh filename="file://$(find kortex_description)/arms/gen3/${dof}dof/meshes/half_arm_2_link.dae" />
</geometry>
<material name="">
<color rgba="0.75294 0.75294 0.75294 1" />
</material>
</visual>
<collision>
<origin xyz="0 0 0" rpy="0 0 0" />
<geometry>
<mesh filename="file://$(find kortex_description)/arms/gen3/${dof}dof/meshes/half_arm_2_link.dae" />
</geometry>
</collision>
</link>
<xacro:if value="${use_external_cable}">
<joint
name="${prefix}joint_3"
type="revolute">
<origin xyz="0 -0.21038 -0.006375" rpy="-1.5708 1.2326E-32 -2.9122E-16" />
<parent
link="${prefix}half_arm_1_link" />
<child
link="${prefix}half_arm_2_link" />
<axis
xyz="0 0 1" />
<limit
lower="${-2*PI}"
upper="${2*PI}"
effort="39"
velocity="1.3963" />
</joint>
</xacro:if>
<xacro:unless value="${use_external_cable}">
<joint
name="${prefix}joint_3"
type="continuous">
<origin xyz="0 -0.21038 -0.006375" rpy="-1.5708 1.2326E-32 -2.9122E-16" />
<parent
link="${prefix}half_arm_1_link" />
<child
link="${prefix}half_arm_2_link" />
<axis
xyz="0 0 1" />
<limit
effort="39"
velocity="1.3963" />
</joint>
</xacro:unless>
<link name="${prefix}forearm_link">
<inertial>
<origin xyz="-1.8E-05 -0.075478 -0.015006" rpy="0 0 0" />
<mass value="0.9302" />
<inertia ixx="0.008147" ixy="-1E-06" ixz="0" iyy="0.000631" iyz="-0.0005" izz="0.008316" />
</inertial>
<visual>
<origin xyz="0 0 0" rpy="0 0 0" />
<geometry>
<mesh filename="file://$(find kortex_description)/arms/gen3/${dof}dof/meshes/forearm_link.dae" />
</geometry>
<material name="">
<color rgba="0.75294 0.75294 0.75294 1" />
</material>
</visual>
<collision>
<origin xyz="0 0 0" rpy="0 0 0" />
<geometry>
<mesh filename="file://$(find kortex_description)/arms/gen3/${dof}dof/meshes/forearm_link.dae" />
</geometry>
</collision>
</link>
<joint
name="${prefix}joint_4"
type="revolute">
<origin xyz="0 0.006375 -0.21038" rpy="1.5708 -6.6954E-17 -1.6653E-16" />
<parent
link="${prefix}half_arm_2_link" />
<child
link="${prefix}forearm_link" />
<axis
xyz="0 0 1" />
<limit lower="-2.66" upper="2.66" effort="39" velocity="1.3963" />
</joint>
<link name="${prefix}spherical_wrist_1_link">
<inertial>
<origin xyz="1E-06 -0.009432 -0.063883" rpy="0 0 0" />
<mass value="0.6781" />
<inertia ixx="0.001596" ixy="0" ixz="0" iyy="0.001607" iyz="0.000256" izz="0.000399" />
</inertial>
<visual>
<origin xyz="0 0 0" rpy="0 0 0" />
<geometry>
<mesh filename="file://$(find kortex_description)/arms/gen3/${dof}dof/meshes/spherical_wrist_1_link.dae" />
</geometry>
<material name="">
<color rgba="0.75294 0.75294 0.75294 1" />
</material>
</visual>
<collision>
<origin xyz="0 0 0" rpy="0 0 0" />
<geometry>
<mesh filename="file://$(find kortex_description)/arms/gen3/${dof}dof/meshes/spherical_wrist_1_link.dae" />
</geometry>
</collision>
</link>
<xacro:if value="${use_external_cable}">
<joint
name="${prefix}joint_5"
type="revolute">
<origin xyz="0 -0.20843 -0.006375" rpy="-1.5708 2.2204E-16 -6.373E-17" />
<parent
link="${prefix}forearm_link" />
<child
link="${prefix}spherical_wrist_1_link" />
<axis
xyz="0 0 1" />
<limit
lower="${-2*PI}"
upper="${2*PI}"
effort="9"
velocity="1.2218" />
</joint>
</xacro:if>
<xacro:unless value="${use_external_cable}">
<joint
name="${prefix}joint_5"
type="continuous">
<origin xyz="0 -0.20843 -0.006375" rpy="-1.5708 2.2204E-16 -6.373E-17" />
<parent
link="${prefix}forearm_link" />
<child
link="${prefix}spherical_wrist_1_link" />
<axis
xyz="0 0 1" />
<limit
effort="9"
velocity="1.2218" />
</joint>
</xacro:unless>
<link name="${prefix}spherical_wrist_2_link">
<inertial>
<origin xyz="1E-06 -0.045483 -0.00965" rpy="0 0 0" />
<mass value="0.6781" />
<inertia ixx="0.001641" ixy="0" ixz="0" iyy="0.00041" iyz="-0.000278" izz="0.001641" />
</inertial>
<visual>
<origin xyz="0 0 0" rpy="0 0 0" />
<geometry>
<mesh filename="file://$(find kortex_description)/arms/gen3/${dof}dof/meshes/spherical_wrist_2_link.dae" />
</geometry>
<material name="">
<color rgba="0.75294 0.75294 0.75294 1" />
</material>
</visual>
<collision>
<origin xyz="0 0 0" rpy="0 0 0" />
<geometry>
<mesh filename="file://$(find kortex_description)/arms/gen3/${dof}dof/meshes/spherical_wrist_2_link.dae" />
</geometry>
</collision>
</link>
<joint
name="${prefix}joint_6"
type="revolute">
<origin xyz="0 0.00017505 -0.10593" rpy="1.5708 9.2076E-28 -8.2157E-15" />
<parent
link="${prefix}spherical_wrist_1_link" />
<child
link="${prefix}spherical_wrist_2_link" />
<axis
xyz="0 0 1" />
<limit lower="-2.23" upper="2.23" effort="9" velocity="1.2218" />
</joint>
<xacro:if value="${vision}">
<link name="${prefix}bracelet_link">
<inertial>
<origin xyz="0.000281 0.011402 -0.029798" rpy="0 0 0" />
<mass value="0.5" />
<inertia ixx="0.000587" ixy="3E-06" ixz="3E-06" iyy="0.000369" iyz="-0.000118" izz="0.000609" />
</inertial>
<visual>
<origin xyz="0 0 0" rpy="0 0 0" />
<geometry>
<mesh filename="file://$(find kortex_description)/arms/gen3/${dof}dof/meshes/bracelet_with_vision_link.dae" />
</geometry>
<material name="">
<color rgba="0.75294 0.75294 0.75294 1" />
</material>
</visual>
<collision>
<origin xyz="0 0 0" rpy="0 0 0" />
<geometry>
<mesh filename="file://$(find kortex_description)/arms/gen3/${dof}dof/meshes/bracelet_with_vision_link.dae" />
</geometry>
</collision>
</link>
</xacro:if>
<xacro:unless value="${vision}">
<link name="${prefix}bracelet_link">
<inertial>
<origin xyz="-9.3E-05 0.000132 -0.022905" rpy="0 0 0" />
<mass value="0.364" />
<inertia ixx="0.000214" ixy="0" ixz="1E-06" iyy="0.000223" iyz="-2E-06" izz="0.00024" />
</inertial>
<visual>
<origin xyz="0 0 0" rpy="0 0 0" />
<geometry>
<mesh filename="file://$(find kortex_description)/arms/gen3/${dof}dof/meshes/bracelet_no_vision_link.dae" />
</geometry>
<material name="">
<color rgba="0.75294 0.75294 0.75294 1" />
</material>
</visual>
<collision>
<origin xyz="0 0 0" rpy="0 0 0" />
<geometry>
<mesh filename="file://$(find kortex_description)/arms/gen3/${dof}dof/meshes/bracelet_no_vision_link.dae" />
</geometry>
</collision>
</link>
</xacro:unless>
<xacro:if value="${use_external_cable}">
<joint
name="${prefix}joint_7"
type="revolute">
<origin xyz="0 -0.10593 -0.00017505" rpy="-1.5708 -5.5511E-17 9.6396E-17" />
<parent
link="${prefix}spherical_wrist_2_link" />
<child
link="${prefix}bracelet_link" />
<axis
xyz="0 0 1" />
<limit
lower="${-2*PI}"
upper="${2*PI}"
effort="9"
velocity="1.2218" />
</joint>
</xacro:if>
<xacro:unless value="${use_external_cable}">
<joint
name="${prefix}joint_7"
type="continuous">
<origin xyz="0 -0.10593 -0.00017505" rpy="-1.5708 -5.5511E-17 9.6396E-17" />
<parent
link="${prefix}spherical_wrist_2_link" />
<child
link="${prefix}bracelet_link" />
<axis
xyz="0 0 1" />
<limit
effort="9"
velocity="1.2218" />
</joint>
</xacro:unless>
<link name="${prefix}end_effector_link" />
<joint
name="${prefix}end_effector"
type="fixed">
<origin xyz="0 0 -0.0615250000000001" rpy="3.14159265358979 1.09937075168372E-32 0" />
<parent
link="${prefix}bracelet_link" />
<child
link="${prefix}end_effector_link" />
<axis
xyz="0 0 0" />
</joint>
<xacro:if value="${vision}">
<!-- sim camera needs to be rotated which might not apply to built in vision module -->
<xacro:if value="${sim_ignition}">
<link name="${prefix}camera_link" />
<joint name="${prefix}camera_module" type="fixed">
<origin xyz="0 0.05639 0.01305" rpy="0 ${-PI/2} ${-PI/2}" />
<parent link="${prefix}end_effector_link" />
<child link="${prefix}camera_link" />
</joint>
<link name="${prefix}camera_depth_frame" />
<joint name="${prefix}depth_module" type="fixed">
<origin xyz="0.0275 0.066 0.01305" rpy="0 ${-PI/2} ${-PI/2}" />
<parent link="${prefix}end_effector_link" />
<child link="${prefix}camera_depth_frame" />
</joint>
<link name="${prefix}camera_color_frame" />
<joint name="${prefix}color_module" type="fixed">
<origin xyz="0 0.05639 0.01305" rpy="0 ${-PI/2} ${-PI/2}" />
<parent link="${prefix}end_effector_link" />
<child link="${prefix}camera_color_frame" />
</joint>
</xacro:if>
<xacro:unless value="${sim_ignition}">
<link name="${prefix}camera_link" />
<joint name="${prefix}camera_module" type="fixed">
<origin xyz="0 0.05639 -0.00305" rpy="${PI} ${PI} 0" />
<parent link="${prefix}end_effector_link" />
<child link="${prefix}camera_link" />
</joint>
<link name="${prefix}camera_depth_frame" />
<joint name="${prefix}depth_module" type="fixed">
<origin xyz="0.0275 0.066 -0.00305" rpy="${PI} ${PI} 0" />
<parent link="${prefix}end_effector_link" />
<child link="${prefix}camera_depth_frame" />
</joint>
<link name="${prefix}camera_color_frame" />
<joint name="${prefix}color_module" type="fixed">
<origin xyz="0 0.05639 -0.00305" rpy="${PI} ${PI} 0" />
<parent link="${prefix}end_effector_link" />
<child link="${prefix}camera_color_frame" />
</joint>
</xacro:unless>
</xacro:if>
</xacro:macro>
</robot>