Skip to content

Commit 29e9b73

Browse files
committed
add sipp test
1 parent 1f8a112 commit 29e9b73

File tree

1 file changed

+33
-0
lines changed

1 file changed

+33
-0
lines changed
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
from PathPlanning.TimeBasedPathPlanning.GridWithDynamicObstacles import (
2+
Grid,
3+
ObstacleArrangement,
4+
Position,
5+
)
6+
from PathPlanning.TimeBasedPathPlanning import SafeInterval as m
7+
import numpy as np
8+
import conftest
9+
10+
11+
def test_1():
12+
start = Position(1, 11)
13+
goal = Position(19, 19)
14+
grid_side_length = 21
15+
grid = Grid(
16+
np.array([grid_side_length, grid_side_length]),
17+
obstacle_arrangement=ObstacleArrangement.ARRANGEMENT1,
18+
)
19+
20+
m.show_animation = False
21+
planner = m.SafeIntervalPathPlanner(grid, start, goal)
22+
23+
path = planner.plan(False)
24+
25+
# path should have 28 entries
26+
assert len(path.path) == 31
27+
28+
# path should end at the goal
29+
assert path.path[-1].position == goal
30+
31+
32+
if __name__ == "__main__":
33+
conftest.run_this_test(__file__)

0 commit comments

Comments
 (0)