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): use obstacle velocity based obstacle parameters #5510

Conversation

danielsanchezaran
Copy link
Contributor

@danielsanchezaran danielsanchezaran commented Nov 7, 2023

Description

🤖 Generated by Copilot at cd523a7

This pull request enhances the obstacle_cruise_planner by adding a new feature to distinguish between moving and static obstacles and adjust the slow down accordingly. It modifies the planner_interface.hpp and planner_interface.cpp files to implement this feature using new parameters, variables, and functions.

Related links

TIER IV INTERNAL LINK

Tests performed

On PSim: planned a path with both static and moving obstacles. The example video shows how the vehicle uses different slow down parameters when encountering a moving pedestrian and a static pedestrian (the slow down is more pronounced for the moving pedestrian). A similar test is done with a static and a moving car, in this case, the parked car causes the ego to slow down to around 1 Km/h while the moving car makes the ego slow down to around 7 Km/h. See videos for more details.

cap-.2023-11-07-15-42-09.mp4
cap-.2023-11-08-11-07-03.mp4

Notes for reviewers

Note: Documentation update in progress
Requires changes to Autoware launch found on this PR Draft

Interface changes

Added parameters for hysteresis-based decision making -> is the obstacle moving or not.

Effects on system behavior

Vehicle slow down response can be customized for moving or static objects.

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.

@danielsanchezaran danielsanchezaran added the tag:run-build-and-test-differential Mark to enable build-and-test-differential workflow. (used-by-ci) label Nov 7, 2023
@danielsanchezaran danielsanchezaran self-assigned this Nov 7, 2023
@github-actions github-actions bot added the component:planning Route planning, decision-making, and navigation. (auto-assigned) label Nov 7, 2023
@danielsanchezaran danielsanchezaran changed the title feat(obstacle_cruise_planner): Use velocity based obstacle params for slow down feat (obstacle_cruise_planner): Use velocity based obstacle params for slow down Nov 7, 2023
@danielsanchezaran danielsanchezaran changed the title feat (obstacle_cruise_planner): Use velocity based obstacle params for slow down feat(obstacle_cruise_planner): use vehicle velocity based obstacle parameters Nov 7, 2023
Copy link

codecov bot commented Nov 7, 2023

Codecov Report

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

Comparison is base (88b06e0) 15.26% compared to head (a2af7d9) 15.26%.
Report is 4 commits behind head on main.

Files Patch % Lines
...lude/obstacle_cruise_planner/planner_interface.hpp 2.56% 23 Missing and 15 partials ⚠️
.../obstacle_cruise_planner/src/planner_interface.cpp 0.00% 11 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #5510      +/-   ##
==========================================
- Coverage   15.26%   15.26%   -0.01%     
==========================================
  Files        1715     1715              
  Lines      118348   118353       +5     
  Branches    37906    37925      +19     
==========================================
  Hits        18061    18061              
+ Misses      79634    79630       -4     
- Partials    20653    20662       +9     
Flag Coverage Δ *Carryforward flag
differential 8.08% <2.00%> (?)
total 15.26% <ø> (+<0.01%) ⬆️ Carriedforward from 88b06e0

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

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

@danielsanchezaran danielsanchezaran changed the title feat(obstacle_cruise_planner): use vehicle velocity based obstacle parameters feat(obstacle_cruise_planner): use obstacle velocity based obstacle parameters Nov 8, 2023
@github-actions github-actions bot added the type:documentation Creating or refining documentation. (auto-assigned) label Nov 8, 2023
@danielsanchezaran danielsanchezaran marked this pull request as ready for review November 8, 2023 05:26
}

ObstacleSpecificParams getObstacleParamByLabel(const ObjectClassification & label_id) const
ObstacleSpecificParams getObstacleParamByLabel(
const ObjectClassification & label_id, const bool & is_obstacle_moving) const
Copy link
Contributor

Choose a reason for hiding this comment

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

No need to add a reference to bool variables

