11
11
from lsy_drone_racing .vicon import Vicon
12
12
13
13
if TYPE_CHECKING :
14
- from munch import Munch
14
+ from ml_collections import ConfigDict
15
15
16
16
logger = logging .getLogger ("rosout." + __name__ )
17
17
18
18
19
- def check_race_track (config : Munch ):
19
+ def check_race_track (config : ConfigDict ):
20
20
"""Check if the race track's gates and obstacles are within tolerances.
21
21
22
22
Args:
@@ -33,13 +33,13 @@ def check_race_track(config: Munch):
33
33
assert rng_info .gate_pos .type == "uniform" , "Race track checks expect uniform distributions"
34
34
assert rng_info .obstacle_pos .type == "uniform" , "Race track checks expect uniform distributions"
35
35
for i , gate in enumerate (config .env .track .gates ):
36
- name = f"gate{ i + 1 } "
36
+ name = f"gate{ i + 1 } "
37
37
gate_pos , gate_rot = vicon .pos [name ], R .from_euler ("xyz" , vicon .rpy [name ])
38
38
check_bounds (name , gate_pos , gate .pos , rng_info .gate_pos .low , rng_info .gate_pos .high )
39
39
check_rotation (name , gate_rot , R .from_euler ("xyz" , gate .rpy ), ang_tol )
40
40
41
41
for i , obstacle in enumerate (config .env .track .obstacles ):
42
- name = f"obstacle{ i + 1 } "
42
+ name = f"obstacle{ i + 1 } "
43
43
low , high = rng_info .obstacle_pos .low , rng_info .obstacle_pos .high
44
44
check_bounds (name , vicon .pos [name ][:2 ], obstacle .pos [:2 ], low [:2 ], high [:2 ])
45
45
@@ -66,7 +66,7 @@ def check_rotation(name: str, actual_rot: R, desired_rot: R, ang_tol: float):
66
66
raise RuntimeError (f"{ name } exceeds rotation tolerances ({ ang_tol } )" )
67
67
68
68
69
- def check_drone_start_pos (config : Munch ):
69
+ def check_drone_start_pos (config : ConfigDict ):
70
70
"""Check if the real drone start position matches the settings.
71
71
72
72
Args:
0 commit comments