Skip to content

HdMapUtils refactor lanelet_wrapper::distance::longitudinalDistance #1559

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

Draft
wants to merge 20 commits into
base: master
Choose a base branch
from

Conversation

abco20
Copy link
Contributor

@abco20 abco20 commented Apr 3, 2025

Description

Abstract

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

Details

Replace usage of HdMapUtils::getLongitudinalDistance with non-member function lanelet_wrapper::distance::longitudinalDistance

References

Destructive Changes

The hdmap_utils_ptr parameter has been removed from the following functions:

  • traffic_simulator::distance::longitudinalDistance
  • traffic_simulator::distance::boundingBoxLaneLongitudinalDistance
  • traffic_simulator::pose::relativeLaneletPose
  • traffic_simulator::pose::boundingBoxRelativeLaneletPose
  • traffic_simulator::follow_trajectory::makeUpdatedStatus

Migration Guide

Before (Old Signature)

auto longitudinalDistance(
  const CanonicalizedLaneletPose & from, const CanonicalizedLaneletPose & to,
  bool include_adjacent_lanelet, bool include_opposite_direction,
  const traffic_simulator::RoutingConfiguration & routing_configuration,
  const std::shared_ptr<hdmap_utils::HdMapUtils> & hdmap_utils_ptr) -> std::optional<double>;

auto boundingBoxLaneLongitudinalDistance(
  const CanonicalizedLaneletPose & from,
  const traffic_simulator_msgs::msg::BoundingBox & from_bounding_box,
  const CanonicalizedLaneletPose & to,
  const traffic_simulator_msgs::msg::BoundingBox & to_bounding_box, bool include_adjacent_lanelet,
  bool include_opposite_direction,
  const traffic_simulator::RoutingConfiguration & routing_configuration,
  const std::shared_ptr<hdmap_utils::HdMapUtils> & hdmap_utils_ptr) -> std::optional<double>;

auto relativeLaneletPose(
  const CanonicalizedLaneletPose & from, const CanonicalizedLaneletPose & to,
  const RoutingConfiguration & routing_configuration,
  const std::shared_ptr<hdmap_utils::HdMapUtils> & hdmap_utils_ptr) -> LaneletPose;

auto boundingBoxRelativeLaneletPose(
  const CanonicalizedLaneletPose & from,
  const traffic_simulator_msgs::msg::BoundingBox & from_bounding_box,
  const CanonicalizedLaneletPose & to,
  const traffic_simulator_msgs::msg::BoundingBox & to_bounding_box,
  const RoutingConfiguration & routing_configuration,
  const std::shared_ptr<hdmap_utils::HdMapUtils> & hdmap_utils_ptr) -> LaneletPose;

auto makeUpdatedStatus(
  const traffic_simulator_msgs::msg::EntityStatus &,
  traffic_simulator_msgs::msg::PolylineTrajectory &,
  const traffic_simulator_msgs::msg::BehaviorParameter &,
  const std::shared_ptr<hdmap_utils::HdMapUtils> &, double, double,
  std::optional<double> target_speed = std::nullopt) -> std::optional<EntityStatus>;

After (New Signature)

auto longitudinalDistance(
  const CanonicalizedLaneletPose & from, const CanonicalizedLaneletPose & to,
  const bool include_adjacent_lanelet, const bool include_opposite_direction,
  const RoutingConfiguration & routing_configuration) -> std::optional<double>;

auto boundingBoxLaneLongitudinalDistance(
  const CanonicalizedLaneletPose & from,
  const traffic_simulator_msgs::msg::BoundingBox & from_bounding_box,
  const CanonicalizedLaneletPose & to,
  const traffic_simulator_msgs::msg::BoundingBox & to_bounding_box,
  const bool include_adjacent_lanelet, const bool include_opposite_direction,
  const RoutingConfiguration & routing_configuration) -> std::optional<double>;

auto relativeLaneletPose(
  const CanonicalizedLaneletPose & from, const CanonicalizedLaneletPose & to,
  const RoutingConfiguration & routing_configuration) -> LaneletPose;

auto boundingBoxRelativeLaneletPose(
  const CanonicalizedLaneletPose & from,
  const traffic_simulator_msgs::msg::BoundingBox & from_bounding_box,
  const CanonicalizedLaneletPose & to,
  const traffic_simulator_msgs::msg::BoundingBox & to_bounding_box,
  const RoutingConfiguration & routing_configuration) -> LaneletPose;

auto makeUpdatedStatus(
  const traffic_simulator_msgs::msg::EntityStatus &,
  traffic_simulator_msgs::msg::PolylineTrajectory &,
  const traffic_simulator_msgs::msg::BehaviorParameter &, double, double,
  std::optional<double> target_speed = std::nullopt) -> std::optional<EntityStatus>;

const std::shared_ptr<hdmap_utils::HdMapUtils> & hdmap_utils_ptr parameter has been removed.
Remove the hdmap_utils_ptr argument from function call

Known Limitations

None.

Copy link

github-actions bot commented Apr 3, 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 marked this pull request as draft April 3, 2025 02:57
@yamacir-kit yamacir-kit self-assigned this Apr 3, 2025
@yamacir-kit yamacir-kit added refactor wait for regression test bump major If this pull request merged, bump major version of the scenario_simulator_v2 labels Apr 3, 2025
Copy link

@hakuturu583 hakuturu583 self-requested a review May 27, 2025 01:29
@hakuturu583 hakuturu583 assigned abco20 and unassigned yamacir-kit May 27, 2025
@hakuturu583 hakuturu583 marked this pull request as ready for review May 27, 2025 11:44
@hakuturu583 hakuturu583 marked this pull request as draft May 27, 2025 23:54
Copy link

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.

4 participants