Skip to content
Open
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
4 changes: 2 additions & 2 deletions src/a_star.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ bool verify_node(Node* node,
}


float calc_heristic(Node* n1, Node* n2, float w=1.0){
float calc_heuristic(Node* n1, Node* n2, float w=1.0){
return w * std::sqrt(std::pow(n1->x-n2->x, 2)+std::pow(n1->y-n2->y, 2));
}

Expand Down Expand Up @@ -202,7 +202,7 @@ void a_star_planning(float sx, float sy,
Node * new_node = new Node(
node->x + motion[i].x,
node->y + motion[i].y,
path_cost[node->x][node->y] + motion[i].sum_cost + calc_heristic(ngoal, node),
path_cost[node->x][node->y] + motion[i].sum_cost + calc_heuristic(ngoal, node),
node);

if (!verify_node(new_node, obmap, min_ox, max_ox, min_oy, max_oy)){
Expand Down
3 changes: 0 additions & 3 deletions src/dijkstra.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -91,9 +91,6 @@ bool verify_node(Node* node,
}


float calc_heristic(Node n1, Node n2, float w=1.0){
return w * std::sqrt(std::pow(n1.x-n2.x, 2)+std::pow(n1.y-n2.y, 2));
}

std::vector<Node> get_motion_model(){
return {Node(1, 0, 1),
Expand Down