Skip to content
Closed
Show file tree
Hide file tree
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
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,8 @@ bool CollisionChecker::isCollisionImminent(
params_->min_distance_to_obstacle / std::max(std::abs(linear_vel),
params_->min_approach_linear_velocity)
);
simulation_distance_limit = std::max(carrot_dist, params_->min_distance_to_obstacle);
simulation_distance_limit = std::min(std::max(carrot_dist, params_->min_distance_to_obstacle),
params_->max_lookahead_dist);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the indentations are wrong here, it should just be 2 spaces more than the simulation_distance_limit = line.

I don't know what's going on with CI / linting tools and why its not picking up on these issues right now :(

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That was from ament_uncrustify --reformat, I'll fix it manually on the new PR then

}
int i = 1;
while (i * projection_time < max_allowed_time_to_collision_check) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -189,6 +189,15 @@ ParameterHandler::ParameterHandler(
node->get_parameter(
plugin_name_ + ".use_collision_detection",
params_.use_collision_detection);
if (params_.use_collision_detection &&
params_.min_distance_to_obstacle > params_.max_lookahead_dist)
{
RCLCPP_WARN(
logger_,
"min_distance_to_obstacle (%.02f) is greater than max_lookahead_dist (%.02f). "
"The collision check distance will be capped by max_lookahead_dist.",
params_.min_distance_to_obstacle, params_.max_lookahead_dist);
}
node->get_parameter(plugin_name_ + ".stateful", params_.stateful);

if (params_.inflation_cost_scaling_factor <= 0.0) {
Expand Down
Loading