Skip to content

Commit

Permalink
chore: extra fail-safe, so it won't crash here in any way (unlikely)
Browse files Browse the repository at this point in the history
  • Loading branch information
HeadTriXz committed Jun 12, 2024
1 parent 8160074 commit c5c2a15
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/utils/parking.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,9 @@ def __estimate_length(self) -> None:
"""Estimate the length of the parking space."""
angle_front = self.__lidar.find_nearest_angle(200, 250)
angle_back = self.__lidar.find_nearest_angle(280, 320)
if angle_front == -1 or angle_back == -1:
return

angle_diff = math.radians(angle_back - angle_front)

dist_front = self.__lidar.scan_data[angle_front]
Expand Down

0 comments on commit c5c2a15

Please sign in to comment.