fix behavior when path is not found (#1104)

This commit is contained in:
parmaski
2024-12-21 19:40:30 +09:00
committed by GitHub
parent b5988dbcbc
commit b137ba1817
2 changed files with 2 additions and 2 deletions

View File

@@ -97,7 +97,7 @@ def pi_2_pi(angle):
def move(x, y, yaw, distance, steer, L=WB):
x += distance * cos(yaw)
y += distance * sin(yaw)
yaw += pi_2_pi(distance * tan(steer) / L) # distance/2
yaw = pi_2_pi(yaw + distance * tan(steer) / L) # distance/2
return x, y, yaw

View File

@@ -282,7 +282,7 @@ def hybrid_a_star_planning(start, goal, ox, oy, xy_resolution, yaw_resolution):
while True:
if not openList:
print("Error: Cannot find path, No open set")
return [], [], []
return Path([], [], [], [], 0)
cost, c_id = heapq.heappop(pq)
if c_id in openList: