Skip to content

Commit

Permalink
Merge pull request autowarefoundation#207 from tier4/cherry-pick-2501
Browse files Browse the repository at this point in the history
fix(behavior_path_planner): fix planner data copy (autowarefoundation#2501)
  • Loading branch information
TomohitoAndo authored Dec 14, 2022
2 parents 39a548d + 4445cfc commit a358cd3
Showing 1 changed file with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -607,7 +607,11 @@ void BehaviorPathPlannerNode::run()
// update planner data
planner_data_->self_pose = self_pose_listener_.getCurrentPose();

const auto planner_data = planner_data_;
const auto planner_data = std::make_shared<PlannerData>(*planner_data_);

// unlock planner data
mutex_pd_.unlock();

// run behavior planner
const auto output = bt_manager_->run(planner_data);

Expand All @@ -616,7 +620,6 @@ void BehaviorPathPlannerNode::run()

// update planner data
planner_data_->prev_output_path = path;
mutex_pd_.unlock();

const size_t target_idx = findEgoIndex(path->points);
util::clipPathLength(*path, target_idx, planner_data_->parameters);
Expand Down

0 comments on commit a358cd3

Please sign in to comment.