File tree Expand file tree Collapse file tree 1 file changed +33
-0
lines changed Expand file tree Collapse file tree 1 file changed +33
-0
lines changed Original file line number Diff line number Diff line change
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__ )
You can’t perform that action at this time.
0 commit comments