Skip to content

Commit

Permalink
update frenet conversion
Browse files Browse the repository at this point in the history
  • Loading branch information
hzheng40 committed Sep 16, 2024
1 parent c4dd6bb commit 9e49830
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion f1tenth_gym/envs/track/cubic_spline.py
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ def calc_arclength_inaccurate(self, x: float, y: float) -> tuple[float, float]:
+ t * (self.s[min_dist_segment + 1] - self.s[min_dist_segment])
)

return s, 0.0
return s, ey

def _calc_tangent(self, s: float) -> np.ndarray:
"""
Expand Down
2 changes: 1 addition & 1 deletion f1tenth_gym/envs/track/track.py
Original file line number Diff line number Diff line change
Expand Up @@ -276,7 +276,7 @@ def cartesian_to_frenet(self, x, y, phi, s_guess=0):
ey: lateral deviation
ephi: heading deviation
"""
s, ey = self.centerline.spline.calc_arclength(x, y, s_guess)
s, ey = self.centerline.spline.calc_arclength_inaccurate(x, y)
if s > self.centerline.spline.s[-1]:
# Wrap around
s = s - self.centerline.spline.s[-1]
Expand Down

0 comments on commit 9e49830

Please sign in to comment.