Custom Nav2 Plugin - Achtion server aborts handle
System: Ubuntu 22.04, ROS2 Humble, Nav2
Hi,
I'am writing a nav2 costmap plugin. So far, everything works as intended, the costmap get the values I am setting and I am able to see the correct costmap in RVIZ.
The curious thing is that as soon as I enable the plugin the action server won't calculate any path. Sadly, I get no other error message than:
[controller_server]: [follow_path] [ActionServer] Aborting handle.
What are possible reasons that the path can't be calculated?
I am setting the costs in the following way:
void
SemLayer::updateCosts(nav2_costmap_2d::Costmap2D &master_grid,int min_i, int min_j, int max_i, int max_j) {
if (!enabled_) {
return;
}
if (!obj_detected_){
return;
}
unsigned int size_x = master_grid.getSizeInCellsX(), size_y = master_grid.getSizeInCellsY();
min_i = std::max(0, min_i);
min_j = std::max(0, min_j);
max_i = std::min(static_cast<int>(size_x), max_i);
max_j = std::min(static_cast<int>(size_y), max_j);
for (int x = min_i; x < max_i / 2; x++) {
for (int y = min_j; y < max_j / 2; y++) {
master_grid.setCost(x, y, 120);
}
}
obj_detected_ = false;
}
Many thanks in advance!