Skip to content

Commit

Permalink
Add unions to calc yaw and calc curvature
Browse files Browse the repository at this point in the history
  • Loading branch information
AhmadAmine998 committed Jun 7, 2024
1 parent 597b0f8 commit d6f60e0
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions f1tenth_gym/envs/track/cubic_spline.py
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ def calc_position(self, s: float) -> tuple[Union[float, None], Union[float, None
"""
return self.spline(s)

def calc_curvature(self, s: float) -> float | None:
def calc_curvature(self, s: float) -> Union[float , None]:
"""
Calc curvature at the given s.
Expand All @@ -134,7 +134,7 @@ def calc_curvature(self, s: float) -> float | None:
k = (ddy * dx - ddx * dy) / ((dx**2 + dy**2) ** (3 / 2))
return k

def calc_yaw(self, s: float) -> float | None:
def calc_yaw(self, s: float) -> Union[float, None]:
"""
Calc yaw angle at the given s.
Expand Down

0 comments on commit d6f60e0

Please sign in to comment.