Skip to content

Commit 5bd8d42

Browse files
committed
copilot review
1 parent 46646f4 commit 5bd8d42

5 files changed

Lines changed: 11 additions & 7 deletions

File tree

PathPlanning/TimeBasedPathPlanning/GridWithDynamicObstacles.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,7 @@ def generate_narrow_corridor_obstacles(self, obs_count: int) -> list[list[Positi
177177
continue
178178

179179
obstacle_path = []
180-
x = 10 # middle of the grid
180+
x = self.grid_size[0] // 2 # middle of the grid
181181
for t in range(0, self.time_limit - 1):
182182
obstacle_path.append(Position(x, y))
183183

PathPlanning/TimeBasedPathPlanning/Plotting.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ def PlotNodePaths(grid: Grid, start_and_goals: list[StartAndGoal], paths: list[N
113113

114114
# Update each agent's position
115115
for (j, path) in enumerate(paths):
116-
path_postitions = []
116+
path_positions = []
117117
if i <= path.goal_reached_time():
118118
res = path.get_position(i)
119119
if not res:
@@ -125,8 +125,8 @@ def PlotNodePaths(grid: Grid, start_and_goals: list[StartAndGoal], paths: list[N
125125

126126
# Verify position is valid
127127
assert not path_position in obs_positions
128-
assert not path_position in path_postitions
129-
path_postitions.append(path_position)
128+
assert not path_position in path_positions
129+
path_positions.append(path_position)
130130

131131
path_plots[j].set_data([path_position.x], [path_position.y])
132132

PathPlanning/TimeBasedPathPlanning/PriorityBasedPlanner.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ def plan(grid: Grid, start_and_goals: list[StartAndGoal], single_agent_planner_c
2929
Returns the re-ordered StartAndGoal combinations, and a list of path plans. The order of the plans
3030
corresponds to the order of the `start_and_goals` list.
3131
"""
32-
print(f"Using planner: {single_agent_planner_class}")
32+
print(f"Using single-agent planner: {single_agent_planner_class.__name__}")
3333

3434
# Reserve initial positions
3535
for start_and_goal in start_and_goals:

PathPlanning/TimeBasedPathPlanning/SafeInterval.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,9 @@ def plan(grid: Grid, start: Position, goal: Position, verbose: bool = False) ->
7070
continue
7171

7272
if expanded_node.position == goal:
73-
print(f"Found path to goal after {len(expanded_list)} expansions")
73+
if verbose:
74+
print(f"Found path to goal after {len(expanded_list)} expansions")
75+
7476
path = []
7577
path_walker: SIPPNode = expanded_node
7678
while True:

PathPlanning/TimeBasedPathPlanning/SpaceTimeAStar.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,9 @@ def plan(grid: Grid, start: Position, goal: Position, verbose: bool = False) ->
4343
continue
4444

4545
if expanded_node.position == goal:
46-
print(f"Found path to goal after {len(expanded_list)} expansions")
46+
if verbose:
47+
print(f"Found path to goal after {len(expanded_list)} expansions")
48+
4749
path = []
4850
path_walker: Node = expanded_node
4951
while True:

0 commit comments

Comments
 (0)