-
Notifications
You must be signed in to change notification settings - Fork 658
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
feat(obstacle_cruise_planner): obstacle type dependent slow down for obstacle cruise planner #5208
Conversation
Signed-off-by: Daniel Sanchez <[email protected]>
Signed-off-by: Daniel Sanchez <[email protected]>
Signed-off-by: Daniel Sanchez <[email protected]>
Signed-off-by: Daniel Sanchez <[email protected]>
Signed-off-by: Daniel Sanchez <[email protected]>
Codecov ReportAttention:
Additional details and impacted files@@ Coverage Diff @@
## main #5208 +/- ##
==========================================
+ Coverage 14.87% 14.89% +0.01%
==========================================
Files 1627 1627
Lines 112557 112931 +374
Branches 34744 35070 +326
==========================================
+ Hits 16745 16819 +74
- Misses 77063 77289 +226
- Partials 18749 18823 +74
*This pull request uses carry forward flags. Click here to find out more.
☔ View full report in Codecov by Sentry. |
Signed-off-by: Daniel Sanchez <[email protected]>
Signed-off-by: Daniel Sanchez <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I did not test this PR but the code looks good.
auto it = obstacle_to_param_struct_map.find(label); | ||
|
||
if (it != obstacle_to_param_struct_map.end()) { | ||
return obstacle_to_param_struct_map.at(label); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
auto it = obstacle_to_param_struct_map.find(label); | |
if (it != obstacle_to_param_struct_map.end()) { | |
return obstacle_to_param_struct_map.at(label); | |
if (obstacle_to_param_struct_map.count(label) > 0) { | |
return obstacle_to_param_struct_map.at(label); |
@@ -235,16 +266,37 @@ class PlannerInterface | |||
node.declare_parameter<double>("slow_down.lpf_gain_dist_to_slow_down"); | |||
} | |||
|
|||
ObstacleSpecificParams getObstacleParamByLabel(const ObjectClassification & label_id) const | |||
{ | |||
std::string label = types_map.at(label_id.label); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
std::string label = types_map.at(label_id.label); | |
const std::string label = types_map.at(label_id.label); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the suggestions @maxime-clem I have added them to the code.
Signed-off-by: Daniel Sanchez <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
6dfb197
into
autowarefoundation:main
…obstacle cruise planner (autowarefoundation#5208) * Add slow down parameters dependant on obstacle type Signed-off-by: Daniel Sanchez <[email protected]> * divide obstacle parameters based on obstacle type Signed-off-by: Daniel Sanchez <[email protected]> * preserve obstacle type for velocity calculation Signed-off-by: Daniel Sanchez <[email protected]> * added pre-commit changes Signed-off-by: Daniel Sanchez <[email protected]> * change sample config params Signed-off-by: Daniel Sanchez <[email protected]> * Update Readme Signed-off-by: Daniel Sanchez <[email protected]> * Update README Signed-off-by: Daniel Sanchez <[email protected]> * small refactor for cleaner code Signed-off-by: Daniel Sanchez <[email protected]> --------- Signed-off-by: Daniel Sanchez <[email protected]> Signed-off-by: Daniel Sanchez <[email protected]>
…obstacle cruise planner (autowarefoundation#5208) * Add slow down parameters dependant on obstacle type Signed-off-by: Daniel Sanchez <[email protected]> * divide obstacle parameters based on obstacle type Signed-off-by: Daniel Sanchez <[email protected]> * preserve obstacle type for velocity calculation Signed-off-by: Daniel Sanchez <[email protected]> * added pre-commit changes Signed-off-by: Daniel Sanchez <[email protected]> * change sample config params Signed-off-by: Daniel Sanchez <[email protected]> * Update Readme Signed-off-by: Daniel Sanchez <[email protected]> * Update README Signed-off-by: Daniel Sanchez <[email protected]> * small refactor for cleaner code Signed-off-by: Daniel Sanchez <[email protected]> --------- Signed-off-by: Daniel Sanchez <[email protected]> Signed-off-by: Daniel Sanchez <[email protected]>
…obstacle cruise planner (autowarefoundation#5208) * Add slow down parameters dependant on obstacle type Signed-off-by: Daniel Sanchez <[email protected]> * divide obstacle parameters based on obstacle type Signed-off-by: Daniel Sanchez <[email protected]> * preserve obstacle type for velocity calculation Signed-off-by: Daniel Sanchez <[email protected]> * added pre-commit changes Signed-off-by: Daniel Sanchez <[email protected]> * change sample config params Signed-off-by: Daniel Sanchez <[email protected]> * Update Readme Signed-off-by: Daniel Sanchez <[email protected]> * Update README Signed-off-by: Daniel Sanchez <[email protected]> * small refactor for cleaner code Signed-off-by: Daniel Sanchez <[email protected]> --------- Signed-off-by: Daniel Sanchez <[email protected]> Signed-off-by: Daniel Sanchez <[email protected]>
#920) feat(obstacle_cruise_planner): obstacle type dependent slow down for obstacle cruise planner (autowarefoundation#5208) * Add slow down parameters dependant on obstacle type * divide obstacle parameters based on obstacle type * preserve obstacle type for velocity calculation * added pre-commit changes * change sample config params * Update Readme * Update README * small refactor for cleaner code --------- Signed-off-by: Daniel Sanchez <[email protected]> Signed-off-by: Daniel Sanchez <[email protected]>
…obstacle cruise planner (autowarefoundation#5208) * Add slow down parameters dependant on obstacle type Signed-off-by: Daniel Sanchez <[email protected]> * divide obstacle parameters based on obstacle type Signed-off-by: Daniel Sanchez <[email protected]> * preserve obstacle type for velocity calculation Signed-off-by: Daniel Sanchez <[email protected]> * added pre-commit changes Signed-off-by: Daniel Sanchez <[email protected]> * change sample config params Signed-off-by: Daniel Sanchez <[email protected]> * Update Readme Signed-off-by: Daniel Sanchez <[email protected]> * Update README Signed-off-by: Daniel Sanchez <[email protected]> * small refactor for cleaner code Signed-off-by: Daniel Sanchez <[email protected]> --------- Signed-off-by: Daniel Sanchez <[email protected]> Signed-off-by: Daniel Sanchez <[email protected]>
…obstacle cruise planner (autowarefoundation#5208) * Add slow down parameters dependant on obstacle type Signed-off-by: Daniel Sanchez <[email protected]> * divide obstacle parameters based on obstacle type Signed-off-by: Daniel Sanchez <[email protected]> * preserve obstacle type for velocity calculation Signed-off-by: Daniel Sanchez <[email protected]> * added pre-commit changes Signed-off-by: Daniel Sanchez <[email protected]> * change sample config params Signed-off-by: Daniel Sanchez <[email protected]> * Update Readme Signed-off-by: Daniel Sanchez <[email protected]> * Update README Signed-off-by: Daniel Sanchez <[email protected]> * small refactor for cleaner code Signed-off-by: Daniel Sanchez <[email protected]> --------- Signed-off-by: Daniel Sanchez <[email protected]> Signed-off-by: Daniel Sanchez <[email protected]>
Description
🤖 Generated by Copilot at 82b40ad. Reformatted and expanded by Daniel
This pull request enhances the obstacle cruise planner to use the obstacle type information for planning --> if a set of parameters is defined for a given obstacle class, the obstacle_cruise_planner will use those parameters to calculate the slow down speed. If no specific obstacle parameters are defined for the given obstacle type, the planner will use the "default" parameters instead. In the attached image there is an example that implements a different set of parameters for pedestrians only:
Other changes:
The PR adds the
object_classification
field to theSlowDownObstacle
struct and uses it to select obstacle specific parameters for the slow down velocity calculation.It also refactors the
SlowDownParam
struct and updates theobstacle_cruise_planner.param.yaml
file to define parameters for different obstacle labels.Related links
Required launcher changes: PR
Tests performed
Used the planning simulator to test changes in behavior for different obstacles. If the obstacle type matches a obstacle-specific parameter (defined in obstacle_cruise_planner.param.yaml), the planner uses those parameters to calculate the slow down speed (instead of the default parameters).
See videos for BEFORE and AFTER for an example: TIER IV restricted page
I also modified the parameters while running the simulation to make sure the onParam changes execute properly.
Notes for reviewers
Interface changes
obstacle_cruise_planner.param.yaml has been changed. Now it is necessary to provide a "default" set of parameters for slow down and, if required, you can provide a new set of parameters for a specific obstacle type. See the image for an example change:
Effects on system behavior
it is possible to configure obstacle_cruise_planner to slow down differently depending on the obstacle type (ie. pedestrian, bicycle,car,etc.)
Pre-review checklist for the PR author
The PR author must check the checkboxes below when creating the PR.
In-review checklist for the PR reviewers
The PR reviewers must check the checkboxes below before approval.
Post-review checklist for the PR author
The PR author must check the checkboxes below before merging.
After all checkboxes are checked, anyone who has write access can merge the PR.