Skip to content

Commit cd5eb79

Browse files
committed
keep coding
1 parent 4018e6b commit cd5eb79

File tree

1 file changed

+25
-0
lines changed

1 file changed

+25
-0
lines changed

PathPlanning/HybridAStar/hybrid_a_star.py

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,26 @@
2020
show_animation = True
2121

2222

23+
class Node:
24+
"""
25+
Node
26+
"""
27+
28+
def __init__(self, xind, yind, yawind, direction, x, y, yaw, directions, steer, cost, pind):
29+
# store kd-tree
30+
self.xind = xind
31+
self.yind = yind
32+
self.yawind = yawind
33+
self.direction = direction
34+
self.xlist = x
35+
self.ylist = y
36+
self.yawlist = yaw
37+
self.directionlist = directions
38+
self.steer = steer
39+
self.cost = cost
40+
self.pind = pind
41+
42+
2343
class KDTree:
2444
"""
2545
Nearest neighbor search class with KDTree
@@ -101,6 +121,11 @@ def hybrid_a_star_planning(start, goal, ox, oy, xyreso, yawreso):
101121

102122
c = Config(tox, toy, xyreso, yawreso)
103123

124+
nstart = Node(int(start[0] / xyreso), int(start[1] / xyreso), int(start[2] / yawreso),
125+
True, [start[0]], [start[1]], [start[2]], [True], 0.0, 0.0, -1)
126+
ngoal = Node(int(goal[0] / xyreso), int(goal[1] / xyreso), int(goal[2] / yawreso),
127+
True, [goal[0]], [goal[1]], [goal[2]], [True], 0.0, 0.0, -1)
128+
104129
rx, ry, ryaw = [], [], []
105130

106131
return rx, ry, ryaw

0 commit comments

Comments
 (0)