Skip to content

Commit ac1a903

Browse files
committed
fixed CI
1 parent ee423e8 commit ac1a903

File tree

4 files changed

+19
-19
lines changed

4 files changed

+19
-19
lines changed

PathPlanning/Dijkstra/dijkstra.py

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -24,11 +24,6 @@ def __init__(self, ox, oy, resolution, robot_radius):
2424
rr: robot radius[m]
2525
"""
2626

27-
self.resolution = resolution
28-
self.robot_radius = robot_radius
29-
self.calc_obstacle_map(ox, oy)
30-
self.motion = self.get_motion_model()
31-
3227
self.min_x = None
3328
self.min_y = None
3429
self.max_x = None
@@ -37,6 +32,11 @@ def __init__(self, ox, oy, resolution, robot_radius):
3732
self.y_width = None
3833
self.obstacle_map = None
3934

35+
self.resolution = resolution
36+
self.robot_radius = robot_radius
37+
self.calc_obstacle_map(ox, oy)
38+
self.motion = self.get_motion_model()
39+
4040
class Node:
4141
def __init__(self, x, y, cost, parent):
4242
self.x = x # index of grid
@@ -151,11 +151,11 @@ def verify_node(self, node):
151151

152152
if px < self.min_x:
153153
return False
154-
elif py < self.min_y:
154+
if py < self.min_y:
155155
return False
156-
elif px >= self.max_x:
156+
if px >= self.max_x:
157157
return False
158-
elif py >= self.max_y:
158+
if py >= self.max_y:
159159
return False
160160

161161
if self.obstacle_map[node.x][node.y]:
@@ -169,15 +169,15 @@ def calc_obstacle_map(self, ox, oy):
169169
self.min_y = round(min(oy))
170170
self.max_x = round(max(ox))
171171
self.max_y = round(max(oy))
172-
print("minx:", self.min_x)
173-
print("miny:", self.min_y)
174-
print("maxx:", self.max_x)
175-
print("maxy:", self.max_y)
172+
print("min_x:", self.min_x)
173+
print("min_y:", self.min_y)
174+
print("max_x:", self.max_x)
175+
print("max_y:", self.max_y)
176176

177177
self.x_width = round((self.max_x - self.min_x) / self.resolution)
178178
self.y_width = round((self.max_y - self.min_y) / self.resolution)
179-
print("xwidth:", self.x_width)
180-
print("ywidth:", self.y_width)
179+
print("x_width:", self.x_width)
180+
print("y_width:", self.y_width)
181181

182182
# obstacle map generation
183183
self.obstacle_map = [[False for _ in range(self.y_width)]

PathPlanning/VisibilityRoadMap/geometry.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,9 @@ def orientation(p, q, r):
1818
float(q.x - p.x) * (r.y - q.y))
1919
if val > 0:
2020
return 1
21-
elif val < 0:
21+
if val < 0:
2222
return 2
23-
else:
24-
return 0
23+
return 0
2524

2625
# Find the 4 orientations required for
2726
# the general and special cases

PathPlanning/VisibilityRoadMap/visibility_road_map.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -204,7 +204,8 @@ def main():
204204
if show_animation: # pragma: no cover
205205
plt.plot(sx, sy, "or")
206206
plt.plot(gx, gy, "ob")
207-
[ob.plot() for ob in obstacles]
207+
for ob in obstacles:
208+
ob.plot()
208209
plt.pause(1.0)
209210

210211
rx, ry = VisibilityRoadMap(robot_radius, do_plot=show_animation).planning(

PathPlanning/VoronoiRoadMap/dijkstra_search.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ def has_node_in_set(self, target_set, node):
121121
return False
122122

123123
def find_id(self, node_x_list, node_y_list, target_node):
124-
for i in range(len(node_x_list)):
124+
for i, _ in enumerate(node_x_list):
125125
if self.is_same_node_with_xy(node_x_list[i], node_y_list[i],
126126
target_node):
127127
return i

0 commit comments

Comments
 (0)