Skip to content

Commit

Permalink
REnamed frenet utils test to cubic spline test
Browse files Browse the repository at this point in the history
AhmadAmine998 committed Jun 7, 2024
1 parent e6d95c9 commit 27914b8
Showing 1 changed file with 2 additions and 9 deletions.
11 changes: 2 additions & 9 deletions tests/test_frenet_utils.py → tests/test_cubic_spline.py
Original file line number Diff line number Diff line change
@@ -6,9 +6,9 @@
import os
import sys
sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
from f1tenth_gym.envs.track import Track, cubic_spline
from f1tenth_gym.envs.track import cubic_spline

class TestFrenet(unittest.TestCase):
class TestCubicSpline(unittest.TestCase):
def test_calc_curvature(self):
circle_x = np.cos(np.linspace(0, 2 * np.pi, 100))[:-1]
circle_y = np.sin(np.linspace(0, 2 * np.pi, 100))[:-1]
@@ -61,10 +61,3 @@ def test_calc_arclength_inaccurate(self):
self.assertAlmostEqual(track.calc_arclength_inaccurate(0, 1)[0], np.pi/2, places=2)
self.assertAlmostEqual(track.calc_arclength_inaccurate(-1, 0)[0], np.pi, places=2)
self.assertAlmostEqual(track.calc_arclength_inaccurate(0, -1)[0], 3*np.pi/2, places=2)

if __name__ == "__main__":
TestFrenet().test_calc_curvature()
TestFrenet().test_calc_yaw()
TestFrenet().test_calc_position()
TestFrenet().test_calc_arclength()
TestFrenet().test_calc_arclength_inaccurate()

0 comments on commit 27914b8

Please sign in to comment.