File tree Expand file tree Collapse file tree 1 file changed +11
-2
lines changed
Expand file tree Collapse file tree 1 file changed +11
-2
lines changed Original file line number Diff line number Diff line change 44
55
66def test_1 ():
7- path = np .load ("PathPlanning/ElasticBands/points.npy" )
8- obstacles = np .load ("PathPlanning/ElasticBands/obstacles.npy" )
7+ path = np .load ("PathPlanning/ElasticBands/path.npy" )
8+ obstacles_points = np .load ("PathPlanning/ElasticBands/obstacles.npy" )
9+ obstacles = np .zeros ((500 , 500 ))
10+ for x , y in obstacles_points :
11+ size = 30 # Side length of the square
12+ half_size = size // 2
13+ x_start = max (0 , x - half_size )
14+ x_end = min (obstacles .shape [0 ], x + half_size )
15+ y_start = max (0 , y - half_size )
16+ y_end = min (obstacles .shape [1 ], y + half_size )
17+ obstacles [x_start :x_end , y_start :y_end ] = 1
918 elastic_bands = ElasticBands (path , obstacles )
1019 elastic_bands .update_bubbles ()
1120
You can’t perform that action at this time.
0 commit comments