-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathConfigs.py
126 lines (109 loc) · 3.88 KB
/
Configs.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
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
import numpy as np
from numpy import pi
from Curriculum import curriculum_fn
from Interval import Interval
# no randomization
config = {
"env": "Quadcopter",
# "env_task_fn": curriculum_fn,
"env_config": {
# time step [s]
"dt": 0.005,
# gravitational acceleration in world coordinate system [m/s^2]
"grav_acc": np.array([0, 0, -9.81]),
# mass of quadcopter [kg]
"standard_mass": 0.031,
# distance from quadcopter center to propeller center [m]
"standard_arm_length": 0.04,
# motor 2% settling time [s]
"standard_settling_time": 0.15,
# thrust to weight ratio []
"standard_thrust_to_weight": 1.9,
# thrust to torque coefficient []
"standard_thrust_to_torque": 0.006,
# goal position [m]
"goal_pos": np.array([0, 0, 0]),
# goal linear velocity [m/s]
"goal_lin_vel": np.zeros(3),
# goal angles [rad]
"goal_ang": np.zeros(3),
# goal angular velocity [rad/s]
"goal_ang_vel": np.zeros(3),
# maximal positional error to sample from [m]
"max_pos_err": Interval(low=-1, high=1),
# maximal linear velocity to sample from [m/s]
"max_lin_vel": Interval(low=-1, high=1),
# maximal angles to sample from [rad]
"max_ang": Interval(low=-pi, high=pi),
# maximal angular velocity to sample from [rad/s]
"max_ang_vel": Interval(low=-2*pi, high=2*pi),
# percentage used to randomize quadcopter parameters
"percentage": 0.1,
# non negative scalar weights (pos_err, lin_vel_err, rot_ang, ang_vel_err, action) for reward/cost function
"weights": np.array([1, 0, 0, 0.05, 0.05]),
"level": 0,
},
"model": {
"fcnet_hiddens": [64, 64],
},
"num_workers": 6,
"num_cpus_per_worker": 1,
"framework": "torch",
# "batch_mode": "trunvanate_episodes",
# discount factor of the MDP
# "gamma": 0.995,
# number of steps per episode
"horizon": 800,
# "soft_horizon": True,
# "lambda": 0.95,
# "kl_coeff": 1,
# the agent is never done
"no_done_at_end": True,
"rollout_fragment_length": 200,
"sgd_minibatch_size": 2048,
"num_sgd_iter": 30,
"train_batch_size": 28800,
"lr": 0.00005,
"clip_param": 0.05,
}
config_plot = {
"env_config": {
# time step [s]
"dt": 0.005,
# gravitational acceleration in world coordinate system [m/s^2]
"grav_acc": np.array([0, 0, -9.81]),
# mass of quadcopter [kg]
"standard_mass": 0.031,
# distance from quadcopter center to propeller center [m]
"standard_arm_length": 0.04,
# motor 2% settling time [s]
"standard_settling_time": 0.15,
# thrust to weight ratio []
"standard_thrust_to_weight": 2.0,
# thrust to torque coefficient []
"standard_thrust_to_torque": 0.006,
# goal position [m]
"goal_pos": np.array([0, 0, 0]),
# goal linear velocity [m/s]
"goal_lin_vel": np.array([0, 0, 0]),
# goal angles [rad]
"goal_ang": np.zeros(3),
# goal angular velocity [rad/s]
"goal_ang_vel": np.zeros(3),
# maximal positional error to sample from [m]
"max_pos_err": Interval(low=-1, high=1),
# maximal linear velocity to sample from [m/s]
"max_lin_vel": Interval(low=-1, high=1),
# maximal angles to sample from [rad]
"max_ang": Interval(low=-pi, high=pi),
# maximal angular velocity to sample from [rad/s]
"max_ang_vel": Interval(low=-2*pi, high=2*pi),
# percentage used to randomize quadcopter parameters
"percentage": 0.05,
"level": 0,
# non negative scalar weights (pos_err, lin_vel_err, rot_ang, ang_vel_err, action) for reward/cost function
"weights": np.array([1, 0, 0, 0.05, 0.05]),
},
}
stop = {
}