-
Notifications
You must be signed in to change notification settings - Fork 1.7k
[RPP] Prevent collision check premature termination with scaled_lookahead #5677
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
base: main
Are you sure you want to change the base?
Changes from 16 commits
75fa675
c31fad4
b5919c8
1251b7b
977bdac
1e3f203
28dc08a
5c09a9c
0b1f117
e940068
01882fc
6f5b8d0
8549823
834df69
ed49b23
6ebf7bf
16284dd
aebfac8
5de4708
1a23341
bda996f
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -104,6 +104,9 @@ ParameterHandler::ParameterHandler( | |
| declare_parameter_if_not_declared( | ||
| node, plugin_name_ + ".use_collision_detection", | ||
| rclcpp::ParameterValue(true)); | ||
| declare_parameter_if_not_declared( | ||
| node, plugin_name_ + ".use_path_aware_obstacle_distance", | ||
| rclcpp::ParameterValue(false)); | ||
| declare_parameter_if_not_declared( | ||
| node, plugin_name_ + ".stateful", rclcpp::ParameterValue(true)); | ||
|
|
||
|
|
@@ -189,6 +192,30 @@ 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_ + ".use_path_aware_obstacle_distance", | ||
| params_.use_path_aware_obstacle_distance); | ||
| if (params_.use_path_aware_obstacle_distance && params_.min_distance_to_obstacle <= 0.0) { | ||
| RCLCPP_WARN( | ||
| logger_, | ||
| "For 'use_path_aware_obstacle_distance' to be enabled, 'min_distance_to_obstacle' " | ||
| "must be set to a positive value, but it is not. The path-aware logic will be ignored."); | ||
| } | ||
| if (params_.use_path_aware_obstacle_distance && params_.use_velocity_scaled_lookahead_dist) { | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We also need to add this to
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Should I also validate and reject updates to velocity_scaled_lookahead = false or min_distance_to_obstacle <= 0 when the new parameter is already set to true? Accepting those parameter changes wouldn't break anything, it would just make use_path_aware_obstacle_distance do nothing. |
||
| RCLCPP_WARN( | ||
| logger_, | ||
| "For 'use_path_aware_obstacle_distance' to be enabled, 'use_velocity_scaled_lookahead_dist' " | ||
| "must also be true. The path-aware logic will be ignored."); | ||
| } | ||
| node->get_parameter(plugin_name_ + ".stateful", params_.stateful); | ||
|
|
||
| if (params_.inflation_cost_scaling_factor <= 0.0) { | ||
|
|
@@ -344,6 +371,8 @@ ParameterHandler::updateParametersCallback( | |
| params_.allow_reversing = parameter.as_bool(); | ||
| } else if (param_name == plugin_name_ + ".interpolate_curvature_after_goal") { | ||
| params_.interpolate_curvature_after_goal = parameter.as_bool(); | ||
| } else if (param_name == plugin_name_ + ".use_path_aware_obstacle_distance") { | ||
| params_.use_path_aware_obstacle_distance = parameter.as_bool(); | ||
| } | ||
| } | ||
| } | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.