wuyan01 commited on
Commit
d542deb
·
1 Parent(s): 52f18fe

first commit

Browse files
Files changed (2) hide show
  1. assets/smpl_humanoid.xml +245 -0
  2. replay.py +184 -0
assets/smpl_humanoid.xml ADDED
@@ -0,0 +1,245 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <mujoco model="humanoid">
2
+ <compiler coordinate="local"/>
3
+ <default>
4
+ <joint damping="0.0" armature="0.01" stiffness="0.0" limited="true"/>
5
+ <geom conaffinity="1" condim="3" contype="7" margin="0.001" rgba="0.8 0.6 .4 1"/>
6
+ </default>
7
+ <asset>
8
+ <texture type="skybox" builtin="gradient" rgb1=".4 .5 .6" rgb2="0 0 0" width="100" height="100"/>
9
+ <texture builtin="flat" height="1278" mark="cross" markrgb="1 1 1" name="texgeom" random="0.01" rgb1="0.8 0.6 0.4" rgb2="0.8 0.6 0.4" type="cube" width="127"/>
10
+ <texture builtin="checker" height="100" name="texplane" rgb1="0 0 0" rgb2="0.8 0.8 0.8" type="2d" width="100"/>
11
+ <material name="MatPlane" reflectance="0.5" shininess="1" specular="1" texrepeat="60 60" texture="texplane"/>
12
+ <material name="geom" texture="texgeom" texuniform="true"/>
13
+ </asset>
14
+ <worldbody>
15
+ <light cutoff="100" diffuse="1 1 1" dir="-0 0 -1.3" directional="true" exponent="1" pos="0 0 1.3" specular=".1 .1 .1"/>
16
+ <geom conaffinity="1" condim="3" name="floor" pos="0 0 0" rgba="0.8 0.9 0.8 1" size="100 100 .2" type="plane" material="MatPlane"/>
17
+ <body name="Pelvis" pos="-0.0018 -0.2233 0.0282">
18
+ <freejoint name="Pelvis"/>
19
+ <geom type="box" pos="-0.0055 -0.0000 -0.0121" size="0.083 0.1069 0.0722" quat="1.0000 0.0000 0.0000 0.0000" density="1000"/>
20
+ <body name="L_Hip" pos="-0.0068 0.0695 -0.0914">
21
+ <joint name="L_Hip_x" type="hinge" pos="0 0 0" axis="1 0 0" stiffness="800" damping="80" armature="0.02" range="-180.0000 180.0000"/>
22
+ <joint name="L_Hip_y" type="hinge" pos="0 0 0" axis="0 1 0" stiffness="800" damping="80" armature="0.02" range="-180.0000 180.0000"/>
23
+ <joint name="L_Hip_z" type="hinge" pos="0 0 0" axis="0 0 1" stiffness="800" damping="80" armature="0.02" range="-180.0000 180.0000"/>
24
+ <geom type="capsule" contype="1" conaffinity="1" density="2040.816327" fromto="-0.0009 0.0069 -0.0750 -0.0036 0.0274 -0.3002" size="0.0615"/>
25
+ <body name="L_Knee" pos="-0.0045 0.0343 -0.3752">
26
+ <joint name="L_Knee_x" type="hinge" pos="0 0 0" axis="1 0 0" stiffness="800" damping="80" armature="0.02" range="-180.0000 180.0000"/>
27
+ <joint name="L_Knee_y" type="hinge" pos="0 0 0" axis="0 1 0" stiffness="800" damping="80" armature="0.02" range="-180.0000 180.0000"/>
28
+ <joint name="L_Knee_z" type="hinge" pos="0 0 0" axis="0 0 1" stiffness="800" damping="80" armature="0.02" range="-180.0000 180.0000"/>
29
+ <geom type="capsule" contype="1" conaffinity="1" density="1234.567901" fromto="-0.0087 -0.0027 -0.0796 -0.0350 -0.0109 -0.3184" size="0.0541"/>
30
+ <body name="L_Ankle" pos="-0.0437 -0.0136 -0.398">
31
+ <joint name="L_Ankle_x" type="hinge" pos="0 0 0" axis="1 0 0" stiffness="800" damping="80" armature="0.02" range="-180.0000 180.0000"/>
32
+ <joint name="L_Ankle_y" type="hinge" pos="0 0 0" axis="0 1 0" stiffness="800" damping="80" armature="0.02" range="-180.0000 180.0000"/>
33
+ <joint name="L_Ankle_z" type="hinge" pos="0 0 0" axis="0 0 1" stiffness="800" damping="80" armature="0.02" range="-180.0000 180.0000"/>
34
+ <geom type="box" pos="0.0242 0.0233 -0.0239" size="0.085 0.0483 0.0464" quat="1.0000 0.0000 0.0000 0.0000" density="1000"/>
35
+ <body name="L_Toe" pos="0.1193 0.0264 -0.0558">
36
+ <joint name="L_Toe_x" type="hinge" pos="0 0 0" axis="1 0 0" stiffness="500" damping="50" armature="0.02" range="-180.0000 180.0000"/>
37
+ <joint name="L_Toe_y" type="hinge" pos="0 0 0" axis="0 1 0" stiffness="500" damping="50" armature="0.02" range="-180.0000 180.0000"/>
38
+ <joint name="L_Toe_z" type="hinge" pos="0 0 0" axis="0 0 1" stiffness="500" damping="50" armature="0.02" range="-180.0000 180.0000"/>
39
+ <geom type="box" pos="0.0248 -0.0030 0.0055" size="0.0496 0.0478 0.02" quat="1.0000 0.0000 0.0000 0.0000" density="1000"/>
40
+ </body>
41
+ </body>
42
+ </body>
43
+ </body>
44
+ <body name="R_Hip" pos="-0.0043 -0.0677 -0.0905">
45
+ <joint name="R_Hip_x" type="hinge" pos="0 0 0" axis="1 0 0" stiffness="800" damping="80" armature="0.02" range="-180.0000 180.0000"/>
46
+ <joint name="R_Hip_y" type="hinge" pos="0 0 0" axis="0 1 0" stiffness="800" damping="80" armature="0.02" range="-180.0000 180.0000"/>
47
+ <joint name="R_Hip_z" type="hinge" pos="0 0 0" axis="0 0 1" stiffness="800" damping="80" armature="0.02" range="-180.0000 180.0000"/>
48
+ <geom type="capsule" contype="1" conaffinity="1" density="2040.816327" fromto="-0.0018 -0.0077 -0.0765 -0.0071 -0.0306 -0.3061" size="0.0606"/>
49
+ <body name="R_Knee" pos="-0.0089 -0.0383 -0.3826">
50
+ <joint name="R_Knee_x" type="hinge" pos="0 0 0" axis="1 0 0" stiffness="800" damping="80" armature="0.02" range="-180.0000 180.0000"/>
51
+ <joint name="R_Knee_y" type="hinge" pos="0 0 0" axis="0 1 0" stiffness="800" damping="80" armature="0.02" range="-180.0000 180.0000"/>
52
+ <joint name="R_Knee_z" type="hinge" pos="0 0 0" axis="0 0 1" stiffness="800" damping="80" armature="0.02" range="-180.0000 180.0000"/>
53
+ <geom type="capsule" contype="1" conaffinity="1" density="1234.567901" fromto="-0.0085 0.0032 -0.0797 -0.0338 0.0126 -0.3187" size="0.0541"/>
54
+ <body name="R_Ankle" pos="-0.0423 0.0158 -0.3984">
55
+ <joint name="R_Ankle_x" type="hinge" pos="0 0 0" axis="1 0 0" stiffness="800" damping="80" armature="0.02" range="-180.0000 180.0000"/>
56
+ <joint name="R_Ankle_y" type="hinge" pos="0 0 0" axis="0 1 0" stiffness="800" damping="80" armature="0.02" range="-180.0000 180.0000"/>
57
+ <joint name="R_Ankle_z" type="hinge" pos="0 0 0" axis="0 0 1" stiffness="800" damping="80" armature="0.02" range="-180.0000 180.0000"/>
58
+ <geom type="box" pos="0.0256 -0.0212 -0.0174" size="0.0865 0.0483 0.0478" quat="1.0000 0.0000 0.0000 0.0000" density="1000"/>
59
+ <body name="R_Toe" pos="0.1233 -0.0254 -0.0481">
60
+ <joint name="R_Toe_x" type="hinge" pos="0 0 0" axis="1 0 0" stiffness="500" damping="50" armature="0.02" range="-180.0000 180.0000"/>
61
+ <joint name="R_Toe_y" type="hinge" pos="0 0 0" axis="0 1 0" stiffness="500" damping="50" armature="0.02" range="-180.0000 180.0000"/>
62
+ <joint name="R_Toe_z" type="hinge" pos="0 0 0" axis="0 0 1" stiffness="500" damping="50" armature="0.02" range="-180.0000 180.0000"/>
63
+ <geom type="box" pos="0.0227 0.0042 0.0045" size="0.0493 0.0479 0.0216" quat="1.0000 0.0000 0.0000 0.0000" density="1000"/>
64
+ </body>
65
+ </body>
66
+ </body>
67
+ </body>
68
+ <body name="Torso" pos="-0.0267 -0.0025 0.109">
69
+ <joint name="Torso_x" type="hinge" pos="0 0 0" axis="1 0 0" stiffness="1000" damping="100" armature="0.02" range="-180.0000 180.0000"/>
70
+ <joint name="Torso_y" type="hinge" pos="0 0 0" axis="0 1 0" stiffness="1000" damping="100" armature="0.02" range="-180.0000 180.0000"/>
71
+ <joint name="Torso_z" type="hinge" pos="0 0 0" axis="0 0 1" stiffness="1000" damping="100" armature="0.02" range="-180.0000 180.0000"/>
72
+ <geom type="capsule" contype="1" conaffinity="1" density="2040.816327" fromto="0.0005 0.0025 0.0608 0.0006 0.0030 0.0743" size="0.0769"/>
73
+ <body name="Spine" pos="0.0011 0.0055 0.1352">
74
+ <joint name="Spine_x" type="hinge" pos="0 0 0" axis="1 0 0" stiffness="1000" damping="100" armature="0.02" range="-180.0000 180.0000"/>
75
+ <joint name="Spine_y" type="hinge" pos="0 0 0" axis="0 1 0" stiffness="1000" damping="100" armature="0.02" range="-180.0000 180.0000"/>
76
+ <joint name="Spine_z" type="hinge" pos="0 0 0" axis="0 0 1" stiffness="1000" damping="100" armature="0.02" range="-180.0000 180.0000"/>
77
+ <geom type="capsule" contype="1" conaffinity="1" density="2040.816327" fromto="0.0114 0.0007 0.0238 0.0140 0.0008 0.0291" size="0.0755"/>
78
+ <body name="Chest" pos="0.0254 0.0015 0.0529">
79
+ <joint name="Chest_x" type="hinge" pos="0 0 0" axis="1 0 0" stiffness="1000" damping="100" armature="0.02" range="-180.0000 180.0000"/>
80
+ <joint name="Chest_y" type="hinge" pos="0 0 0" axis="0 1 0" stiffness="1000" damping="100" armature="0.02" range="-180.0000 180.0000"/>
81
+ <joint name="Chest_z" type="hinge" pos="0 0 0" axis="0 0 1" stiffness="1000" damping="100" armature="0.02" range="-180.0000 180.0000"/>
82
+ <geom type="capsule" contype="1" conaffinity="1" density="2040.816327" fromto="-0.0173 -0.0009 0.0682 -0.0212 -0.0010 0.0833" size="0.1002"/>
83
+ <body name="Neck" pos="-0.0429 -0.0028 0.2139">
84
+ <joint name="Neck_x" type="hinge" pos="0 0 0" axis="1 0 0" stiffness="500" damping="50" armature="0.02" range="-180.0000 180.0000"/>
85
+ <joint name="Neck_y" type="hinge" pos="0 0 0" axis="0 1 0" stiffness="500" damping="50" armature="0.02" range="-180.0000 180.0000"/>
86
+ <joint name="Neck_z" type="hinge" pos="0 0 0" axis="0 0 1" stiffness="500" damping="50" armature="0.02" range="-180.0000 180.0000"/>
87
+ <geom type="capsule" contype="1" conaffinity="1" density="1000" fromto="0.0103 0.0010 0.0130 0.0411 0.0041 0.0520" size="0.0436"/>
88
+ <body name="Head" pos="0.0513 0.0052 0.065">
89
+ <joint name="Head_x" type="hinge" pos="0 0 0" axis="1 0 0" stiffness="500" damping="50" armature="0.02" range="-180.0000 180.0000"/>
90
+ <joint name="Head_y" type="hinge" pos="0 0 0" axis="0 1 0" stiffness="500" damping="50" armature="0.02" range="-180.0000 180.0000"/>
91
+ <joint name="Head_z" type="hinge" pos="0 0 0" axis="0 0 1" stiffness="500" damping="50" armature="0.02" range="-180.0000 180.0000"/>
92
+ <geom type="box" pos="-0.0116 -0.0042 0.0876" size="0.076 0.0606 0.1154" quat="1.0000 0.0000 0.0000 0.0000" density="1000"/>
93
+ </body>
94
+ </body>
95
+ <body name="L_Thorax" pos="-0.0341 0.0788 0.1217">
96
+ <joint name="L_Thorax_x" type="hinge" pos="0 0 0" axis="1 0 0" stiffness="500" damping="50" armature="0.02" range="-180.0000 180.0000"/>
97
+ <joint name="L_Thorax_y" type="hinge" pos="0 0 0" axis="0 1 0" stiffness="500" damping="50" armature="0.02" range="-180.0000 180.0000"/>
98
+ <joint name="L_Thorax_z" type="hinge" pos="0 0 0" axis="0 0 1" stiffness="500" damping="50" armature="0.02" range="-180.0000 180.0000"/>
99
+ <geom type="capsule" contype="1" conaffinity="1" density="1000" fromto="-0.0018 0.0182 0.0061 -0.0071 0.0728 0.0244" size="0.0521"/>
100
+ <body name="L_Shoulder" pos="-0.0089 0.091 0.0305">
101
+ <joint name="L_Shoulder_x" type="hinge" pos="0 0 0" axis="1 0 0" stiffness="500" damping="50" armature="0.02" range="-720.0000 720.0000"/>
102
+ <joint name="L_Shoulder_y" type="hinge" pos="0 0 0" axis="0 1 0" stiffness="500" damping="50" armature="0.02" range="-720.0000 720.0000"/>
103
+ <joint name="L_Shoulder_z" type="hinge" pos="0 0 0" axis="0 0 1" stiffness="500" damping="50" armature="0.02" range="-720.0000 720.0000"/>
104
+ <geom type="capsule" contype="1" conaffinity="1" density="1000" fromto="-0.0055 0.0519 -0.0026 -0.0220 0.2077 -0.0102" size="0.0517"/>
105
+ <body name="L_Elbow" pos="-0.0275 0.2596 -0.0128">
106
+ <joint name="L_Elbow_x" type="hinge" pos="0 0 0" axis="1 0 0" stiffness="500" damping="50" armature="0.02" range="-720.0000 720.0000"/>
107
+ <joint name="L_Elbow_y" type="hinge" pos="0 0 0" axis="0 1 0" stiffness="500" damping="50" armature="0.02" range="-720.0000 720.0000"/>
108
+ <joint name="L_Elbow_z" type="hinge" pos="0 0 0" axis="0 0 1" stiffness="500" damping="50" armature="0.02" range="-720.0000 720.0000"/>
109
+ <geom type="capsule" contype="1" conaffinity="1" density="1000" fromto="-0.0002 0.0498 0.0018 -0.0009 0.1994 0.0072" size="0.0405"/>
110
+ <body name="L_Wrist" pos="-0.0012 0.2492 0.009">
111
+ <joint name="L_Wrist_x" type="hinge" pos="0 0 0" axis="1 0 0" stiffness="300" damping="30" armature="0.02" range="-180.0000 180.0000"/>
112
+ <joint name="L_Wrist_y" type="hinge" pos="0 0 0" axis="0 1 0" stiffness="300" damping="30" armature="0.02" range="-180.0000 180.0000"/>
113
+ <joint name="L_Wrist_z" type="hinge" pos="0 0 0" axis="0 0 1" stiffness="300" damping="30" armature="0.02" range="-180.0000 180.0000"/>
114
+ <geom type="capsule" contype="1" conaffinity="1" density="1000" fromto="-0.0030 0.0168 -0.0016 -0.0120 0.0672 -0.0065" size="0.0318"/>
115
+ <body name="L_Hand" pos="-0.0149 0.084 -0.0082">
116
+ <joint name="L_Hand_x" type="hinge" pos="0 0 0" axis="1 0 0" stiffness="300" damping="30" armature="0.02" range="-180.0000 180.0000"/>
117
+ <joint name="L_Hand_y" type="hinge" pos="0 0 0" axis="0 1 0" stiffness="300" damping="30" armature="0.02" range="-180.0000 180.0000"/>
118
+ <joint name="L_Hand_z" type="hinge" pos="0 0 0" axis="0 0 1" stiffness="300" damping="30" armature="0.02" range="-180.0000 180.0000"/>
119
+ <geom type="box" pos="-0.0058 0.0493 0.0010" size="0.0538 0.0585 0.0158" quat="1.0000 0.0000 0.0000 0.0000" density="1000"/>
120
+ </body>
121
+ </body>
122
+ </body>
123
+ </body>
124
+ </body>
125
+ <body name="R_Thorax" pos="-0.0386 -0.0818 0.1188">
126
+ <joint name="R_Thorax_x" type="hinge" pos="0 0 0" axis="1 0 0" stiffness="500" damping="50" armature="0.02" range="-180.0000 180.0000"/>
127
+ <joint name="R_Thorax_y" type="hinge" pos="0 0 0" axis="0 1 0" stiffness="500" damping="50" armature="0.02" range="-180.0000 180.0000"/>
128
+ <joint name="R_Thorax_z" type="hinge" pos="0 0 0" axis="0 0 1" stiffness="500" damping="50" armature="0.02" range="-180.0000 180.0000"/>
129
+ <geom type="capsule" contype="1" conaffinity="1" density="1000" fromto="-0.0018 -0.0192 0.0065 -0.0073 -0.0768 0.0260" size="0.0511"/>
130
+ <body name="R_Shoulder" pos="-0.0091 -0.096 0.0326">
131
+ <joint name="R_Shoulder_x" type="hinge" pos="0 0 0" axis="1 0 0" stiffness="500" damping="50" armature="0.02" range="-720.0000 720.0000"/>
132
+ <joint name="R_Shoulder_y" type="hinge" pos="0 0 0" axis="0 1 0" stiffness="500" damping="50" armature="0.02" range="-720.0000 720.0000"/>
133
+ <joint name="R_Shoulder_z" type="hinge" pos="0 0 0" axis="0 0 1" stiffness="500" damping="50" armature="0.02" range="-720.0000 720.0000"/>
134
+ <geom type="capsule" contype="1" conaffinity="1" density="1000" fromto="-0.0043 -0.0507 -0.0027 -0.0171 -0.2030 -0.0107" size="0.0531"/>
135
+ <body name="R_Elbow" pos="-0.0214 -0.2537 -0.0133">
136
+ <joint name="R_Elbow_x" type="hinge" pos="0 0 0" axis="1 0 0" stiffness="500" damping="50" armature="0.02" range="-720.0000 720.0000"/>
137
+ <joint name="R_Elbow_y" type="hinge" pos="0 0 0" axis="0 1 0" stiffness="500" damping="50" armature="0.02" range="-720.0000 720.0000"/>
138
+ <joint name="R_Elbow_z" type="hinge" pos="0 0 0" axis="0 0 1" stiffness="500" damping="50" armature="0.02" range="-720.0000 720.0000"/>
139
+ <geom type="capsule" contype="1" conaffinity="1" density="1000" fromto="-0.0011 -0.0511 0.0016 -0.0044 -0.2042 0.0062" size="0.0408"/>
140
+ <body name="R_Wrist" pos="-0.0056 -0.2553 0.0078">
141
+ <joint name="R_Wrist_x" type="hinge" pos="0 0 0" axis="1 0 0" stiffness="300" damping="30" armature="0.02" range="-180.0000 180.0000"/>
142
+ <joint name="R_Wrist_y" type="hinge" pos="0 0 0" axis="0 1 0" stiffness="300" damping="30" armature="0.02" range="-180.0000 180.0000"/>
143
+ <joint name="R_Wrist_z" type="hinge" pos="0 0 0" axis="0 0 1" stiffness="300" damping="30" armature="0.02" range="-180.0000 180.0000"/>
144
+ <geom type="capsule" contype="1" conaffinity="1" density="1000" fromto="-0.0021 -0.0169 -0.0012 -0.0083 -0.0677 -0.0049" size="0.0326"/>
145
+ <body name="R_Hand" pos="-0.0103 -0.0846 -0.0061">
146
+ <joint name="R_Hand_x" type="hinge" pos="0 0 0" axis="1 0 0" stiffness="300" damping="30" armature="0.02" range="-180.0000 180.0000"/>
147
+ <joint name="R_Hand_y" type="hinge" pos="0 0 0" axis="0 1 0" stiffness="300" damping="30" armature="0.02" range="-180.0000 180.0000"/>
148
+ <joint name="R_Hand_z" type="hinge" pos="0 0 0" axis="0 0 1" stiffness="300" damping="30" armature="0.02" range="-180.0000 180.0000"/>
149
+ <geom type="box" pos="-0.0079 -0.0462 -0.0009" size="0.0546 0.0569 0.0164" quat="1.0000 0.0000 0.0000 0.0000" density="1000"/>
150
+ </body>
151
+ </body>
152
+ </body>
153
+ </body>
154
+ </body>
155
+ </body>
156
+ </body>
157
+ </body>
158
+ </body>
159
+ </worldbody>
160
+ <actuator>
161
+ <motor name="L_Hip_x" joint="L_Hip_x" gear="500"/>
162
+ <motor name="L_Hip_y" joint="L_Hip_y" gear="500"/>
163
+ <motor name="L_Hip_z" joint="L_Hip_z" gear="500"/>
164
+ <motor name="L_Knee_x" joint="L_Knee_x" gear="500"/>
165
+ <motor name="L_Knee_y" joint="L_Knee_y" gear="500"/>
166
+ <motor name="L_Knee_z" joint="L_Knee_z" gear="500"/>
167
+ <motor name="L_Ankle_x" joint="L_Ankle_x" gear="500"/>
168
+ <motor name="L_Ankle_y" joint="L_Ankle_y" gear="500"/>
169
+ <motor name="L_Ankle_z" joint="L_Ankle_z" gear="500"/>
170
+ <motor name="L_Toe_x" joint="L_Toe_x" gear="500"/>
171
+ <motor name="L_Toe_y" joint="L_Toe_y" gear="500"/>
172
+ <motor name="L_Toe_z" joint="L_Toe_z" gear="500"/>
173
+ <motor name="R_Hip_x" joint="R_Hip_x" gear="500"/>
174
+ <motor name="R_Hip_y" joint="R_Hip_y" gear="500"/>
175
+ <motor name="R_Hip_z" joint="R_Hip_z" gear="500"/>
176
+ <motor name="R_Knee_x" joint="R_Knee_x" gear="500"/>
177
+ <motor name="R_Knee_y" joint="R_Knee_y" gear="500"/>
178
+ <motor name="R_Knee_z" joint="R_Knee_z" gear="500"/>
179
+ <motor name="R_Ankle_x" joint="R_Ankle_x" gear="500"/>
180
+ <motor name="R_Ankle_y" joint="R_Ankle_y" gear="500"/>
181
+ <motor name="R_Ankle_z" joint="R_Ankle_z" gear="500"/>
182
+ <motor name="R_Toe_x" joint="R_Toe_x" gear="500"/>
183
+ <motor name="R_Toe_y" joint="R_Toe_y" gear="500"/>
184
+ <motor name="R_Toe_z" joint="R_Toe_z" gear="500"/>
185
+ <motor name="Torso_x" joint="Torso_x" gear="500"/>
186
+ <motor name="Torso_y" joint="Torso_y" gear="500"/>
187
+ <motor name="Torso_z" joint="Torso_z" gear="500"/>
188
+ <motor name="Spine_x" joint="Spine_x" gear="500"/>
189
+ <motor name="Spine_y" joint="Spine_y" gear="500"/>
190
+ <motor name="Spine_z" joint="Spine_z" gear="500"/>
191
+ <motor name="Chest_x" joint="Chest_x" gear="500"/>
192
+ <motor name="Chest_y" joint="Chest_y" gear="500"/>
193
+ <motor name="Chest_z" joint="Chest_z" gear="500"/>
194
+ <motor name="Neck_x" joint="Neck_x" gear="500"/>
195
+ <motor name="Neck_y" joint="Neck_y" gear="500"/>
196
+ <motor name="Neck_z" joint="Neck_z" gear="500"/>
197
+ <motor name="Head_x" joint="Head_x" gear="500"/>
198
+ <motor name="Head_y" joint="Head_y" gear="500"/>
199
+ <motor name="Head_z" joint="Head_z" gear="500"/>
200
+ <motor name="L_Thorax_x" joint="L_Thorax_x" gear="500"/>
201
+ <motor name="L_Thorax_y" joint="L_Thorax_y" gear="500"/>
202
+ <motor name="L_Thorax_z" joint="L_Thorax_z" gear="500"/>
203
+ <motor name="L_Shoulder_x" joint="L_Shoulder_x" gear="500"/>
204
+ <motor name="L_Shoulder_y" joint="L_Shoulder_y" gear="500"/>
205
+ <motor name="L_Shoulder_z" joint="L_Shoulder_z" gear="500"/>
206
+ <motor name="L_Elbow_x" joint="L_Elbow_x" gear="500"/>
207
+ <motor name="L_Elbow_y" joint="L_Elbow_y" gear="500"/>
208
+ <motor name="L_Elbow_z" joint="L_Elbow_z" gear="500"/>
209
+ <motor name="L_Wrist_x" joint="L_Wrist_x" gear="500"/>
210
+ <motor name="L_Wrist_y" joint="L_Wrist_y" gear="500"/>
211
+ <motor name="L_Wrist_z" joint="L_Wrist_z" gear="500"/>
212
+ <motor name="L_Hand_x" joint="L_Hand_x" gear="500"/>
213
+ <motor name="L_Hand_y" joint="L_Hand_y" gear="500"/>
214
+ <motor name="L_Hand_z" joint="L_Hand_z" gear="500"/>
215
+ <motor name="R_Thorax_x" joint="R_Thorax_x" gear="500"/>
216
+ <motor name="R_Thorax_y" joint="R_Thorax_y" gear="500"/>
217
+ <motor name="R_Thorax_z" joint="R_Thorax_z" gear="500"/>
218
+ <motor name="R_Shoulder_x" joint="R_Shoulder_x" gear="500"/>
219
+ <motor name="R_Shoulder_y" joint="R_Shoulder_y" gear="500"/>
220
+ <motor name="R_Shoulder_z" joint="R_Shoulder_z" gear="500"/>
221
+ <motor name="R_Elbow_x" joint="R_Elbow_x" gear="500"/>
222
+ <motor name="R_Elbow_y" joint="R_Elbow_y" gear="500"/>
223
+ <motor name="R_Elbow_z" joint="R_Elbow_z" gear="500"/>
224
+ <motor name="R_Wrist_x" joint="R_Wrist_x" gear="500"/>
225
+ <motor name="R_Wrist_y" joint="R_Wrist_y" gear="500"/>
226
+ <motor name="R_Wrist_z" joint="R_Wrist_z" gear="500"/>
227
+ <motor name="R_Hand_x" joint="R_Hand_x" gear="500"/>
228
+ <motor name="R_Hand_y" joint="R_Hand_y" gear="500"/>
229
+ <motor name="R_Hand_z" joint="R_Hand_z" gear="500"/>
230
+ </actuator>
231
+ <contact>
232
+ <exclude body1="Torso" body2="Chest"/>
233
+ <exclude body1="Head" body2="Chest"/>
234
+ <exclude body1="R_Knee" body2="R_Toe"/>
235
+ <exclude body1="R_Knee" body2="L_Ankle"/>
236
+ <exclude body1="R_Knee" body2="L_Toe"/>
237
+ <exclude body1="L_Knee" body2="L_Toe"/>
238
+ <exclude body1="L_Knee" body2="R_Ankle"/>
239
+ <exclude body1="L_Knee" body2="R_Toe"/>
240
+ <exclude body1="L_Shoulder" body2="Chest"/>
241
+ <exclude body1="R_Shoulder" body2="Chest"/>
242
+ </contact>
243
+ <sensor/>
244
+ <size njmax="700" nconmax="700"/>
245
+ </mujoco>
replay.py ADDED
@@ -0,0 +1,184 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import os
2
+ import joblib
3
+ import numpy as np
4
+ from isaacgym import gymapi, gymutil, gymtorch
5
+ import torch
6
+
7
+ # ---------------------------------------------------------
8
+ # Asset description class
9
+ # ---------------------------------------------------------
10
+ class AssetDesc:
11
+ def __init__(self, file_name, flip_visual_attachments=False):
12
+ self.file_name = file_name
13
+ self.flip_visual_attachments = flip_visual_attachments
14
+
15
+
16
+ # ---------------------------------------------------------
17
+ # Define assets
18
+ # ---------------------------------------------------------
19
+ asset_descriptors = [AssetDesc("smpl_humanoid.xml", False)]
20
+
21
+
22
+ # ---------------------------------------------------------
23
+ # Parse arguments
24
+ # ---------------------------------------------------------
25
+ args = gymutil.parse_arguments(
26
+ description="Visualize motion sequence in Isaac Gym",
27
+ custom_parameters=[
28
+ {
29
+ "name": "--asset_id",
30
+ "type": int,
31
+ "default": 0,
32
+ "help": f"Asset id (0 - {len(asset_descriptors) - 1})",
33
+ },
34
+ {
35
+ "name": "--show_axis",
36
+ "action": "store_true",
37
+ "help": "Visualize DOF axis",
38
+ },
39
+ {
40
+ "name": "--load_motion_path",
41
+ "type": str,
42
+ "default": "./CMU/01/01_01_poses.pkl",
43
+ "help": "Path to motion pickle file",
44
+ },
45
+ ],
46
+ )
47
+
48
+ if not (0 <= args.asset_id < len(asset_descriptors)):
49
+ print(f"*** Invalid asset_id specified. Valid range is 0 to {len(asset_descriptors) - 1}")
50
+ quit()
51
+
52
+
53
+ # ---------------------------------------------------------
54
+ # Initialize simulator
55
+ # ---------------------------------------------------------
56
+ gym = gymapi.acquire_gym()
57
+
58
+ sim_params = gymapi.SimParams()
59
+ sim_params.dt = 1.0 / 60.0
60
+ sim_params.up_axis = gymapi.UP_AXIS_Z
61
+ sim_params.gravity = gymapi.Vec3(0.0, 0.0, -9.81)
62
+
63
+ if args.physics_engine == gymapi.SIM_PHYSX:
64
+ sim_params.physx.solver_type = 1
65
+ sim_params.physx.num_position_iterations = 6
66
+ sim_params.physx.num_threads = args.num_threads
67
+ sim_params.physx.use_gpu = args.use_gpu
68
+ sim_params.use_gpu_pipeline = args.use_gpu_pipeline
69
+
70
+ if not args.use_gpu_pipeline:
71
+ print("WARNING: Forcing CPU pipeline.")
72
+
73
+ sim = gym.create_sim(args.compute_device_id, args.graphics_device_id, args.physics_engine, sim_params)
74
+ if sim is None:
75
+ print("*** Failed to create sim")
76
+ quit()
77
+
78
+
79
+ # ---------------------------------------------------------
80
+ # Ground and viewer setup
81
+ # ---------------------------------------------------------
82
+ plane_params = gymapi.PlaneParams()
83
+ plane_params.normal = gymapi.Vec3(0.0, 0.0, 1.0)
84
+ gym.add_ground(sim, plane_params)
85
+
86
+ viewer = gym.create_viewer(sim, gymapi.CameraProperties())
87
+ if viewer is None:
88
+ print("*** Failed to create viewer")
89
+ quit()
90
+
91
+
92
+ # ---------------------------------------------------------
93
+ # Load asset
94
+ # ---------------------------------------------------------
95
+ asset_root = "./assets"
96
+ asset_file = asset_descriptors[args.asset_id].file_name
97
+
98
+ asset_options = gymapi.AssetOptions()
99
+ asset_options.use_mesh_materials = True
100
+
101
+ print(f"Loading asset '{asset_file}' from '{asset_root}'")
102
+ asset = gym.load_asset(sim, asset_root, asset_file, asset_options)
103
+
104
+
105
+ # ---------------------------------------------------------
106
+ # Create environment
107
+ # ---------------------------------------------------------
108
+ num_envs = 1
109
+ num_per_row = 1
110
+ spacing = 5.0
111
+
112
+ env_lower = gymapi.Vec3(-spacing, -spacing, 0)
113
+ env_upper = gymapi.Vec3(spacing, spacing, spacing)
114
+
115
+ envs, actor_handles = [], []
116
+ num_dofs = gym.get_asset_dof_count(asset)
117
+
118
+ print(f"Creating {num_envs} environment(s)")
119
+ for i in range(num_envs):
120
+ env = gym.create_env(sim, env_lower, env_upper, num_per_row)
121
+ envs.append(env)
122
+
123
+ pose = gymapi.Transform()
124
+ actor_handle = gym.create_actor(env, asset, pose, "actor", i, 1)
125
+ actor_handles.append(actor_handle)
126
+
127
+ dof_states = np.zeros(num_dofs, dtype=gymapi.DofState.dtype)
128
+ gym.set_actor_dof_states(env, actor_handle, dof_states, gymapi.STATE_ALL)
129
+
130
+ gym.prepare_sim(sim)
131
+
132
+ # ---------------------------------------------------------
133
+ # Load motion sequence
134
+ # ---------------------------------------------------------
135
+ load_motion_path = args.load_motion_path
136
+ assert os.path.exists(load_motion_path), f"Motion file not found: {load_motion_path}"
137
+
138
+ motion = joblib.load(load_motion_path)
139
+ motion_length = len(motion["root_state"])
140
+ is_succ = motion.get("is_succ", True)
141
+
142
+ device = torch.device("cuda" if torch.cuda.is_available() else "cpu")
143
+
144
+ root_states = torch.from_numpy(motion["root_state"]).to(device)
145
+ dof_states = torch.from_numpy(motion["dof_state"]).to(device)
146
+
147
+ print(f"Loaded motion from {load_motion_path} ({motion_length} frames) - success: {is_succ}")
148
+
149
+
150
+ # ---------------------------------------------------------
151
+ # Simulation loop
152
+ # ---------------------------------------------------------
153
+ rigidbody_state = gymtorch.wrap_tensor(gym.acquire_rigid_body_state_tensor(sim)).reshape(num_envs, -1, 13)
154
+ actor_root_state = gymtorch.wrap_tensor(gym.acquire_actor_root_state_tensor(sim))
155
+
156
+ cam_pos = gymapi.Vec3(0, -5.0, 3)
157
+ cam_target = gymapi.Vec3(0, 0, 1)
158
+ gym.viewer_camera_look_at(viewer, None, cam_pos, cam_target)
159
+
160
+ time_step = 0
161
+ fps = 60.0
162
+ dt = 1.0 / fps
163
+
164
+ print("Starting playback...")
165
+
166
+ while not gym.query_viewer_has_closed(viewer):
167
+ motion_time = time_step % motion_length
168
+
169
+ if args.show_axis:
170
+ gym.clear_lines(viewer)
171
+
172
+ gym.set_actor_root_state_tensor(sim, gymtorch.unwrap_tensor(root_states[motion_time:motion_time + 1]))
173
+ gym.set_dof_state_tensor(sim, gymtorch.unwrap_tensor(dof_states[motion_time]))
174
+
175
+ gym.simulate(sim)
176
+ gym.fetch_results(sim, True)
177
+ gym.step_graphics(sim)
178
+ gym.draw_viewer(viewer, sim, True)
179
+ gym.sync_frame_time(sim)
180
+
181
+ time_step += 1
182
+
183
+ gym.destroy_viewer(viewer)
184
+ gym.destroy_sim(sim)