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

fix(behavior_path_planner): change getLaneletSequence function parameter for large scale lanelet2 #5940

Conversation

StepTurtle
Copy link
Contributor

Description

When we use current planning pipeline with large scale lanelet2 maps, we investigate some time consumption. You can check following discussion:

When we use std::numeric_limits<double>::max() as a parameter, it takes all forward path it waste a lot of time. Using normal numbers reduce time consumption.

Tests performed

This is the video before change:

Effects on system behavior

Nothing

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.

  • There are no open discussions or they are tracked via tickets.

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

@StepTurtle StepTurtle added the component:planning Route planning, decision-making, and navigation. (auto-assigned) label Dec 22, 2023
@StepTurtle StepTurtle added the run:build-and-test-differential Mark to enable build-and-test-differential workflow. (used-by-ci) label Dec 22, 2023
Copy link

codecov bot commented Dec 22, 2023

Codecov Report

Attention: Patch coverage is 0% with 1 lines in your changes are missing coverage. Please review.

Project coverage is 14.78%. Comparing base (59f7031) to head (b4875b4).
Report is 4 commits behind head on main.

Files Patch % Lines
...ning/behavior_path_planner/src/planner_manager.cpp 0.00% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##             main    #5940   +/-   ##
=======================================
  Coverage   14.78%   14.78%           
=======================================
  Files        1917     1917           
  Lines      132038   132029    -9     
  Branches    39228    39222    -6     
=======================================
- Hits        19523    19522    -1     
+ Misses      90726    90716   -10     
- Partials    21789    21791    +2     
Flag Coverage Δ *Carryforward flag
differential 8.89% <0.00%> (?)
total 14.78% <ø> (+<0.01%) ⬆️ Carriedforward from 59f7031

*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.

@satoshi-ota satoshi-ota self-assigned this Dec 26, 2023
@satoshi-ota
Copy link
Contributor

@StepTurtle Thanks. I'll start review.

Copy link

stale bot commented Feb 24, 2024

This pull request has been automatically marked as stale because it has not had recent activity.

@stale stale bot added the status:stale Inactive or outdated issues. (auto-assigned) label Feb 24, 2024
…cause of the time consumption.

Signed-off-by: Barış Zeren <bzeren1819@gmail.com>
@mehmetdogru mehmetdogru force-pushed the fix/planner-manager-time-consumption branch from ef31b37 to b4875b4 Compare March 5, 2024 09:18
@stale stale bot removed the status:stale Inactive or outdated issues. (auto-assigned) label Mar 5, 2024
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.

The change greatly improves the performance with large maps and I do not think it can cause any issue.
@satoshi-ota please approve if you think this change is fine.

@satoshi-ota
Copy link
Contributor

satoshi-ota commented Apr 1, 2024

@maxime-clem @StepTurtle Thanks! And, sorry for the late response... 🙏

Unfortunatelly, this change may causes a problem.

The manager creates original reference path based on root lanelet (see here) and the lanelet is updated only when the ego changes the following lane.

Then, I guess it will not be able to find proper nearest lanelet in following functions because the distance between ego and root lanelet is sometimes longer than forward_path_length.

  if (lanelet::utils::query::getClosestLaneletWithConstrains(
        lanelet_sequence, pose, &closest_lane, p.ego_nearest_dist_threshold,
        p.ego_nearest_yaw_threshold)) {
    return utils::getReferencePath(closest_lane, data);
  }
  if (lanelet::utils::query::getClosestLanelet(lanelet_sequence, pose, &closest_lane)) {
    return utils::getReferencePath(closest_lane, data);
  }

image

On the other hand, current logic is no acceptable for large scale map, so I want to fix this issue as well. If you have any good ideas, please let me know.

The requirements of the logic are:

  1. need to remember current following lane info.
  2. the manager creates original reference path based on the info. (and, each modules modifiy the path if need.)
  3. the info shouldn't be updated based on ego position. sometimes the ego has to straddle road bound (e.g. due to obstacle) but the following lane doesn't change.
  4. the info must be updated when the ego completes lane change maneuver.

I guess there will be a good way...

@StepTurtle
Copy link
Contributor Author

@satoshi-ota thank you for your response, you've explained it quite well. Actually, after what you said, I also believe that the change we are about to make may cause some problems. If it's okay with you, I can close the PR.

Also, unfortunately, I don't have much knowledge about planning components, so I don't have any other ideas

@StepTurtle StepTurtle closed this Apr 15, 2024
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) run:build-and-test-differential Mark to enable build-and-test-differential workflow. (used-by-ci)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants