Skip to content

Commit

Permalink
[nav2_planner] Fix costmap thread reset on cleanup (#3548)
Browse files Browse the repository at this point in the history
* remove costmap thread reset on cleanup

* Init costmap thread in on_configure method

* Move costmap_thread init in on_configure method
  • Loading branch information
BriceRenaudeau authored and SteveMacenski committed Jun 9, 2023
1 parent 1b24eeb commit 8652a2c
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
2 changes: 2 additions & 0 deletions nav2_controller/src/controller_server.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,8 @@ ControllerServer::on_configure(const rclcpp_lifecycle::State & /*state*/)
get_parameter("failure_tolerance", failure_tolerance_);

costmap_ros_->configure();
// Launch a thread to run the costmap node
costmap_thread_ = std::make_unique<nav2_util::NodeThread>(costmap_ros_);

try {
progress_checker_type_ = nav2_util::get_plugin_type_param(node, progress_checker_id_);
Expand Down
3 changes: 3 additions & 0 deletions nav2_planner/src/planner_server.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,9 @@ PlannerServer::on_configure(const rclcpp_lifecycle::State & /*state*/)
costmap_ros_->configure();
costmap_ = costmap_ros_->getCostmap();

// Launch a thread to run the costmap node
costmap_thread_ = std::make_unique<nav2_util::NodeThread>(costmap_ros_);

RCLCPP_DEBUG(
get_logger(), "Costmap size: %d,%d",
costmap_->getSizeInCellsX(), costmap_->getSizeInCellsY());
Expand Down

0 comments on commit 8652a2c

Please sign in to comment.