Skip to content

Commit 0de8fe2

Browse files
committed
feat: Elastic Bands update
1 parent 859d493 commit 0de8fe2

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

PathPlanning/ElasticBands/elastic_bands.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030

3131
# Visualization Params
3232
ENABLE_PLOT = True
33-
ENABLE_INTERACTIVE = True
33+
ENABLE_INTERACTIVE = False
3434
ENABLE_SAVE_DATA = False
3535
MAX_ITER = 50
3636

@@ -210,7 +210,8 @@ def plot_background(self):
210210
markersize=8,
211211
)
212212

213-
self.ax.imshow(self.obstacles.T, origin="lower", cmap="binary", alpha=0.3)
213+
self.ax.imshow(self.obstacles.T, origin="lower", cmap="binary", alpha=0.8)
214+
self.ax.plot([], [], color="black", label="obstacles")
214215
if self.elastic_band is not None:
215216
path = [b.pos.tolist() for b in self.elastic_band.bubbles]
216217
path = np.array(path)
@@ -222,8 +223,9 @@ def plot_background(self):
222223
)
223224
self.ax.add_patch(circle)
224225
self.ax.plot(bubble.pos[0], bubble.pos[1], "bo", markersize=10)
226+
self.ax.plot([], [], color="green", label="bubbles")
225227

226-
self.ax.legend()
228+
self.ax.legend(loc="upper right")
227229
plt.draw()
228230
plt.pause(0.01)
229231

0 commit comments

Comments
 (0)