Skip to content

Commit b5988db

Browse files
authored
Fix: Hybrid A* direction is incorrect (AtsushiSakai#1086)
* fix to preseve direction history * add path to Reeds Shepp and its users e.g. hybrid A*
1 parent 7eeb9d2 commit b5988db

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

PathPlanning/HybridAStar/hybrid_a_star.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -105,12 +105,13 @@ def calc_next_node(current, steer, direction, config, ox, oy, kd_tree):
105105
x, y, yaw = current.x_list[-1], current.y_list[-1], current.yaw_list[-1]
106106

107107
arc_l = XY_GRID_RESOLUTION * 1.5
108-
x_list, y_list, yaw_list = [], [], []
108+
x_list, y_list, yaw_list, direction_list = [], [], [], []
109109
for _ in np.arange(0, arc_l, MOTION_RESOLUTION):
110110
x, y, yaw = move(x, y, yaw, MOTION_RESOLUTION * direction, steer)
111111
x_list.append(x)
112112
y_list.append(y)
113113
yaw_list.append(yaw)
114+
direction_list.append(direction == 1)
114115

115116
if not check_car_collision(x_list, y_list, yaw_list, ox, oy, kd_tree):
116117
return None
@@ -134,7 +135,7 @@ def calc_next_node(current, steer, direction, config, ox, oy, kd_tree):
134135
cost = current.cost + added_cost + arc_l
135136

136137
node = Node(x_ind, y_ind, yaw_ind, d, x_list,
137-
y_list, yaw_list, [d],
138+
y_list, yaw_list, direction_list,
138139
parent_index=calc_index(current, config),
139140
cost=cost, steer=steer)
140141

PathPlanning/ReedsSheppPath/reeds_shepp_path_planning.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,10 @@
66
co-author Videh Patel(@videh25) : Added the missing RS paths
77
88
"""
9+
import sys
10+
import pathlib
11+
sys.path.append(str(pathlib.Path(__file__).parent.parent.parent))
12+
913
import math
1014

1115
import matplotlib.pyplot as plt

0 commit comments

Comments
 (0)