Skip to content

Commit 4ee7f35

Browse files
committed
[wip,broken,debug] Investigate slow performance on reset
1 parent 9205213 commit 4ee7f35

File tree

5 files changed

+319
-109
lines changed

5 files changed

+319
-109
lines changed

benchmarks/sim.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@
7777
import lsy_drone_racing
7878
7979
env = gymnasium.make('MultiDroneRacing-v0',
80-
n_envs=1, # TODO: Remove this for single-world envs
80+
n_envs=1000, # TODO: Remove this for single-world envs
8181
n_drones=config.env.n_drones,
8282
freq=config.env.freq,
8383
sim_config=config.sim,
@@ -87,6 +87,7 @@
8787
randomizations=config.env.get("randomizations"),
8888
random_resets=config.env.random_resets,
8989
seed=config.env.seed,
90+
device='gpu',
9091
)
9192
env.reset()
9293
env.step(env.action_space.sample()) # JIT compile

config/multi_level0.toml

-9
Original file line numberDiff line numberDiff line change
@@ -27,15 +27,6 @@ freq = 500 # Simulation frequency, in Hz
2727
attitude_freq = 500 # Controller frequency, in Hz. This frequency is used to simulate the onboard controller, NOT for the environment's step function
2828
gui = false # Enable/disable PyBullet's GUI
2929

30-
[sim.disturbances.action]
31-
type = "GaussianNoise"
32-
std = 0.001
33-
34-
[sim.disturbances.dynamics]
35-
type = "UniformNoise"
36-
low = [-0.1, -0.1, -0.1]
37-
high = [0.1, 0.1, 0.1]
38-
3930
[env]
4031
id = "MultiDroneRacing-v0" # Either "MultiDroneRacingEnv-v0" or "MultiDroneRacingAttitude-v0". If using "MultiDroneRacingAttitude-v0", the drone will use the attitude controller instead of the position controller.
4132
n_drones = 2 # Number of drones has to match the track configuration for drones

config/multi_level3.toml

