|
13 | 13 | import numpy as np |
14 | 14 | import scipy.spatial |
15 | 15 | import matplotlib.pyplot as plt |
16 | | -import reeds_shepp_path_planning as rs |
| 16 | +# import reeds_shepp_path_planning as rs |
17 | 17 | import heapq |
18 | 18 |
|
19 | 19 | EXTEND_AREA = 5.0 # [m] |
@@ -118,40 +118,40 @@ def hybrid_a_star_planning(start, goal, ox, oy, xyreso, yawreso): |
118 | 118 | yawreso: yaw angle resolution [rad] |
119 | 119 | """ |
120 | 120 |
|
121 | | - start[2], goal[2] = rs.pi_2_pi(start[2]), rs.pi_2_pi(goal[2]) |
122 | | - tox, toy = ox[:], oy[:] |
| 121 | + # start[2], goal[2] = rs.pi_2_pi(start[2]), rs.pi_2_pi(goal[2]) |
| 122 | + # tox, toy = ox[:], oy[:] |
123 | 123 |
|
124 | | - obkdtree = KDTree(np.vstack((tox, toy)).T) |
| 124 | + # obkdtree = KDTree(np.vstack((tox, toy)).T) |
125 | 125 |
|
126 | | - c = Config(tox, toy, xyreso, yawreso) |
| 126 | + # c = Config(tox, toy, xyreso, yawreso) |
127 | 127 |
|
128 | | - nstart = Node(int(start[0] / xyreso), int(start[1] / xyreso), int(start[2] / yawreso), |
129 | | - True, [start[0]], [start[1]], [start[2]], [True], 0.0, 0.0, -1) |
130 | | - ngoal = Node(int(goal[0] / xyreso), int(goal[1] / xyreso), int(goal[2] / yawreso), |
131 | | - True, [goal[0]], [goal[1]], [goal[2]], [True], 0.0, 0.0, -1) |
| 128 | + # nstart = Node(int(start[0] / xyreso), int(start[1] / xyreso), int(start[2] / yawreso), |
| 129 | + # True, [start[0]], [start[1]], [start[2]], [True], 0.0, 0.0, -1) |
| 130 | + # ngoal = Node(int(goal[0] / xyreso), int(goal[1] / xyreso), int(goal[2] / yawreso), |
| 131 | + # True, [goal[0]], [goal[1]], [goal[2]], [True], 0.0, 0.0, -1) |
132 | 132 |
|
133 | | - openList, closedList = {}, {} |
134 | | - h = [] |
135 | | - # goalqueue = queue.PriorityQueue() |
136 | | - pq = [] |
137 | | - openList[calc_index(nstart, c)] = nstart |
138 | | - heapq.heappush(pq, (calc_index(nstart, c), calc_cost(nstart, h, ngoal, c))) |
| 133 | + # openList, closedList = {}, {} |
| 134 | + # h = [] |
| 135 | + # # goalqueue = queue.PriorityQueue() |
| 136 | + # pq = [] |
| 137 | + # openList[calc_index(nstart, c)] = nstart |
| 138 | + # heapq.heappush(pq, (calc_index(nstart, c), calc_cost(nstart, h, ngoal, c))) |
139 | 139 |
|
140 | | - while True: |
141 | | - if not openList: |
142 | | - print("Error: Cannot find path, No open set") |
143 | | - return [], [], [] |
| 140 | + # while True: |
| 141 | + # if not openList: |
| 142 | + # print("Error: Cannot find path, No open set") |
| 143 | + # return [], [], [] |
144 | 144 |
|
145 | | - c_id, cost = heapq.heappop(pq) |
146 | | - current = openList.pop(c_id) |
147 | | - closedList[c_id] = current |
| 145 | + # c_id, cost = heapq.heappop(pq) |
| 146 | + # current = openList.pop(c_id) |
| 147 | + # closedList[c_id] = current |
148 | 148 |
|
149 | | - isupdated, fpath = analytic_expantion( |
150 | | - current, ngoal, c, ox, oy, obkdtree) |
| 149 | + # isupdated, fpath = analytic_expantion( |
| 150 | + # current, ngoal, c, ox, oy, obkdtree) |
151 | 151 |
|
152 | | - # print(current) |
| 152 | + # # print(current) |
153 | 153 |
|
154 | | - # rx, ry, ryaw = [], [], [] |
| 154 | + rx, ry, ryaw = [], [], [] |
155 | 155 |
|
156 | 156 | return rx, ry, ryaw |
157 | 157 |
|
@@ -208,8 +208,8 @@ def main(): |
208 | 208 | start, goal, ox, oy, xyreso, yawreso) |
209 | 209 |
|
210 | 210 | plt.plot(ox, oy, ".k") |
211 | | - rs.plot_arrow(start[0], start[1], start[2]) |
212 | | - rs.plot_arrow(goal[0], goal[1], goal[2]) |
| 211 | + # rs.plot_arrow(start[0], start[1], start[2]) |
| 212 | + # rs.plot_arrow(goal[0], goal[1], goal[2]) |
213 | 213 |
|
214 | 214 | plt.grid(True) |
215 | 215 | plt.axis("equal") |
|
0 commit comments