From 9658ef2ecc41dce5479b3fbc37b3ea15ac88ed99 Mon Sep 17 00:00:00 2001 From: Steve Macenski Date: Mon, 30 Oct 2023 13:38:17 -0700 Subject: [PATCH] Update theta_star_planner.cpp (#3918) (cherry picked from commit 0629ff36e36ecc135b9b13fc78f213cfe0a361ef) --- nav2_theta_star_planner/src/theta_star_planner.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/nav2_theta_star_planner/src/theta_star_planner.cpp b/nav2_theta_star_planner/src/theta_star_planner.cpp index 2913b5ef7e..23d4398db8 100644 --- a/nav2_theta_star_planner/src/theta_star_planner.cpp +++ b/nav2_theta_star_planner/src/theta_star_planner.cpp @@ -91,6 +91,8 @@ nav_msgs::msg::Path ThetaStarPlanner::createPlan( nav_msgs::msg::Path global_path; auto start_time = std::chrono::steady_clock::now(); + std::unique_lock lock(*(planner_->costmap_->getMutex())); + // Corner case of start and goal beeing on the same cell unsigned int mx_start, my_start, mx_goal, my_goal; planner_->costmap_->worldToMap(start.pose.position.x, start.pose.position.y, mx_start, my_start);