-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathconfig_RPG.py
More file actions
147 lines (128 loc) · 4.78 KB
/
config_RPG.py
File metadata and controls
147 lines (128 loc) · 4.78 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
import sys
sys.path.append("..")
sys.path.append("../unitree_robots/scripts")
# -------------------- for modify panel --------------------
RUN_MODE = "real" # "real", "mujoco"
MOTOR_ENABLE = True # True for enable motors in real robot
## for capture video
policy_path = [
"ckpt/rpg_jump_2_7.onnx",
"ckpt/rpg_jump_2_7.onnx",
"ckpt/rpg_jump_2_7.onnx",
"ckpt/0918/rpg_kpjs_27_5333.onnx",
"ckpt/0920_final_test/rpg_kpjs_0920_finaltest_27_5333.onnx",
]
motion_len = [2.7, 2.7, 2.7, 27.5333, 27.5333]
# -------------------- for remotor --------------------
KEY_LIST_keyboard = ['SPACE', 'M', 'J', 'K', 'L', 'U', 'I']
KEY_LIST_remotor = ['R1', 'X', 'A', 'B', 'Y']
# -------------------- for default setting --------------------
ROBOT = "g1" # Robot name, "go2", "b2", "b2w", "h1", "go2w", "g1"
ROBOT_SCENE = "../unitree_robots/" + ROBOT + "/g1_29dof_anneal_23dof.xml" # Robot scene
# DOMAIN_ID = 1 # Domain id
# INTERFACE = "lo" # Interface
USE_JOYSTICK = 0 # Simulate Unitree WirelessController using a gamepad, default = 1
JOYSTICK_TYPE = "xbox" # support "xbox" and "switch" gamepad layout
JOYSTICK_DEVICE = 0 # Joystick number
PRINT_SCENE_INFORMATION = True # Print link, joint and sensors information of robot
ENABLE_ELASTIC_BAND = False # Virtual spring band on root, used for lifting robot
SIMULATE_DT = 0.002 # Timestep in mujoco, need to be larger than the runtime of viewer.sync()
VIEWER_DT = 0.02 # 50 fps for viewer
CONTROL_DT = 0.02 # 50 fps for control
# -------------------- for decimation --------------------
decimation = True
q0 = [-0.4088, 0.0064, -0.0047, 0.9126]
# -------------------- for policy --------------------
loco_policy = "ckpt/robomimic_locomotion_29dof.pt"
# -------------------- for general --------------------
# control
action_scale = 0.25
joints_used_idx = [0, 1, 2, 3, 4, 5,
6, 7, 8, 9, 10, 11,
12, 13, 14,
15, 16, 17, 18,
22, 23, 24, 25]
kps = [200., 100., 100., 200., 50., 50.,
200., 100., 100., 200., 50., 50.,
400., 400., 400.,
100., 100., 50., 50.,
100., 100., 50., 50.]
kds = [2., 2., 2., 4., 2., 2.,
2., 2., 2., 4., 2., 2.,
5., 5., 5.,
2., 2., 2., 2., 2., 2., 2., 2.]
joints_noused_idx = [19, 20, 21, 26, 27, 28]
noused_kps = [40., 40., 40., 40., 40., 40.]
noused_kds = [1., 1., 1., 1., 1., 1.]
# initial pose
default_angles = [-0.1, 0., 0., 0.3, -0.2, 0.,
-0.1, 0., 0., 0.3, -0.2, 0.,
0., 0., 0.,
0.2, 0.2, 0., 0.9,
0.2, -0.2, 0., 0.9]
# obs scale
base_lin_vel_scale = 2.0
ang_vel_scale = 0.25
projected_gravity_scale = 1.0
dof_pos_scale = 1.0
dof_vel_scale = 0.05
actions_scale = 1.0
dif_local_rigid_body_pos_scale = 1.0
local_ref_rigid_body_pos_scale = 1.0
ref_motion_phase_scale = 1.0
history_actor_scale = 1.0
history_critic_scale = 1.0
# policy
clip_observations = 100.0
clip_action_limit = 100.0
tau_limit = [88., 139., 88., 139., 50., 50.,
88., 139., 88., 139., 50., 50.,
88., 50., 50.,
25., 25., 25., 25., 25., 25., 25., 25.]
# history handler
history_obs_auxiliary = {}
history_obs_auxiliary['ang_vel'] = 4
history_obs_auxiliary['projected_gravity'] = 4
history_obs_auxiliary['dof_pos'] = 4
history_obs_auxiliary['dof_vel'] = 4
history_obs_auxiliary['actions'] = 4
history_obs_auxiliary['ref_motion_phase'] = 4
obs_dims = {}
obs_dims['ang_vel'] = 3
obs_dims['projected_gravity'] = 3
obs_dims['dof_pos'] = 23
obs_dims['dof_vel'] = 23
obs_dims['actions'] = 23
obs_dims['dif_local_rigid_body_pos'] = 81
obs_dims['local_ref_rigid_body_pos'] = 81
obs_dims['ref_motion_phase'] = 1
# -------------------- for sim --------------------
# motion
decimation = 10
# -------------------- for locomotion --------------------
loco_kps = [200., 150., 150., 200., 20., 20.,
200., 150., 150., 200., 20., 20.,
200., 200., 200.,
100., 100., 50., 50.,
100., 100., 50., 50.]
loco_kds = [5., 5., 5., 5., 2., 2.,
5., 5., 5., 5., 2., 2.,
5., 5., 5.,
2., 2., 2., 2., 2., 2., 2., 2.]
loco_default_angles = [-0.2, -0.2, 0.0,
0.0, 0.0, 0.0,
0.0, 0.0, 0.0,
0.42, 0.42, 0.35, 0.35,
-0.23, -0.23, 0.18, -0.18,
0.0, 0.0, 0.0, 0.0,
0.87, 0.87,
0.0, 0.0,
0.0, 0.0,
0.0, 0.0]
loco_joints_23_idx = [0, 6, 12,
1, 7, 13,
2, 8, 14,
3, 9, 15, 19,
4, 10, 16, 20,
5, 11, 17, 21,
18, 22]