Skip to content

Commit bd2ca49

Browse files
committed
add dubinspath unit test
1 parent ccdda32 commit bd2ca49

File tree

1 file changed

+24
-0
lines changed

1 file changed

+24
-0
lines changed

tests/test_dubins_path_planning.py

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
from unittest import TestCase
2+
from PathPlanning.DubinsPath import dubins_path_planning
3+
import math
4+
5+
6+
class Test(TestCase):
7+
8+
def test1(self):
9+
start_x = 1.0 # [m]
10+
start_y = 1.0 # [m]
11+
start_yaw = math.radians(45.0) # [rad]
12+
13+
end_x = -3.0 # [m]
14+
end_y = -3.0 # [m]
15+
end_yaw = math.radians(-45.0) # [rad]
16+
17+
curvature = 1.0
18+
19+
px, py, pyaw, mode, clen = dubins_path_planning.dubins_path_planning(
20+
start_x, start_y, start_yaw, end_x, end_y, end_yaw, curvature)
21+
22+
assert(abs(px[-1] - end_x) <= 0.1)
23+
assert(abs(py[-1] - end_y) <= 0.1)
24+
assert(abs(pyaw[-1] - end_yaw) <= 0.1)

0 commit comments

Comments
 (0)