Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 0 additions & 3 deletions .github/workflows/circleci-artifacts-redirector.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,3 @@ jobs:
repo-token: ${{ secrets.GITHUB_TOKEN }}
artifact-path: 0/html/index.html
circleci-jobs: build_doc
- name: Check the URL
run: |
curl --fail ${{ steps.step1.outputs.url }} | grep $GITHUB_SHA
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ def calc_final_path(goal_node, closed_node_set, resolution):
return rx, ry


def dp_planning(sx, sy, gx, gy, ox, oy, resolution, rr):
def calc_distance_heuristic(gx, gy, ox, oy, resolution, rr):
"""
gx: goal x position [m]
gx: goal x position [m]
Expand All @@ -52,7 +52,6 @@ def dp_planning(sx, sy, gx, gy, ox, oy, resolution, rr):
rr: robot radius[m]
"""

start_node = Node(round(sx / resolution), round(sy / resolution), 0.0, -1)
goal_node = Node(round(gx / resolution), round(gy / resolution), 0.0, -1)
ox = [iox / resolution for iox in ox]
oy = [ioy / resolution for ioy in oy]
Expand Down Expand Up @@ -115,16 +114,7 @@ def dp_planning(sx, sy, gx, gy, ox, oy, resolution, rr):
priority_queue,
(node.cost, calc_index(node, x_w, min_x, min_y)))

rx, ry = calc_final_path(closed_set[calc_index(
start_node, x_w, min_x, min_y)], closed_set, resolution)

return rx, ry, closed_set


def calc_heuristic(n1, n2):
w = 1.0 # weight of heuristic
d = w * math.sqrt((n1.x - n2.x) ** 2 + (n1.y - n2.y) ** 2)
return d
return closed_set


def verify_node(node, obstacle_map, min_x, min_y, max_x, max_y):
Expand Down Expand Up @@ -184,54 +174,3 @@ def get_motion_model():
[1, 1, math.sqrt(2)]]

return motion


def main():
print(__file__ + " start!!")

# start and goal position
sx = 10.0 # [m]
sy = 10.0 # [m]
gx = 50.0 # [m]
gy = 50.0 # [m]
grid_size = 2.0 # [m]
robot_size = 1.0 # [m]

ox, oy = [], []

for i in range(60):
ox.append(i)
oy.append(0.0)
for i in range(60):
ox.append(60.0)
oy.append(i)
for i in range(61):
ox.append(i)
oy.append(60.0)
for i in range(61):
ox.append(0.0)
oy.append(i)
for i in range(40):
ox.append(20.0)
oy.append(i)
for i in range(40):
ox.append(40.0)
oy.append(60.0 - i)

if show_animation: # pragma: no cover
plt.plot(ox, oy, ".k")
plt.plot(sx, sy, "xr")
plt.plot(gx, gy, "xb")
plt.grid(True)
plt.axis("equal")

rx, ry, _ = dp_planning(sx, sy, gx, gy, ox, oy, grid_size, robot_size)

if show_animation: # pragma: no cover
plt.plot(rx, ry, "-r")
plt.show()


if __name__ == '__main__':
show_animation = True
main()
8 changes: 4 additions & 4 deletions PathPlanning/HybridAStar/hybrid_a_star.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
sys.path.append(os.path.dirname(os.path.abspath(__file__))
+ "/../ReedsSheppPath")
try:
from a_star_heuristic import dp_planning
from dynamic_programming_heuristic import calc_distance_heuristic
import reeds_shepp_path_planning as rs
from car import move, check_car_collision, MAX_STEER, WB, plot_car
except Exception:
Expand Down Expand Up @@ -274,9 +274,9 @@ def hybrid_a_star_planning(start, goal, ox, oy, xy_resolution, yaw_resolution):

openList, closedList = {}, {}

_, _, h_dp = dp_planning(start_node.x_list[-1], start_node.y_list[-1],
goal_node.x_list[-1], goal_node.y_list[-1],
ox, oy, xy_resolution, VR)
h_dp = calc_distance_heuristic(
goal_node.x_list[-1], goal_node.y_list[-1],
ox, oy, xy_resolution, VR)

pq = []
openList[calc_index(start_node, config)] = start_node
Expand Down