Skip to content

Commit

Permalink
Update nav2_navfn_planner/src/navfn_planner.cpp
Browse files Browse the repository at this point in the history
check and resize planner costmap array
  • Loading branch information
bpwilcox committed Jun 3, 2019
1 parent fcbf46f commit 50ab69a
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions nav2_navfn_planner/src/navfn_planner.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,15 @@ NavfnPlanner::computePathToPose(const std::shared_ptr<GoalHandle> goal_handle)
try {
// Get the current pose from the robot
getCostmap(costmap_);
RCLCPP_DEBUG(get_logger(), "Costmap size: %d,%d",
costmap_.metadata.size_x, costmap_.metadata.size_y);

// Update planner based on the new costmap size
if (isPlannerOutOfDate()) {
current_costmap_size_[0] = costmap_.metadata.size_x;
current_costmap_size_[1] = costmap_.metadata.size_y;
planner_->setNavArr(costmap_.metadata.size_x, costmap_.metadata.size_y);
}
auto start = std::make_shared<geometry_msgs::msg::PoseWithCovarianceStamped>();

if (!robot_->getCurrentPose(start)) {
Expand Down

0 comments on commit 50ab69a

Please sign in to comment.