Skip to content

Commit

Permalink
Use union for python3.8 compatibility
Browse files Browse the repository at this point in the history
  • Loading branch information
AhmadAmine998 committed Jun 7, 2024
1 parent 8d9f1db commit 597b0f8
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion f1tenth_gym/envs/track/cubic_spline.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
import scipy.optimize as so
from scipy import interpolate
from numba import njit
from typing import Union

@njit(fastmath=False, cache=True)
def nearest_point_on_trajectory(point, trajectory):
Expand Down Expand Up @@ -94,7 +95,7 @@ def __calc_s(self, x: np.ndarray, y: np.ndarray) -> np.ndarray:
s.extend(np.cumsum(self.ds))
return np.array(s)

def calc_position(self, s: float) -> tuple[float | None, float | None]:
def calc_position(self, s: float) -> tuple[Union[float, None], Union[float, None]]:
"""
Calc position at the given s.
Expand Down

0 comments on commit 597b0f8

Please sign in to comment.