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

feat(obstacle_cruise_planner): obstacle type dependent slow down for obstacle cruise planner #5208

Conversation

danielsanchezaran
Copy link
Contributor

@danielsanchezaran danielsanchezaran commented Oct 3, 2023

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:

image

Other changes:
The PR adds the object_classification field to the SlowDownObstacle struct and uses it to select obstacle specific parameters for the slow down velocity calculation.

It also refactors the SlowDownParam struct and updates the obstacle_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:

image

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.

  • The PR follows the pull request guidelines.
  • The PR has been properly tested.
  • The PR has been reviewed by the code owners.

Post-review checklist for the PR author

The PR author must check the checkboxes below before merging.

  • There are no open discussions or they are tracked via tickets.
  • The PR is ready for merge.

After all checkboxes are checked, anyone who has write access can merge the PR.

@github-actions github-actions bot added the component:planning Route planning, decision-making, and navigation. (auto-assigned) label Oct 3, 2023
@danielsanchezaran danielsanchezaran changed the title feature(obstacle_cruise_planner): obstacle type dependent slow down for obstacle cruise planner feat(obstacle_cruise_planner): obstacle type dependent slow down for obstacle cruise planner Oct 3, 2023
Signed-off-by: Daniel Sanchez <[email protected]>
Signed-off-by: Daniel Sanchez <[email protected]>
@danielsanchezaran danielsanchezaran added the tag:run-build-and-test-differential Mark to enable build-and-test-differential workflow. (used-by-ci) label Oct 3, 2023
@codecov
Copy link

codecov bot commented Oct 3, 2023

Codecov Report

Attention: 29 lines in your changes are missing coverage. Please review.

Comparison is base (0373d21) 14.87% compared to head (a6e1133) 14.89%.
Report is 70 commits behind head on main.

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     
Flag Coverage Δ *Carryforward flag
differential 8.16% <6.45%> (?)
total 14.87% <ø> (+<0.01%) ⬆️ Carriedforward from 719bc4f

*This pull request uses carry forward flags. Click here to find out more.

Files Coverage Δ
planning/obstacle_cruise_planner/src/node.cpp 14.96% <0.00%> (+2.59%) ⬆️
...include/obstacle_cruise_planner/common_structs.hpp 9.57% <0.00%> (+0.97%) ⬆️
.../obstacle_cruise_planner/src/planner_interface.cpp 6.18% <0.00%> (-0.02%) ⬇️
...lude/obstacle_cruise_planner/planner_interface.hpp 17.39% <7.69%> (-0.56%) ⬇️

... and 1 file with indirect coverage changes

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Signed-off-by: Daniel Sanchez <[email protected]>
@github-actions github-actions bot added the type:documentation Creating or refining documentation. (auto-assigned) label Oct 3, 2023
Signed-off-by: Daniel Sanchez <[email protected]>
@danielsanchezaran danielsanchezaran self-assigned this Oct 3, 2023
@danielsanchezaran danielsanchezaran marked this pull request as ready for review October 3, 2023 08:00
Copy link
Contributor

@maxime-clem maxime-clem left a 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.

Comment on lines 272 to 275
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);
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
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);
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
std::string label = types_map.at(label_id.label);
const std::string label = types_map.at(label_id.label);

Copy link
Contributor Author

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]>
Copy link
Contributor

@kosuke55 kosuke55 left a comment

Choose a reason for hiding this comment

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

LGTM!

@danielsanchezaran danielsanchezaran merged commit 6dfb197 into autowarefoundation:main Oct 6, 2023
28 of 30 checks passed
@danielsanchezaran danielsanchezaran deleted the feature/obstacle_type_dependant_slow_down_for_obstacle_cruise_planner branch October 6, 2023 04:53
danielsanchezaran added a commit to tier4/autoware.universe that referenced this pull request Oct 6, 2023
…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]>
takayuki5168 pushed a commit to tier4/autoware.universe that referenced this pull request Oct 10, 2023
…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]>
takayuki5168 pushed a commit to tier4/autoware.universe that referenced this pull request Oct 12, 2023
…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]>
takayuki5168 pushed a commit to tier4/autoware.universe that referenced this pull request Oct 12, 2023
#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]>
danielsanchezaran added a commit to tier4/autoware.universe that referenced this pull request Nov 24, 2023
…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]>
danielsanchezaran added a commit to tier4/autoware.universe that referenced this pull request Dec 20, 2023
…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]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component:planning Route planning, decision-making, and navigation. (auto-assigned) tag:run-build-and-test-differential Mark to enable build-and-test-differential workflow. (used-by-ci) type:documentation Creating or refining documentation. (auto-assigned)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants