mirror of
https://github.com/AtsushiSakai/PythonRobotics.git
synced 2026-04-22 03:00:22 -04:00
Update loop conditions to be more idiomatic; fix missing imports (#768)
* missing import * use while true
This commit is contained in:
@@ -162,7 +162,7 @@ class LShapeFitting:
|
||||
S.append(C)
|
||||
|
||||
# Merge cluster
|
||||
while 1:
|
||||
while True:
|
||||
no_change = True
|
||||
for (c1, c2) in list(itertools.permutations(range(len(S)), 2)):
|
||||
if S[c1] & S[c2]:
|
||||
|
||||
@@ -71,7 +71,7 @@ class AStarPlanner:
|
||||
open_set, closed_set = dict(), dict()
|
||||
open_set[self.calc_grid_index(start_node)] = start_node
|
||||
|
||||
while 1:
|
||||
while True:
|
||||
if len(open_set) == 0:
|
||||
print("Open set is empty..")
|
||||
break
|
||||
|
||||
@@ -75,7 +75,7 @@ class BidirectionalAStarPlanner:
|
||||
current_B = goal_node
|
||||
meet_point_A, meet_point_B = None, None
|
||||
|
||||
while 1:
|
||||
while True:
|
||||
if len(open_set_A) == 0:
|
||||
print("Open set A is empty..")
|
||||
break
|
||||
|
||||
@@ -76,7 +76,7 @@ class BidirectionalBreadthFirstSearchPlanner:
|
||||
|
||||
meet_point_A, meet_point_B = None, None
|
||||
|
||||
while 1:
|
||||
while True:
|
||||
if len(open_set_A) == 0:
|
||||
print("Open set A is empty..")
|
||||
break
|
||||
|
||||
@@ -67,7 +67,7 @@ class BreadthFirstSearchPlanner:
|
||||
open_set, closed_set = dict(), dict()
|
||||
open_set[self.calc_grid_index(nstart)] = nstart
|
||||
|
||||
while 1:
|
||||
while True:
|
||||
if len(open_set) == 0:
|
||||
print("Open set is empty..")
|
||||
break
|
||||
|
||||
@@ -67,7 +67,7 @@ class DepthFirstSearchPlanner:
|
||||
open_set, closed_set = dict(), dict()
|
||||
open_set[self.calc_grid_index(nstart)] = nstart
|
||||
|
||||
while 1:
|
||||
while True:
|
||||
if len(open_set) == 0:
|
||||
print("Open set is empty..")
|
||||
break
|
||||
|
||||
@@ -71,7 +71,7 @@ class Dijkstra:
|
||||
open_set, closed_set = dict(), dict()
|
||||
open_set[self.calc_index(start_node)] = start_node
|
||||
|
||||
while 1:
|
||||
while True:
|
||||
c_id = min(open_set, key=lambda o: open_set[o].cost)
|
||||
current = open_set[c_id]
|
||||
|
||||
|
||||
@@ -67,7 +67,7 @@ class BestFirstSearchPlanner:
|
||||
open_set, closed_set = dict(), dict()
|
||||
open_set[self.calc_grid_index(nstart)] = nstart
|
||||
|
||||
while 1:
|
||||
while True:
|
||||
if len(open_set) == 0:
|
||||
print("Open set is empty..")
|
||||
break
|
||||
|
||||
@@ -65,7 +65,7 @@ def calc_distance_heuristic(gx, gy, ox, oy, resolution, rr):
|
||||
open_set[calc_index(goal_node, x_w, min_x, min_y)] = goal_node
|
||||
priority_queue = [(0, calc_index(goal_node, x_w, min_x, min_y))]
|
||||
|
||||
while 1:
|
||||
while True:
|
||||
if not priority_queue:
|
||||
break
|
||||
cost, c_id = heapq.heappop(priority_queue)
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
from Mapping.grid_map_lib.grid_map_lib import GridMap
|
||||
import conftest
|
||||
import numpy as np
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user