Skip to content

Commit

Permalink
fix(autoware_freespace_planning_algorithms): fix shadowVariable (auto…
Browse files Browse the repository at this point in the history
…warefoundation#7949)

* fix:shadowVariable

Signed-off-by: kobayu858 <yutaro.kobayashi@tier4.jp>

* fix:shadowVariable

Signed-off-by: kobayu858 <yutaro.kobayashi@tier4.jp>

* fix:shadowVariable

Signed-off-by: kobayu858 <yutaro.kobayashi@tier4.jp>

---------

Signed-off-by: kobayu858 <yutaro.kobayashi@tier4.jp>
  • Loading branch information
kobayu858 authored and esteve committed Aug 13, 2024
1 parent 75be16f commit 9b926e2
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -294,14 +294,16 @@ void AstarSearch::setPath(const AstarNode & goal_node)
const AstarNode * node = &goal_node;

// push exact goal pose first
geometry_msgs::msg::PoseStamped pose;
pose.header = header;
pose.pose = local2global(costmap_, goal_pose_);

PlannerWaypoint pw;
pw.pose = pose;
pw.is_back = node->is_back;
waypoints_.waypoints.push_back(pw);
{
geometry_msgs::msg::PoseStamped pose;
pose.header = header;
pose.pose = local2global(costmap_, goal_pose_);

PlannerWaypoint pw;
pw.pose = pose;
pw.is_back = node->is_back;
waypoints_.waypoints.push_back(pw);
}

// push astar nodes poses
while (node != nullptr) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -183,17 +183,17 @@ void RRTStar::extend()
// This cannot be inside if(is_reached){...} because we must update this anytime after rewiring
// takes place
double cost_min = inf;
NodeSharedPtr node_best_parent;
NodeSharedPtr reached_node_best_parent;
for (const auto & node : reached_nodes_) {
const double cost = *(node->cost_from_start) + *(node->cost_to_goal);
if (cost < cost_min) {
cost_min = cost;
node_best_parent = node;
reached_node_best_parent = node;
}
}
node_goal_->cost_from_start = cost_min;
node_goal_->parent = node_best_parent;
node_goal_->cost_to_parent = node_best_parent->cost_to_goal;
node_goal_->parent = reached_node_best_parent;
node_goal_->cost_to_parent = reached_node_best_parent->cost_to_goal;
}
}

Expand Down

0 comments on commit 9b926e2

Please sign in to comment.