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

HdMapUtils refactor lanelet_wrapper::lanelet_map::leftBound rightBound #1533

Merged
merged 6 commits into from
Feb 25, 2025

Conversation

abco20
Copy link
Contributor

@abco20 abco20 commented Feb 20, 2025

Description

Abstract

This is the partial PR of the HdMapUtils refactor (PR 2/6) ( #1478 )

Details

Replace usage of HdMapUtils::getLeftBound and getRightBound with non-member function lanelet_wrapper::lanelet_map::leftBound, rightBound

References

Destructive Changes

The hdmap_utils_ptr parameter has been removed from the following functions:

  • traffic_simulator::distance::distanceToLaneBound
  • traffic_simulator::distance::distanceToLeftLaneBound
  • traffic_simulator::distance::distanceToRightLaneBound

For the rationale behind this change, see #1478.

Migration Guide

Before (Old Signature)

auto distanceToLaneBound(
  const geometry_msgs::msg::Pose & map_pose,
  const traffic_simulator_msgs::msg::BoundingBox & bounding_box, 
  lanelet::Id lanelet_id,
  const std::shared_ptr<hdmap_utils::HdMapUtils> & hdmap_utils_ptr) -> double;

auto distanceToLaneBound(
  const geometry_msgs::msg::Pose & map_pose,
  const traffic_simulator_msgs::msg::BoundingBox & bounding_box, 
  const lanelet::Ids & lanelet_ids,
  const std::shared_ptr<hdmap_utils::HdMapUtils> & hdmap_utils_ptr) -> double;

auto distanceToLeftBound(
  const geometry_msgs::msg::Pose & map_pose,
  const traffic_simulator_msgs::msg::BoundingBox & bounding_box, 
  lanelet::Id lanelet_id,
  const std::shared_ptr<hdmap_utils::HdMapUtils> & hdmap_utils_ptr) -> double;

auto distanceToLeftBound(
  const geometry_msgs::msg::Pose & map_pose,
  const traffic_simulator_msgs::msg::BoundingBox & bounding_box, 
  const lanelet::Ids & lanelet_ids,
  const std::shared_ptr<hdmap_utils::HdMapUtils> & hdmap_utils_ptr) -> double;

auto distanceToRightBound(
  const geometry_msgs::msg::Pose & map_pose,
  const traffic_simulator_msgs::msg::BoundingBox & bounding_box, 
  lanelet::Id lanelet_id,
  const std::shared_ptr<hdmap_utils::HdMapUtils> & hdmap_utils_ptr) -> double;

auto distanceToRightBound(
  const geometry_msgs::msg::Pose & map_pose,
  const traffic_simulator_msgs::msg::BoundingBox & bounding_box, 
  const lanelet::Ids & lanelet_ids,
  const std::shared_ptr<hdmap_utils::HdMapUtils> & hdmap_utils_ptr) -> double;

After (New Signature)

auto distanceToLaneBound(
  const geometry_msgs::msg::Pose & map_pose,
  const traffic_simulator_msgs::msg::BoundingBox & bounding_box, 
  lanelet::Id lanelet_id) -> double;

auto distanceToLaneBound(
  const geometry_msgs::msg::Pose & map_pose,
  const traffic_simulator_msgs::msg::BoundingBox & bounding_box, 
  const lanelet::Ids & lanelet_ids) -> double;

auto distanceToLeftBound(
  const geometry_msgs::msg::Pose & map_pose,
  const traffic_simulator_msgs::msg::BoundingBox & bounding_box, 
  lanelet::Id lanelet_id) -> double;

auto distanceToLeftBound(
  const geometry_msgs::msg::Pose & map_pose,
  const traffic_simulator_msgs::msg::BoundingBox & bounding_box, 
  const lanelet::Ids & lanelet_ids) -> double;

auto distanceToRightBound(
  const geometry_msgs::msg::Pose & map_pose,
  const traffic_simulator_msgs::msg::BoundingBox & bounding_box, 
  lanelet::Id lanelet_id) -> double;

auto distanceToRightBound(
  const geometry_msgs::msg::Pose & map_pose,
  const traffic_simulator_msgs::msg::BoundingBox & bounding_box, 
  const lanelet::Ids & lanelet_ids) -> double;

The fourth parameter, const std::shared_ptr<hdmap_utils::HdMapUtils> & hdmap_utils_ptr, has been removed.
Remove the hdmap_utils_ptr argument from call to distanceToLaneBound, distanceToLeftBound, distanceToRightBound.

Known Limitations

None.

Copy link

github-actions bot commented Feb 20, 2025

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.

@yamacir-kit yamacir-kit added refactor bump major If this pull request merged, bump major version of the scenario_simulator_v2 wait for regression test labels Feb 20, 2025
Copy link
Collaborator

@hakuturu583 hakuturu583 left a comment

Choose a reason for hiding this comment

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

This Pull Request contains destructive changes “such as changes to the arguments of the distanceToLaneBound function.
Please update the Description of the Pull Request appropriately.

Be sure to include in the description the function that has undergone the destructive change and its Migration Guide.

@hakuturu583 hakuturu583 self-assigned this Feb 25, 2025
Copy link
Collaborator

@hakuturu583 hakuturu583 left a comment

Choose a reason for hiding this comment

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

I searched for the distanceToLaneBound, distanceToLeftLaneBound and distanceToRightLaneBound functions in #1478 description, but I cannot find them.

@hakuturu583 hakuturu583 merged commit 1fcbbec into master Feb 25, 2025
13 checks passed
@github-actions github-actions bot deleted the refactor/lanelet_wrapper_bound branch February 25, 2025 07:03
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 refactor wait for regression test
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants