Skip to content

Commit 4a75d9f

Browse files
Update PathPlanning/TimeBasedPathPlanning/GridWithDynamicObstacles.py
Co-authored-by: Copilot <[email protected]>
1 parent f72082d commit 4a75d9f

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

PathPlanning/TimeBasedPathPlanning/GridWithDynamicObstacles.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -286,10 +286,7 @@ def get_safe_intervals_at_cell(self, cell: Position) -> list[Interval]:
286286
# Remove intervals where a cell is only free for one time step. Those intervals not provide enough time to
287287
# move into and out of the cell each take 1 time step, and the cell is considered occupied during
288288
# both the time step when it is entering the cell, and the time step when it is leaving the cell.
289-
for interval in intervals:
290-
if interval.start_time == interval.end_time:
291-
intervals.remove(interval)
292-
289+
intervals = [interval for interval in intervals if interval.start_time != interval.end_time]
293290
return intervals
294291

295292
show_animation = True

0 commit comments

Comments
 (0)