Skip to content

Commit

Permalink
Add type asserts to fix the rest of mypy errors
Browse files Browse the repository at this point in the history
  • Loading branch information
bjsowa committed Jun 26, 2024
1 parent 6880965 commit f5815d8
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions leo_docking/leo_docking/states/reach_docking_area.py
Original file line number Diff line number Diff line change
Expand Up @@ -161,13 +161,17 @@ def _get_speed(
self, route_left: float, route_done: float, direction: float
) -> float:
if self.angle:
assert isinstance(self.params, RotateToDockAreaParams) or isinstance(
self.params, RotateToBoardParams
)
return direction * translate(
route_left - route_done,
self.params.angle_min,
self.params.angle_max,
self.params.speed_min,
self.params.speed_max,
)
assert isinstance(self.params, RideToDockArea)
return direction * translate(
route_left - route_done,
self.params.dist_min,
Expand Down

0 comments on commit f5815d8

Please sign in to comment.