+121
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,121 @@
1+
# Level 0
2+
3+
# | Evaluation Scenario | Rand. Inertial Properties | Randomized Obstacles, Gates | Rand. Between Episodes | Notes |
4+
# | :-----------------: | :-----------------------: | :-------------------------: | :--------------------: | :---------------: |
5+
# | `level0.toml` | *No* | *No* | *No* | Perfect knowledge |
6+
[controller]
7+
file = "trajectory_controller.py" # Put your controller file name here. Specifying a controller as argument to scripts will override this setting. Controllers are located in `lsy_drone_racing/control/`
8+
9+
[deploy]
10+
### Settings only relevant for deployment
11+
# Whether to check if gate and obstacle positions observed by vicon are within the limits defined down below.
12+
check_race_track = true
13+
# Whether to check if the drone start position is within the limits specified down below.
14+
check_drone_start_pos = true
15+
# Lets you practice your controller without putting up gates & obstacles, assumes nominal positions given below.
16+
practice_without_track_objects = false
17+
18+
[sim]
19+
# Physics options:
20+
# "analytical": Analytical, simplified dynamics model
21+
# "mujoco": Mujoco dynamics. May take longer to compile at startup.
22+
# "sys_id": System identification model.
23+
physics = "analytical"
24+
25+
camera_view = [5.0, -40.0, -40.0, 0.5, -1.0, 0.5]
26+
freq = 500 # Simulation frequency, in Hz
27+
attitude_freq = 500 # Controller frequency, in Hz. This frequency is used to simulate the onboard controller, NOT for the environment's step function
28+
gui = false # Enable/disable PyBullet's GUI
29+
30+
[env]
31+
id = "MultiDroneRacing-v0" # Either "MultiDroneRacingEnv-v0" or "MultiDroneRacingAttitude-v0". If using "MultiDroneRacingAttitude-v0", the drone will use the attitude controller instead of the position controller.
32+
n_drones = 2 # Number of drones has to match the track configuration for drones
33+
random_resets = true # Whether to re-seed the random number generator between episodes
34+
seed = 1337 # Random seed
35+
freq = 50 # Frequency of the environment's step function, in Hz
36+
symbolic = false # Whether to include symbolic expressions in the info dict. Note: This can interfere with multiprocessing! If you want to parallelize your training, set this to false.
37+
sensor_range = 0.45 # Range at which the exact location of gates and obstacles become visible to the drone. Objects that are not in the drone's sensor range report their nominal position.
38+
39+
[env.track]
40+
# Tall gates: 1.0m height. Short gates: 0.525m height. Height is measured from the ground to the
41+
# center of the gate.
42+
[[env.track.gates]]
43+
pos = [0.45, -1.0, 0.56]
44+
rpy = [0.0, 0.0, 2.35]
45+
[[env.track.gates]]
46+
pos = [1.0, -1.55, 1.11]
47+
rpy = [0.0, 0.0, -0.78]
48+
[[env.track.gates]]
49+
pos = [0.0, 0.5, 0.56]
50+
rpy = [0.0, 0.0, 0.0]
51+
[[env.track.gates]]
52+
pos = [-0.5, -0.5, 1.11]
53+
rpy = [0.0, 0.0, 3.14]
54+
55+
# Obstacle height: 1.4m. Height is measured from the ground to the top of the obstacle.
56+
[[env.track.obstacles]]
57+
pos = [1.0, -0.5, 1.4]
58+
[[env.track.obstacles]]
59+
pos = [0.5, -1.5, 1.4]
60+
[[env.track.obstacles]]
61+
pos = [-0.5, 0.0, 1.4]
62+
[[env.track.obstacles]]
63+
pos = [0.0, 1.0, 1.4]
64+
65+
[env.track.drone]
66+
pos = [[1.0, 1.0, 0.05], [1.2, 1.0, 0.05]]
67+
rpy = [[0, 0, 0], [0, 0, 0]]
68+
vel = [[0, 0, 0], [0, 0, 0]]
69+
rpy_rates = [[0, 0, 0], [0, 0, 0]]
70+
71+
[env.disturbances.action]
72+
fn = "normal"
73+
scale = 0.001
74+
75+
[env.disturbances.dynamics]
76+
fn = "uniform"
77+
[env.disturbances.dynamics.kwargs]
78+
minval = [-0.1, -0.1, -0.1]
79+
maxval = [0.1, 0.1, 0.1]
80+
81+
[env.randomizations.drone_pos]
82+
fn = "uniform"
83+
[env.randomizations.drone_pos.kwargs]
84+
minval = [-0.1, -0.1, 0.0]
85+
maxval = [0.1, 0.1, 0.02]
86+
87+
[env.randomizations.drone_rpy]
88+
fn = "uniform"
89+
[env.randomizations.drone_rpy.kwargs]
90+
minval = [-0.1, -0.1, -0.1]
91+
maxval = [0.1, 0.1, 0.1]
92+
93+
[env.randomizations.drone_mass]
94+
fn = "uniform"
95+
[env.randomizations.drone_mass.kwargs]
96+
minval = -0.01
97+
maxval = 0.01
98+
99+
[env.randomizations.drone_inertia]
100+
fn = "uniform"
101+
[env.randomizations.drone_inertia.kwargs]
102+
minval = [-0.000001, -0.000001, -0.000001]
103+
maxval = [0.000001, 0.000001, 0.000001]
104+
105+
[env.randomizations.gate_pos]
106+
fn = "uniform"
107+
[env.randomizations.gate_pos.kwargs]
108+
minval = [-0.15, -0.15, -0.1]
109+
maxval = [0.15, 0.15, 0.1]
110+
111+
[env.randomizations.gate_rpy]
112+
fn = "uniform"
113+
[env.randomizations.gate_rpy.kwargs]
114+
minval = [0.0, 0.0, -0.1]
115+
maxval = [0.0, 0.0, 0.1]
116+
117+
[env.randomizations.obstacle_pos]
118+
fn = "uniform"
119+
[env.randomizations.obstacle_pos.kwargs]
120+
minval = [-0.15, -0.15, -0.05]
121+
maxval = [0.15, 0.15, 0.05]

0 commit comments

Comments
 (0)