@danielsanchezaran danielsanchezaran force-pushed the feat/use-velocity-based-obstacle-params-for-slow-down branch from 4b2144d to 7780fd0 Compare November 13, 2023 06:05
@@ -561,9 +561,17 @@ std::vector<TrajectoryPoint> PlannerInterface::generateSlowDownTrajectory(
const auto & obstacle = obstacles.at(i);
const auto prev_output = getObjectFromUuid(prev_slow_down_output_, obstacle.uuid);

bool is_obstacle_moving = [&]() -> bool {
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
bool is_obstacle_moving = [&]() -> bool {
const bool is_obstacle_moving = [&]() -> bool {

return obstacle_to_param_struct_map.at(label);
}
return obstacle_to_param_struct_map.at("default");
std::string 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 =
const std::string 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.

Done!

return obstacle_to_param_struct_map.at("default");
std::string label =
(types_map.count(label_id.label) > 0) ? types_map.at(label_id.label) : "default";
std::string movement_postfix = (is_obstacle_moving) ? "moving" : "static";
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 movement_postfix = (is_obstacle_moving) ? "moving" : "static";
const std::string movement_postfix = is_obstacle_moving ? "moving" : "static";

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done!

@danielsanchezaran danielsanchezaran force-pushed the feat/use-velocity-based-obstacle-params-for-slow-down branch from efea426 to a2af7d9 Compare November 14, 2023 01:49
@danielsanchezaran danielsanchezaran merged commit 60a51e0 into autowarefoundation:main Nov 14, 2023
25 of 29 checks passed
@danielsanchezaran danielsanchezaran deleted the feat/use-velocity-based-obstacle-params-for-slow-down branch November 14, 2023 02:03
takayuki5168 pushed a commit to tier4/autoware.universe that referenced this pull request Nov 22, 2023
…arameters (autowarefoundation#5510)

* Add extra tag for moving obstacle type

Signed-off-by: Daniel Sanchez <[email protected]>

* add static and moving as parameter postfixes

Signed-off-by: Daniel Sanchez <[email protected]>

* set hysteresis-based obstacle moving classification

Signed-off-by: Daniel Sanchez <[email protected]>

* update config params

Signed-off-by: Daniel Sanchez <[email protected]>

* Use speed norm for object classification

Signed-off-by: Daniel Sanchez <[email protected]>

* changed '_' for '.' to make the code more consistent

Signed-off-by: Daniel Sanchez <[email protected]>

* update documentation

Signed-off-by: Daniel Sanchez <[email protected]>

* move the obstacle moving check to generateSlowDownTrajectory

Signed-off-by: Daniel Sanchez <[email protected]>

* remove unnecessary reference

Signed-off-by: Daniel Sanchez <[email protected]>

* add const to certain variables

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 Nov 24, 2023
…arameters (autowarefoundation#5510)

* Add extra tag for moving obstacle type

Signed-off-by: Daniel Sanchez <[email protected]>

* add static and moving as parameter postfixes

Signed-off-by: Daniel Sanchez <[email protected]>

* set hysteresis-based obstacle moving classification

Signed-off-by: Daniel Sanchez <[email protected]>

* update config params

Signed-off-by: Daniel Sanchez <[email protected]>

* Use speed norm for object classification

Signed-off-by: Daniel Sanchez <[email protected]>

* changed '_' for '.' to make the code more consistent

Signed-off-by: Daniel Sanchez <[email protected]>

* update documentation

Signed-off-by: Daniel Sanchez <[email protected]>

* move the obstacle moving check to generateSlowDownTrajectory

Signed-off-by: Daniel Sanchez <[email protected]>

* remove unnecessary reference

Signed-off-by: Daniel Sanchez <[email protected]>

* add const to certain variables

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
…arameters (autowarefoundation#5510)

* Add extra tag for moving obstacle type

Signed-off-by: Daniel Sanchez <[email protected]>

* add static and moving as parameter postfixes

Signed-off-by: Daniel Sanchez <[email protected]>

* set hysteresis-based obstacle moving classification

Signed-off-by: Daniel Sanchez <[email protected]>

* update config params

Signed-off-by: Daniel Sanchez <[email protected]>

* Use speed norm for object classification

Signed-off-by: Daniel Sanchez <[email protected]>

* changed '_' for '.' to make the code more consistent

Signed-off-by: Daniel Sanchez <[email protected]>

* update documentation

Signed-off-by: Daniel Sanchez <[email protected]>

* move the obstacle moving check to generateSlowDownTrajectory

Signed-off-by: Daniel Sanchez <[email protected]>

* remove unnecessary reference

Signed-off-by: Daniel Sanchez <[email protected]>

* add const to certain variables

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.

2 participants