HdMapUtils refactor lanelet_wrapper::distance::distanceToStopLine
#1538
+229
−213
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
Abstract
This is the partial PR of the HdMapUtils refactor (PR 2/6) ( #1478 )
Details
Replace usage of
HdMapUtils::getDistanceToStopLine
with non-member functionlanelet_wrapper::distance::distanceToStopLine
.In the distanceToStopLine function, instead of adding all values to std::set and then using the first element, only the smallest value is stored.
before:
scenario_simulator_v2/simulation/traffic_simulator/src/hdmap_utils/hdmap_utils.cpp
Lines 1492 to 1499 in 3042d19
after:
scenario_simulator_v2/simulation/traffic_simulator/src/lanelet_wrapper/distance.cpp
Lines 38 to 44 in 751f68b
References
Destructive Changes
The arguments of traffic_simulator::distanceToStopLine have been changed.
before
after
The definition of lanelet_wrapper::distance::distanceToStopLine, to which this function forwards, is as follows:
Migration Guide
The most appropriate overload corresponding to the original distanceToStopLine function call is:
Since the third argument hdmap_utils_ptr has been removed, eliminate it from your function calls.
Instead of passing
const traffic_simulator_msgs::msg::WaypointsArray & waypoints_array
, you should passconst std::vector<Point> & route_waypoints
by extracting thewaypoints
from WaypointsArray msg.Known Limitations
None.