Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update costmap on new computePathToPose #796

Merged
merged 2 commits into from
Jun 4, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions nav2_navfn_planner/src/navfn_planner.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,18 @@ NavfnPlanner::computePathToPose(const std::shared_ptr<GoalHandle> goal_handle)
// TODO(mjeronimo): handle or reject an attempted pre-emption

try {
// Get the current costmap
getCostmap(costmap_);
bpwilcox marked this conversation as resolved.
Show resolved Hide resolved
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);
}

// Get the current pose from the robot
auto start = std::make_shared<geometry_msgs::msg::PoseWithCovarianceStamped>();

Expand Down