utils.checks¶
lsy_drone_racing.utils.checks
¶
Separate module for all checks used in the environments.
Functions:¶
check_bounds(name, actual, desired, low, high)
¶
Check if the actual value is within the specified bounds of the desired value.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
name
|
str
|
Name of the object being checked. |
required |
actual
|
NDArray
|
Values to check. |
required |
desired
|
NDArray
|
Reference values. |
required |
low
|
NDArray
|
Lower bound. Minimum permissible value of (actual - desired). |
required |
high
|
NDArray
|
Upper bound. Maximum value of (actual - desired). |
required |
Raises:
| Type | Description |
|---|---|
RuntimeError
|
The values are not in the permissible interval. |
Source code in lsy_drone_racing/utils/checks.py
check_drone_start_pos(nominal_pos, real_pos, rng_config, drone_name)
¶
Check if the real drone start position matches the settings.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
nominal_pos
|
NDArray
|
Nominal drone position. |
required |
real_pos
|
NDArray
|
Current drone position. |
required |
rng_config
|
ConfigDict
|
Environment randomization config. |
required |
drone_name
|
str
|
Name of the drone (e.g. cf10). |
required |
Source code in lsy_drone_racing/utils/checks.py
check_race_track(gates_pos, nominal_gates_pos, gates_quat, nominal_gates_quat, obstacles_pos, nominal_obstacles_pos, rng_config)
¶
Check if the race track's gates and obstacles are within tolerances.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
gates_pos
|
NDArray
|
The positions of the gates. |
required |
nominal_gates_pos
|
NDArray
|
The nominal positions of the gates. |
required |
gates_quat
|
NDArray
|
The orientations of the gates as quaternions. |
required |
nominal_gates_quat
|
NDArray
|
The nominal orientations of the gates as quaternions. |
required |
obstacles_pos
|
NDArray
|
The positions of the obstacles. |
required |
nominal_obstacles_pos
|
NDArray
|
The nominal positions of the obstacles. |
required |
rng_config
|
ConfigDict
|
Environment randomization config. |
required |
Source code in lsy_drone_racing/utils/checks.py
check_rotation(name, actual_rot, desired_rot, low, high)
¶
Compare gate orientations in world-frame Euler xyz.
Warning
Comparing Euler angles is tricky. While we try to sanitize the comparison as best as we can, edge cases may still cause failures.
Todo
Switch to a more sane rotation check method.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
name
|
str
|
Name of the object being checked. |
required |
actual_rot
|
Rotation
|
R object describing rotation of the real object. |
required |
desired_rot
|
Rotation
|
R object describing rotation of the nominal object. |
required |
low
|
NDArray
|
Array designating the per axis rotation lower limit |
required |
high
|
NDArray
|
Array designating the per axis rotation higher limit |
required |