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

adds routing graph argument to the functions that use routing graph #1458

Merged
merged 27 commits into from
Nov 27, 2024

Conversation

HansRobo
Copy link
Member

@HansRobo HansRobo commented Nov 25, 2024

Abstract

This pull-request adds routing graph argument to the listed functions

Detail

HDMapUtils class

functions with routing graph type added as an argument

  • canChangeLane
  • getAlongLaneletPose
  • getConflictingLaneIds
  • getFollowingLanelets
  • getLaneChangeableLaneletId
  • getPreviousLanelets
  • getSpeedLimit
  • matchToLane
  • toLaneletPose
  • toLaneletPoses

functions with routing configuration added as an argument

The original argument allow_lane_change was combined with the added new routing graph type argument to create the
routing configuration argument.

struct RoutingConfiguration
{
  bool allow_lane_change = false;
  traffic_simulator::RoutingGraphType routing_graph_type =
    traffic_simulator::RoutingGraphType::VEHICLE;
};
  • countLaneChanges
  • getLateralDistance
  • getLongitudinalDistance
  • getRoute

traffic_simulator::distance namespace

The original argument allow_lane_change was combined with the added new routing graph type argument to create the
routing configuration argument.

  • countLaneChanges
  • lateralDistance
  • longitudinalDistance
  • boundingBoxLaneLateralDistance
  • boundingBoxLaneLongitudinalDistance

Note

changes to these functions are breaking interface

traffic_simulator::pose namespace

The original argument allow_lane_change was combined with the added new routing graph type argument to create the
routing configuration argument.

  • relativeLaneletPose
  • boundingBoxRelativeLaneletPose

Note

changes to these functions are breaking interface

traffic_simulator::lanelet_pose namespace

The original argument allow_lane_change was combined with the added new routing graph type argument to create the
routing configuration argument.

  • CanonicalizedLaneletPose::getAlternativeLaneletPoseBaseOnShortestRouteFrom

References

Regression Test: OK

Destructive Changes

The functions listed below are not backward compatible

  • traffic_simulator::distance::countLaneChanges
  • traffic_simulator::distance::lateralDistance
  • traffic_simulator::distance::longitudinalDistance
  • traffic_simulator::distance::boundingBoxLaneLateralDistance
  • traffic_simulator::distance::boundingBoxLaneLongitudinalDistance
  • traffic_simulator::pose::relativeLaneletPose
  • traffic_simulator::pose::boundingBoxRelativeLaneletPose

migration guide

The penultimate argument, allow_lane_change, has been changed to routing_configuration.
This is a destructive change because I can't use default arguments except for the last one.

allow_lane_change: false

before

const auto relative = traffic_simulator::pose::relativeLaneletPose(
    from, to, false, hdmap_utils);

after

const auto relative = traffic_simulator::pose::relativeLaneletPose(
    from, to, traffic_simulator::RoutingConfiguration(), hdmap_utils);

allow_lane_change: true

before

const auto relative = traffic_simulator::pose::relativeLaneletPose(
    from, to, true, hdmap_utils);

after

traffic_simulator::RoutingConfiguration lane_changeable_routing_configuration;
lane_changeable_routing_configuration.allow_lane_change = true;
const auto relative = traffic_simulator::pose::relativeLaneletPose(
    from, to, lane_changeable_routing_configuration, hdmap_utils);

Known Limitations

None

Copy link

github-actions bot commented Nov 25, 2024

Checklist for reviewers ☑️

All references to "You" in the following text refer to the code reviewer.

  • Is this pull request written in a way that is easy to read from a third-party perspective?
  • Is there sufficient information (background, purpose, specification, algorithm description, list of disruptive changes, and migration guide) in the description of this pull request?
  • If this pull request contains a destructive change, does this pull request contain the migration guide?
  • Labels of this pull request are valid?
  • All unit tests/integration tests are included in this pull request? If you think adding test cases is unnecessary, please describe why and cross out this line.
  • The documentation for this pull request is enough? If you think adding documents for this pull request is unnecessary, please describe why and cross out this line.

@HansRobo HansRobo force-pushed the refactor/add_routing_graph_argument branch from 1ba74dd to 4dedb32 Compare November 25, 2024 09:19
@HansRobo HansRobo changed the title add routing graph arguments to HDMapUtils class member functions add routing graph arguments to HDMapUtils class member functions Nov 26, 2024
@HansRobo HansRobo added wait for regression test bump patch If this pull request merged, bump patch version of the scenario_simulator_v2 labels Nov 26, 2024
@HansRobo HansRobo changed the title add routing graph arguments to HDMapUtils class member functions adds routing graph argument to the functions that use routing graph Nov 27, 2024
@HansRobo HansRobo requested a review from hakuturu583 November 27, 2024 01:30
@HansRobo HansRobo marked this pull request as ready for review November 27, 2024 01:31
@HansRobo HansRobo added bump major If this pull request merged, bump major version of the scenario_simulator_v2 and removed wait for regression test bump patch If this pull request merged, bump patch version of the scenario_simulator_v2 labels Nov 27, 2024
@HansRobo HansRobo merged commit ca241b6 into master Nov 27, 2024
13 checks passed
@HansRobo HansRobo deleted the refactor/add_routing_graph_argument branch November 27, 2024 06:50
@github-actions github-actions bot restored the refactor/add_routing_graph_argument branch November 27, 2024 06:51
@github-actions github-actions bot deleted the refactor/add_routing_graph_argument branch November 27, 2024 06:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bump major If this pull request merged, bump major version of the scenario_simulator_v2
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants