forked from isaac-sim/IsaacLab
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathunitree.py
More file actions
815 lines (776 loc) · 28.8 KB
/
Copy pathunitree.py
File metadata and controls
815 lines (776 loc) · 28.8 KB
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
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
# Copyright (c) 2022-2026, The Isaac Lab Project Developers (https://github.com/isaac-sim/IsaacLab/blob/main/CONTRIBUTORS.md).
# All rights reserved.
#
# SPDX-License-Identifier: BSD-3-Clause
"""Configuration for Unitree robots.
The following configurations are available:
* :obj:`UNITREE_A1_CFG`: Unitree A1 robot with DC motor model for the legs
* :obj:`UNITREE_GO1_CFG`: Unitree Go1 robot with actuator net model for the legs
* :obj:`UNITREE_GO2_CFG`: Unitree Go2 robot with DC motor model for the legs
* :obj:`H1_CFG`: H1 humanoid robot
* :obj:`H1_MINIMAL_CFG`: H1 humanoid robot with minimal collision bodies
* :obj:`G1_CFG`: G1 humanoid robot
* :obj:`G1_MINIMAL_CFG`: G1 humanoid robot with minimal collision bodies
* :obj:`G1_29DOF_CFG`: G1 humanoid robot configured for locomanipulation tasks
* :obj:`G1_INSPIRE_FTP_CFG`: G1 29DOF humanoid robot with Inspire 5-finger hand
Reference: https://github.com/unitreerobotics/unitree_ros
"""
import isaaclab.sim as sim_utils
from isaaclab.actuators import ActuatorNetMLPCfg, DCMotorCfg, IdealPDActuatorCfg, ImplicitActuatorCfg
from isaaclab.assets.articulation import ArticulationCfg
from isaaclab.utils.assets import ISAAC_NUCLEUS_DIR, ISAACLAB_NUCLEUS_DIR
HEALTHCARE_S3 = "https://omniverse-content-production.s3-us-west-2.amazonaws.com/Assets/Isaac/Healthcare/0.5.0/132c82d"
##
# Configuration - Actuators.
##
GO1_ACTUATOR_CFG = ActuatorNetMLPCfg(
joint_names_expr=[".*_hip_joint", ".*_thigh_joint", ".*_calf_joint"],
network_file=f"{ISAACLAB_NUCLEUS_DIR}/ActuatorNets/Unitree/unitree_go1.pt",
pos_scale=-1.0,
vel_scale=1.0,
torque_scale=1.0,
input_order="pos_vel",
input_idx=[0, 1, 2],
# the calf sits behind an extra 1.5:1 knee reduction, so its joint-side torque is higher
# and its joint-side speed lower than the hip and thigh. Values match ``go1.usd``.
actuator_effort_limit={".*_hip_joint": 23.7, ".*_thigh_joint": 23.7, ".*_calf_joint": 35.55},
actuator_velocity_limit={".*_hip_joint": 30.1, ".*_thigh_joint": 30.1, ".*_calf_joint": 20.06},
saturation_effort={".*_hip_joint": 23.7, ".*_thigh_joint": 23.7, ".*_calf_joint": 35.55},
)
"""Configuration of Go1 actuators using MLP model.
Actuator specifications: https://shop.unitree.com/products/go1-motor
This model is taken from: https://github.com/Improbable-AI/walk-these-ways
"""
##
# Configuration
##
UNITREE_A1_CFG = ArticulationCfg(
spawn=sim_utils.UsdFileCfg(
usd_path=f"{ISAACLAB_NUCLEUS_DIR}/Robots/Unitree/A1/a1.usd",
activate_contact_sensors=True,
rigid_props=sim_utils.RigidBodyPropertiesCfg(
disable_gravity=False,
retain_accelerations=False,
linear_damping=0.0,
angular_damping=0.0,
max_linear_velocity=1000.0,
max_angular_velocity=1000.0,
max_depenetration_velocity=1.0,
),
articulation_props=sim_utils.ArticulationRootPropertiesCfg(
enabled_self_collisions=False, solver_position_iteration_count=4, solver_velocity_iteration_count=0
),
),
init_state=ArticulationCfg.InitialStateCfg(
pos=(0.0, 0.0, 0.42),
joint_pos={
".*L_hip_joint": 0.1,
".*R_hip_joint": -0.1,
"F[L,R]_thigh_joint": 0.8,
"R[L,R]_thigh_joint": 1.0,
".*_calf_joint": -1.5,
},
joint_vel={".*": 0.0},
),
soft_joint_pos_limit_factor=0.9,
actuators={
"base_legs": DCMotorCfg(
joint_names_expr=[".*_hip_joint", ".*_thigh_joint", ".*_calf_joint"],
actuator_effort_limit=33.5,
saturation_effort=33.5,
actuator_velocity_limit=21.0,
stiffness=25.0,
damping=0.5,
friction=0.0,
),
},
)
"""Configuration of Unitree A1 using DC motor.
Note: Specifications taken from: https://www.trossenrobotics.com/a1-quadruped#specifications
"""
UNITREE_GO1_CFG = ArticulationCfg(
spawn=sim_utils.UsdFileCfg(
usd_path=f"{ISAACLAB_NUCLEUS_DIR}/Robots/Unitree/Go1/go1.usd",
activate_contact_sensors=True,
rigid_props=sim_utils.RigidBodyPropertiesCfg(
disable_gravity=False,
retain_accelerations=False,
linear_damping=0.0,
angular_damping=0.0,
max_linear_velocity=1000.0,
max_angular_velocity=1000.0,
max_depenetration_velocity=1.0,
),
articulation_props=sim_utils.ArticulationRootPropertiesCfg(
enabled_self_collisions=False, solver_position_iteration_count=4, solver_velocity_iteration_count=0
),
),
init_state=ArticulationCfg.InitialStateCfg(
pos=(0.0, 0.0, 0.4),
joint_pos={
".*L_hip_joint": 0.1,
".*R_hip_joint": -0.1,
"F[L,R]_thigh_joint": 0.8,
"R[L,R]_thigh_joint": 1.0,
".*_calf_joint": -1.5,
},
joint_vel={".*": 0.0},
),
soft_joint_pos_limit_factor=0.9,
actuators={
"base_legs": GO1_ACTUATOR_CFG,
},
)
"""Configuration of Unitree Go1 using MLP-based actuator model."""
UNITREE_GO2_CFG = ArticulationCfg(
spawn=sim_utils.UsdFileCfg(
usd_path=f"{ISAACLAB_NUCLEUS_DIR}/Robots/Unitree/Go2/go2.usd",
activate_contact_sensors=True,
rigid_props=sim_utils.RigidBodyPropertiesCfg(
disable_gravity=False,
retain_accelerations=False,
linear_damping=0.0,
angular_damping=0.0,
max_linear_velocity=1000.0,
max_angular_velocity=1000.0,
max_depenetration_velocity=1.0,
),
articulation_props=sim_utils.ArticulationRootPropertiesCfg(
enabled_self_collisions=False, solver_position_iteration_count=4, solver_velocity_iteration_count=0
),
),
init_state=ArticulationCfg.InitialStateCfg(
pos=(0.0, 0.0, 0.4),
joint_pos={
".*L_hip_joint": 0.1,
".*R_hip_joint": -0.1,
"F[L,R]_thigh_joint": 0.8,
"R[L,R]_thigh_joint": 1.0,
".*_calf_joint": -1.5,
},
joint_vel={".*": 0.0},
),
soft_joint_pos_limit_factor=0.9,
actuators={
"base_legs": DCMotorCfg(
joint_names_expr=[".*_hip_joint", ".*_thigh_joint", ".*_calf_joint"],
# the calf sits behind an extra 1.92:1 knee reduction, so its joint-side torque is
# higher and its joint-side speed lower than the hip and thigh. Values match ``go2.usd``.
actuator_effort_limit={".*_hip_joint": 23.7, ".*_thigh_joint": 23.7, ".*_calf_joint": 45.43},
saturation_effort={".*_hip_joint": 23.7, ".*_thigh_joint": 23.7, ".*_calf_joint": 45.43},
actuator_velocity_limit={".*_hip_joint": 30.1, ".*_thigh_joint": 30.1, ".*_calf_joint": 15.70},
stiffness=25.0,
damping=0.5,
friction=0.0,
),
},
)
"""Configuration of Unitree Go2 using DC-Motor actuator model."""
H1_CFG = ArticulationCfg(
spawn=sim_utils.UsdFileCfg(
usd_path=f"{ISAACLAB_NUCLEUS_DIR}/Robots/Unitree/H1/h1.usd",
activate_contact_sensors=True,
rigid_props=sim_utils.RigidBodyPropertiesCfg(
disable_gravity=False,
retain_accelerations=False,
linear_damping=0.0,
angular_damping=0.0,
max_linear_velocity=1000.0,
max_angular_velocity=1000.0,
max_depenetration_velocity=1.0,
),
articulation_props=sim_utils.ArticulationRootPropertiesCfg(
enabled_self_collisions=False, solver_position_iteration_count=4, solver_velocity_iteration_count=4
),
),
init_state=ArticulationCfg.InitialStateCfg(
pos=(0.0, 0.0, 1.05),
joint_pos={
".*_hip_yaw": 0.0,
".*_hip_roll": 0.0,
".*_hip_pitch": -0.28, # -16 degrees
".*_knee": 0.79, # 45 degrees
".*_ankle": -0.52, # -30 degrees
"torso": 0.0,
".*_shoulder_pitch": 0.28,
".*_shoulder_roll": 0.0,
".*_shoulder_yaw": 0.0,
".*_elbow": 0.52,
},
joint_vel={".*": 0.0},
),
soft_joint_pos_limit_factor=0.9,
actuators={
"legs": ImplicitActuatorCfg(
joint_names_expr=[".*_hip_yaw", ".*_hip_roll", ".*_hip_pitch", ".*_knee", "torso"],
joint_effort_limit=300,
stiffness={
".*_hip_yaw": 150.0,
".*_hip_roll": 150.0,
".*_hip_pitch": 200.0,
".*_knee": 200.0,
"torso": 200.0,
},
damping={
".*_hip_yaw": 5.0,
".*_hip_roll": 5.0,
".*_hip_pitch": 5.0,
".*_knee": 5.0,
"torso": 5.0,
},
),
"feet": ImplicitActuatorCfg(
joint_names_expr=[".*_ankle"],
joint_effort_limit=100,
stiffness={".*_ankle": 20.0},
damping={".*_ankle": 4.0},
),
"arms": ImplicitActuatorCfg(
joint_names_expr=[".*_shoulder_pitch", ".*_shoulder_roll", ".*_shoulder_yaw", ".*_elbow"],
joint_effort_limit=300,
stiffness={
".*_shoulder_pitch": 40.0,
".*_shoulder_roll": 40.0,
".*_shoulder_yaw": 40.0,
".*_elbow": 40.0,
},
damping={
".*_shoulder_pitch": 10.0,
".*_shoulder_roll": 10.0,
".*_shoulder_yaw": 10.0,
".*_elbow": 10.0,
},
),
},
)
"""Configuration for the Unitree H1 Humanoid robot."""
H1_MINIMAL_CFG = H1_CFG.copy()
H1_MINIMAL_CFG.spawn.usd_path = f"{ISAACLAB_NUCLEUS_DIR}/Robots/Unitree/H1/h1_minimal.usd"
"""Configuration for the Unitree H1 Humanoid robot with fewer collision meshes.
This configuration removes most collision meshes to speed up simulation.
"""
G1_CFG = ArticulationCfg(
spawn=sim_utils.UsdFileCfg(
usd_path=f"{ISAACLAB_NUCLEUS_DIR}/Robots/Unitree/G1/g1.usd",
activate_contact_sensors=True,
rigid_props=sim_utils.RigidBodyPropertiesCfg(
disable_gravity=False,
retain_accelerations=False,
linear_damping=0.0,
angular_damping=0.0,
max_linear_velocity=1000.0,
max_angular_velocity=1000.0,
max_depenetration_velocity=1.0,
),
articulation_props=sim_utils.ArticulationRootPropertiesCfg(
enabled_self_collisions=False, solver_position_iteration_count=8, solver_velocity_iteration_count=4
),
),
init_state=ArticulationCfg.InitialStateCfg(
pos=(0.0, 0.0, 0.74),
joint_pos={
".*_hip_pitch_joint": -0.20,
".*_knee_joint": 0.42,
".*_ankle_pitch_joint": -0.23,
".*_elbow_pitch_joint": 0.87,
"left_shoulder_roll_joint": 0.16,
"left_shoulder_pitch_joint": 0.35,
"right_shoulder_roll_joint": -0.16,
"right_shoulder_pitch_joint": 0.35,
"left_one_joint": 1.0,
"right_one_joint": -1.0,
"left_two_joint": 0.52,
"right_two_joint": -0.52,
},
joint_vel={".*": 0.0},
),
soft_joint_pos_limit_factor=0.9,
actuators={
"legs": ImplicitActuatorCfg(
joint_names_expr=[
".*_hip_yaw_joint",
".*_hip_roll_joint",
".*_hip_pitch_joint",
".*_knee_joint",
"torso_joint",
],
joint_effort_limit=300,
stiffness={
".*_hip_yaw_joint": 150.0,
".*_hip_roll_joint": 150.0,
".*_hip_pitch_joint": 200.0,
".*_knee_joint": 200.0,
"torso_joint": 200.0,
},
damping={
".*_hip_yaw_joint": 5.0,
".*_hip_roll_joint": 5.0,
".*_hip_pitch_joint": 5.0,
".*_knee_joint": 5.0,
"torso_joint": 5.0,
},
armature={
".*_hip_.*": 0.01,
".*_knee_joint": 0.01,
"torso_joint": 0.01,
},
),
"feet": ImplicitActuatorCfg(
joint_effort_limit=20,
joint_names_expr=[".*_ankle_pitch_joint", ".*_ankle_roll_joint"],
stiffness=20.0,
damping=2.0,
armature=0.01,
),
"arms": ImplicitActuatorCfg(
joint_names_expr=[
".*_shoulder_pitch_joint",
".*_shoulder_roll_joint",
".*_shoulder_yaw_joint",
".*_elbow_pitch_joint",
".*_elbow_roll_joint",
".*_five_joint",
".*_three_joint",
".*_six_joint",
".*_four_joint",
".*_zero_joint",
".*_one_joint",
".*_two_joint",
],
joint_effort_limit=300,
stiffness=40.0,
damping=10.0,
armature={
".*_shoulder_.*": 0.01,
".*_elbow_.*": 0.01,
".*_five_joint": 0.001,
".*_three_joint": 0.001,
".*_six_joint": 0.001,
".*_four_joint": 0.001,
".*_zero_joint": 0.001,
".*_one_joint": 0.001,
".*_two_joint": 0.001,
},
),
},
)
"""Configuration for the Unitree G1 Humanoid robot."""
G1_MINIMAL_CFG = G1_CFG.copy()
G1_MINIMAL_CFG.spawn.usd_path = f"{ISAACLAB_NUCLEUS_DIR}/Robots/Unitree/G1/g1_minimal.usd"
"""Configuration for the Unitree G1 Humanoid robot with fewer collision meshes.
This configuration removes most collision meshes to speed up simulation.
"""
G1_29DOF_CFG = ArticulationCfg(
spawn=sim_utils.UsdFileCfg(
usd_path=f"{ISAAC_NUCLEUS_DIR}/Robots/Unitree/G1/g1.usd",
activate_contact_sensors=False,
rigid_props=sim_utils.RigidBodyPropertiesCfg(
disable_gravity=False,
retain_accelerations=False,
linear_damping=0.0,
angular_damping=0.0,
max_linear_velocity=1000.0,
max_angular_velocity=1000.0,
max_depenetration_velocity=1.0,
),
articulation_props=sim_utils.ArticulationRootPropertiesCfg(
enabled_self_collisions=False,
fix_root_link=False, # Configurable - can be set to True for fixed base
solver_position_iteration_count=8,
solver_velocity_iteration_count=4,
),
),
init_state=ArticulationCfg.InitialStateCfg(
pos=(0.0, 0.0, 0.75),
rot=(0, 0, 0.7071, 0.7071),
joint_pos={
".*_hip_pitch_joint": -0.10,
".*_knee_joint": 0.30,
".*_ankle_pitch_joint": -0.20,
},
joint_vel={".*": 0.0},
),
soft_joint_pos_limit_factor=0.9,
actuators={
"legs": DCMotorCfg(
joint_names_expr=[
".*_hip_yaw_joint",
".*_hip_roll_joint",
".*_hip_pitch_joint",
".*_knee_joint",
],
actuator_effort_limit={
".*_hip_yaw_joint": 88.0,
".*_hip_roll_joint": 88.0,
".*_hip_pitch_joint": 88.0,
".*_knee_joint": 139.0,
},
actuator_velocity_limit={
".*_hip_yaw_joint": 32.0,
".*_hip_roll_joint": 32.0,
".*_hip_pitch_joint": 32.0,
".*_knee_joint": 20.0,
},
stiffness={
".*_hip_yaw_joint": 100.0,
".*_hip_roll_joint": 100.0,
".*_hip_pitch_joint": 100.0,
".*_knee_joint": 200.0,
},
damping={
".*_hip_yaw_joint": 2.5,
".*_hip_roll_joint": 2.5,
".*_hip_pitch_joint": 2.5,
".*_knee_joint": 5.0,
},
armature={
".*_hip_.*": 0.03,
".*_knee_joint": 0.03,
},
saturation_effort=180.0,
),
"feet": DCMotorCfg(
joint_names_expr=[".*_ankle_pitch_joint", ".*_ankle_roll_joint"],
stiffness={
".*_ankle_pitch_joint": 20.0,
".*_ankle_roll_joint": 20.0,
},
damping={
".*_ankle_pitch_joint": 0.2,
".*_ankle_roll_joint": 0.1,
},
actuator_effort_limit={
".*_ankle_pitch_joint": 50.0,
".*_ankle_roll_joint": 50.0,
},
actuator_velocity_limit={
".*_ankle_pitch_joint": 37.0,
".*_ankle_roll_joint": 37.0,
},
armature=0.03,
saturation_effort=80.0,
),
"waist": ImplicitActuatorCfg(
joint_names_expr=[
"waist_.*_joint",
],
joint_effort_limit={
"waist_yaw_joint": 88.0,
"waist_roll_joint": 50.0,
"waist_pitch_joint": 50.0,
},
joint_velocity_limit={
"waist_yaw_joint": 32.0,
"waist_roll_joint": 37.0,
"waist_pitch_joint": 37.0,
},
stiffness={
"waist_yaw_joint": 5000.0,
"waist_roll_joint": 5000.0,
"waist_pitch_joint": 5000.0,
},
damping={
"waist_yaw_joint": 5.0,
"waist_roll_joint": 5.0,
"waist_pitch_joint": 5.0,
},
armature=0.001,
),
"arms": ImplicitActuatorCfg(
joint_names_expr=[
".*_shoulder_pitch_joint",
".*_shoulder_roll_joint",
".*_shoulder_yaw_joint",
".*_elbow_joint",
".*_wrist_.*_joint",
],
joint_effort_limit=300,
joint_velocity_limit=100,
stiffness=3000.0,
damping=10.0,
armature={
".*_shoulder_.*": 0.001,
".*_elbow_.*": 0.001,
".*_wrist_.*_joint": 0.001,
},
),
"hands": ImplicitActuatorCfg(
joint_names_expr=[
".*_index_.*",
".*_middle_.*",
".*_thumb_.*",
],
joint_effort_limit=300,
joint_velocity_limit=100,
stiffness=20,
damping=2,
armature=0.001,
),
},
prim_path="{ENV_REGEX_NS}/Robot",
)
"""Configuration for the Unitree G1 Humanoid robot for locomanipulation tasks.
This configuration sets up the G1 humanoid robot for locomanipulation tasks,
allowing both locomotion and manipulation capabilities. The robot can be configured
for either fixed base or mobile scenarios by modifying the fix_root_link parameter.
Key features:
- Configurable base (fixed or mobile) via fix_root_link parameter
- Optimized actuator parameters for locomanipulation tasks
- Enhanced hand and arm configurations for manipulation
Usage examples:
# For fixed base scenarios (upper body manipulation only)
fixed_base_cfg = G1_29DOF_CFG.copy()
fixed_base_cfg.spawn.articulation_props.fix_root_link = True
# For mobile scenarios (locomotion + manipulation)
mobile_cfg = G1_29DOF_CFG.copy()
mobile_cfg.spawn.articulation_props.fix_root_link = False
"""
"""
Configuration for the Unitree G1 Humanoid robot with Inspire 5fingers hand.
The Unitree G1 URDF can be found here: https://github.com/unitreerobotics/unitree_ros/tree/master/robots/g1_description/g1_29dof_with_hand_rev_1_0.urdf
The Inspire hand URDF is available at: https://github.com/unitreerobotics/xr_teleoperate/tree/main/assets/inspire_hand
The merging code for the hand and robot can be found here: https://github.com/unitreerobotics/unitree_ros/blob/master/robots/g1_description/merge_g1_29dof_and_inspire_hand.ipynb,
Necessary modifications should be made to ensure the correct parent–child relationship.
"""
# Inherit PD settings from G1_29DOF_CFG, with minor adjustments for grasping task
G1_INSPIRE_FTP_CFG = G1_29DOF_CFG.copy()
G1_INSPIRE_FTP_CFG.spawn.usd_path = f"{ISAACLAB_NUCLEUS_DIR}/Robots/Unitree/G1/g1_29dof_inspire_hand.usd"
G1_INSPIRE_FTP_CFG.spawn.activate_contact_sensors = True
G1_INSPIRE_FTP_CFG.spawn.rigid_props.disable_gravity = True
G1_INSPIRE_FTP_CFG.spawn.articulation_props.fix_root_link = True
G1_INSPIRE_FTP_CFG.init_state = ArticulationCfg.InitialStateCfg(
pos=(0.0, 0.0, 1.0),
joint_pos={".*": 0.0},
joint_vel={".*": 0.0},
)
# Actuator configuration for arms (stability focused for manipulation)
# Increased damping improves stability of arm movements
G1_INSPIRE_FTP_CFG.actuators["arms"] = ImplicitActuatorCfg(
joint_names_expr=[
".*_shoulder_pitch_joint",
".*_shoulder_roll_joint",
".*_shoulder_yaw_joint",
".*_elbow_joint",
".*_wrist_.*_joint",
],
joint_effort_limit=300,
joint_velocity_limit=100,
stiffness=3000.0,
damping=100.0,
armature={
".*_shoulder_.*": 0.001,
".*_elbow_.*": 0.001,
".*_wrist_.*_joint": 0.001,
},
)
# Actuator configuration for hands (flexibility focused for grasping)
# Lower stiffness and damping to improve finger flexibility when grasping objects
G1_INSPIRE_FTP_CFG.actuators["hands"] = ImplicitActuatorCfg(
joint_names_expr=[
".*_index_.*",
".*_middle_.*",
".*_thumb_.*",
".*_ring_.*",
".*_pinky_.*",
],
joint_effort_limit=30.0,
joint_velocity_limit=10.0,
stiffness=10.0,
damping=0.2,
armature=0.001,
)
G129_CFG_WITH_DEX3_BASE_FIX = ArticulationCfg(
spawn=sim_utils.UsdFileCfg(
usd_path=f"{HEALTHCARE_S3}/Robots/UnitreeG1/g1_29dof_with_dex3_base_fix/g1_29dof_with_dex3_base_fix.usd",
activate_contact_sensors=False,
rigid_props=sim_utils.RigidBodyPropertiesCfg(
disable_gravity=False,
retain_accelerations=False,
linear_damping=0.0,
angular_damping=0.0,
max_linear_velocity=1000.0,
max_angular_velocity=1000.0,
max_depenetration_velocity=1.0,
solver_position_iteration_count=4,
solver_velocity_iteration_count=0,
),
articulation_props=sim_utils.ArticulationRootPropertiesCfg(
enabled_self_collisions=False, solver_position_iteration_count=4, solver_velocity_iteration_count=0
),
),
prim_path="{ENV_REGEX_NS}/Robot",
init_state=ArticulationCfg.InitialStateCfg(
pos=(0.0, 0.0, 0.75),
joint_pos={
"left_hip_yaw_joint": 0.0,
"left_hip_roll_joint": 0.0,
"left_hip_pitch_joint": -0.05,
"left_knee_joint": 0.2,
"left_ankle_pitch_joint": -0.15,
"left_ankle_roll_joint": 0.0,
"right_hip_yaw_joint": 0.0,
"right_hip_roll_joint": 0.0,
"right_hip_pitch_joint": -0.05,
"right_knee_joint": 0.2,
"right_ankle_pitch_joint": -0.15,
"right_ankle_roll_joint": 0.0,
"waist_yaw_joint": 0.0,
"waist_roll_joint": 0.0,
"waist_pitch_joint": 0.0,
"left_shoulder_pitch_joint": 0.0,
"left_shoulder_roll_joint": 0.0,
"left_shoulder_yaw_joint": 0.0,
"left_elbow_joint": -0.3,
"left_wrist_roll_joint": 0.0,
"left_wrist_pitch_joint": 0.0,
"left_wrist_yaw_joint": 0.0,
"right_shoulder_pitch_joint": 0.0,
"right_shoulder_roll_joint": 0.0,
"right_shoulder_yaw_joint": 0.0,
"right_elbow_joint": -0.3,
"right_wrist_roll_joint": 0.0,
"right_wrist_pitch_joint": 0.0,
"right_wrist_yaw_joint": 0.0,
"left_hand_index_0_joint": 0.0,
"left_hand_middle_0_joint": 0.0,
"left_hand_thumb_0_joint": 0.0,
"left_hand_index_1_joint": 0.0,
"left_hand_middle_1_joint": 0.0,
"left_hand_thumb_1_joint": 0.0,
"left_hand_thumb_2_joint": 0.0,
"right_hand_index_0_joint": 0.0,
"right_hand_middle_0_joint": 0.0,
"right_hand_thumb_0_joint": 0.0,
"right_hand_index_1_joint": 0.0,
"right_hand_middle_1_joint": 0.0,
"right_hand_thumb_1_joint": 0.0,
"right_hand_thumb_2_joint": 0.0,
},
joint_vel={".*": 0.0},
),
soft_joint_pos_limit_factor=0.9,
actuators={
"legs": IdealPDActuatorCfg(
joint_names_expr=[
".*_hip_yaw_joint",
".*_hip_roll_joint",
".*_hip_pitch_joint",
".*_knee_joint",
],
actuator_effort_limit={
".*_hip_yaw_joint": 88.0,
".*_hip_roll_joint": 88.0,
".*_hip_pitch_joint": 88.0,
".*_knee_joint": 139.0,
},
actuator_velocity_limit={
".*_hip_yaw_joint": 32.0,
".*_hip_roll_joint": 32.0,
".*_hip_pitch_joint": 32.0,
".*_knee_joint": 20.0,
},
stiffness={
".*_hip_yaw_joint": 150.0,
".*_hip_roll_joint": 150.0,
".*_hip_pitch_joint": 150.0,
".*_knee_joint": 300.0,
},
damping={
".*_hip_yaw_joint": 2.0,
".*_hip_roll_joint": 2.0,
".*_hip_pitch_joint": 2.0,
".*_knee_joint": 4.0,
},
armature={
".*_hip_.*": 0.03,
".*_knee_joint": 0.03,
},
),
"feet": IdealPDActuatorCfg(
joint_names_expr=[".*_ankle_pitch_joint", ".*_ankle_roll_joint"],
stiffness={
".*_ankle_pitch_joint": 40.0,
".*_ankle_roll_joint": 40.0,
},
damping={
".*_ankle_pitch_joint": 2,
".*_ankle_roll_joint": 2,
},
actuator_effort_limit={
".*_ankle_pitch_joint": 50.0,
".*_ankle_roll_joint": 50.0,
},
actuator_velocity_limit={
".*_ankle_pitch_joint": 37.0,
".*_ankle_roll_joint": 37.0,
},
armature=0.03,
friction=0.03,
),
"waist": ImplicitActuatorCfg(
joint_names_expr=["waist_yaw_joint", "waist_roll_joint", "waist_pitch_joint"],
joint_effort_limit=1000.0,
joint_velocity_limit=0.0,
stiffness={"waist_yaw_joint": 10000.0, "waist_roll_joint": 10000.0, "waist_pitch_joint": 10000.0},
damping={"waist_yaw_joint": 10000.0, "waist_roll_joint": 10000.0, "waist_pitch_joint": 10000.0},
armature=None,
),
"arms": IdealPDActuatorCfg(
joint_names_expr=[
".*_shoulder_pitch_joint",
".*_shoulder_roll_joint",
".*_shoulder_yaw_joint",
".*_elbow_joint",
".*_wrist_.*_joint",
],
actuator_effort_limit={
".*_shoulder_pitch_joint": 25.0,
".*_shoulder_roll_joint": 25.0,
".*_shoulder_yaw_joint": 25.0,
".*_elbow_joint": 25.0,
".*_wrist_roll_joint": 25.0,
".*_wrist_pitch_joint": 5.0,
".*_wrist_yaw_joint": 5.0,
},
actuator_velocity_limit={
".*_shoulder_pitch_joint": 37.0,
".*_shoulder_roll_joint": 37.0,
".*_shoulder_yaw_joint": 37.0,
".*_elbow_joint": 37.0,
".*_wrist_roll_joint": 37.0,
".*_wrist_pitch_joint": 22.0,
".*_wrist_yaw_joint": 22.0,
},
stiffness={
".*_shoulder_pitch_joint": 100.0,
".*_shoulder_roll_joint": 100.0,
".*_shoulder_yaw_joint": 40.0,
".*_elbow_joint": 40.0,
".*_wrist_.*_joint": 20.0,
},
damping={
".*_shoulder_pitch_joint": 15.0,
".*_shoulder_roll_joint": 15.0,
".*_shoulder_yaw_joint": 8.0,
".*_elbow_joint": 8.0,
".*_wrist_.*_joint": 4.0,
},
armature={".*_shoulder_.*": 0.03, ".*_elbow_.*": 0.03, ".*_wrist_.*_joint": 0.03},
friction=0.03,
),
"hands": IdealPDActuatorCfg(
joint_names_expr=[
".*_hand_.*",
],
actuator_effort_limit=5.0,
actuator_velocity_limit=10.0,
stiffness=8.0,
damping=1.5,
armature=0.03,
friction=0.5,
),
},
)
"""Configuration for the Unitree G1 29DOF robot with Dex3 hands and fixed base.
This configuration is designed for high-precision manipulation tasks such as trocar assembly.
"""