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

Updating error logging in Smac collision detector object #4743

Merged
merged 2 commits into from
Nov 7, 2024
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
24 changes: 12 additions & 12 deletions nav2_smac_planner/src/collision_checker.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,16 @@ void GridCollisionChecker::setFootprint(
const double & possible_collision_cost)
{
possible_collision_cost_ = static_cast<float>(possible_collision_cost);
if (possible_collision_cost_ <= 0.0f) {
RCLCPP_ERROR_THROTTLE(
logger_, *clock_, 1000,
"Inflation layer either not found or inflation is not set sufficiently for "
"optimized non-circular collision checking capabilities. It is HIGHLY recommended to set"
" the inflation radius to be at MINIMUM half of the robot's largest cross-section. See "
"github.com/ros-planning/navigation2/tree/main/nav2_smac_planner#potential-fields"
" for full instructions. This will substantially impact run-time performance.");
}

footprint_is_radius_ = radius;

// Use radius, no caching required
Expand Down Expand Up @@ -114,18 +124,8 @@ bool GridCollisionChecker::inCollision(
footprint_cost_ = static_cast<float>(costmap_->getCost(
static_cast<unsigned int>(x + 0.5f), static_cast<unsigned int>(y + 0.5f)));

if (footprint_cost_ < possible_collision_cost_) {
if (possible_collision_cost_ > 0.0f) {
return false;
} else {
RCLCPP_ERROR_THROTTLE(
logger_, *clock_, 1000,
"Inflation layer either not found or inflation is not set sufficiently for "
"optimized non-circular collision checking capabilities. It is HIGHLY recommended to set"
" the inflation radius to be at MINIMUM half of the robot's largest cross-section. See "
"github.com/ros-planning/navigation2/tree/main/nav2_smac_planner#potential-fields"
" for full instructions. This will substantially impact run-time performance.");
}
if (footprint_cost_ < possible_collision_cost_ && possible_collision_cost_ > 0.0f) {
return false;
}

// If its inscribed, in collision, or unknown in the middle,
Expand Down
Loading