-
Notifications
You must be signed in to change notification settings - Fork 16
/
WooferConfig.py
63 lines (52 loc) · 1.93 KB
/
WooferConfig.py
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
import numpy as np
class WooferConfig:
def __init__(self):
# Robot joint limits
self.MAX_JOINT_TORQUE = 12
self.MAX_LEG_FORCE = 133
self.REVOLUTE_RANGE = 3
self.PRISMATIC_RANGE = 0.18
# Robot geometry
self.LEG_FB = 0.23 # front-back distance from center line to leg axis
self.LEG_LR = 0.175 # left-right distance from center line to leg plane
self.LEG_L = 0.32
self.ABDUCTION_OFFSET = 0 # distance from abduction axis to leg
self.FOOT_RADIUS = 0.02
# Robot inertia params
self.MASS = 8.0 # kg
(self.L,self.W,self.T) = (0.66, 0.176, 0.092)
Ix = self.MASS/12 * (self.W**2 + self.T**2)
Iy = self.MASS/12 * (self.L**2 + self.T**2)
Iz = self.MASS/12 * (self.L**2 + self.W**2)
self.INERTIA = np.zeros((3,3))
self.INERTIA[0,0] = Ix
self.INERTIA[1,1] = Iy
self.INERTIA[2,2] = Iz
self.JOINT_NOISE = 0.5 # Nm, 1 sigma of gaussian noise
self.LATENCY = 1 # ms of sense->control latency
self.UPDATE_PERIOD = 1 # ms between control updates
class EnvironmentConfig:
def __init__(self):
self.MU = 1.5 # coeff friction
self.SIM_STEPS = 1500 # simulation steps to take
self.DT = 0.001 # timestep [s]
# Software stuff
class QPConfig:
def __init__(self):
self.ALPHA = 1e-3 # penalty on the 2norm of foot forces
self.BETA = 1e-1 # penalty coefficient for the difference in foot forces between time steps
self.GAMMA = 200 # scale factor to penalize deviations in angular acceleration compared to linear accelerations
self.MU = 1.0 # friction coefficient
class SwingControllerConfig:
def __init__(self):
self.STEP_HEIGHT = 0.08 # [m]
self.KP = np.array([400,400,2000]) # [Nm/rad, Nm/rad, N/m]
class GaitPlannerConfig:
def __init__(self):
self.STEP_LENGTH = 0.15 # [m]
self.D = 0.8 # [s]
WOOFER_CONFIG = WooferConfig()
QP_CONFIG = QPConfig()
SWING_CONTROLLER_CONFIG = SwingControllerConfig()
GAIT_PLANNER_CONFIG = GaitPlannerConfig()
ENVIRONMENT_CONFIG = EnvironmentConfig()