Skip to content

23.0.0

Choose a tag to compare

@github-actions github-actions released this 09 Feb 03:04

Description

Abstract

This is the third PR of 6 related to the HdMapUtils refactor (for the first one, see #1472 and for the second see #1478).
For a full overview of changes that all 6 PRs will introduce, please see the Abstract of the first PR.

Background

The changes focus on using lanelet_wrapper namespace in the behavior_tree_plugin.
Thus, the HdMapUtils is not used in behavior_tree_plugin after the changes.

As a result of changes mentioned above, some behavior_tree_plugin functions have been moved to other parts of traffic_simulator, sometimes with slight modifications of the functionality.

In other cases, functions inside behavior_tree_plugin have been refactored to better suit their purpose.

Additionally, the member functions of HdMapUtils that after these changes became unused were removed.

Details

The main goal of this PR was to extend the usage of lanelet_wrapper namespace and remove usage of HdMapUtils class in behavior_tree_plugin.
This was also a good opportunity to slightly tidy up the behavior_tree_plugin.
Minor changes were introduced - for example in the ActionNode class, where generic member functions were extracted as free functions in utils namespaces.

Examples of changes made to the behavior_tree_plugin

Before
https://github.com/tier4/scenario_simulator_v2/blob/fc56adcc11c874ae912ffe82ae2c2a5f54b49202/simulation/behavior_tree_plugin/src/vehicle/follow_lane_sequence/follow_front_entity_action.cpp#L80

After
https://github.com/tier4/scenario_simulator_v2/blob/e6a8a68701e29df5615a2f8d13958b93bd6f7643/simulation/behavior_tree_plugin/src/vehicle/follow_lane_sequence/follow_front_entity_action.cpp#L80


Before
https://github.com/tier4/scenario_simulator_v2/blob/fc56adcc11c874ae912ffe82ae2c2a5f54b49202/simulation/behavior_tree_plugin/src/vehicle/follow_lane_sequence/follow_front_entity_action.cpp#L100

After
https://github.com/tier4/scenario_simulator_v2/blob/e6a8a68701e29df5615a2f8d13958b93bd6f7643/simulation/behavior_tree_plugin/src/vehicle/follow_lane_sequence/follow_front_entity_action.cpp#L104-L108


Before
https://github.com/tier4/scenario_simulator_v2/blob/fc56adcc11c874ae912ffe82ae2c2a5f54b49202/simulation/behavior_tree_plugin/src/vehicle/follow_lane_sequence/stop_at_crossing_entity_action.cpp#L114

After
https://github.com/tier4/scenario_simulator_v2/blob/e6a8a68701e29df5615a2f8d13958b93bd6f7643/simulation/behavior_tree_plugin/src/vehicle/follow_lane_sequence/stop_at_crossing_entity_action.cpp#L114-L116

Examples of changes made to the functions

Function ActionNode::getDistanceToTrafficLightStopLine
https://github.com/tier4/scenario_simulator_v2/blob/fc56adcc11c874ae912ffe82ae2c2a5f54b49202/simulation/behavior_tree_plugin/include/behavior_tree_plugin/action_node.hpp#L61-L63

Has been converted to TrafficLightsBase::getDistanceToActiveTrafficLightStopLine
https://github.com/tier4/scenario_simulator_v2/blob/e6a8a68701e29df5615a2f8d13958b93bd6f7643/simulation/traffic_simulator/include/traffic_simulator/traffic_lights/traffic_lights_base.hpp#L74-L76


Function ActionNode::getRightOfWayEntities
https://github.com/tier4/scenario_simulator_v2/blob/fc56adcc11c874ae912ffe82ae2c2a5f54b49202/simulation/behavior_tree_plugin/include/behavior_tree_plugin/action_node.hpp#L65-L66

Has been converted to ActionNode::isNeedToRightOfWay which does not return statuses, but only information whether there are any right of way entities.
This change could have been made, because the original implementation was only ever used to check whether the returned vector was empty.
https://github.com/tier4/scenario_simulator_v2/blob/e6a8a68701e29df5615a2f8d13958b93bd6f7643/simulation/behavior_tree_plugin/include/behavior_tree_plugin/action_node.hpp#L53

List of all functions changed

Apart from changes in the behavior_tree_plugin implementation, which are not covered in great detail here, some changes to free functions and member functions in scenario_simulator_v2 were introduced.
These changes have a potential to break some code that is developed in parallel and should be stated explicitly - that is why the table below has been prepared. It lists all changes made to function signatures, whether the functions have been renamed, removed, added or their functionality was altered.

Most functions marked as removed were removed because they were no longer used anywhere - they were fully replaced by other functions from utils namespaces.

Function Changes made
ActionNode::foundConflictingEntity ➖ removed
ActionNode::getDistanceToTrafficLightStopLine ➡️ TrafficLightsBase::getDistanceToActiveTrafficLightStopLine
ActionNode::getRightOfWayEntities ➡️ ActionNode::isNeedToRightOfWay with changes so that no entities are returned
ActionNode::getDistanceToTargetEntityOnCrosswalk ➖ removed
ActionNode::getConflictingEntityStatus ➖ removed
ActionNode::getConflictingEntityStatusOnCrossWalk ➖ removed
ActionNode::getConflictingEntityStatusOnLane ➖ removed
ActionNode::isOtherEntityAtConsideredAltitude ➖ removed
HdMapUtils::clipTrajectoryFromLaneletIds ➖ removed
HdMapUtils::filterLaneletIds ➡️ lanelet_wrapper::lanelet_map::filterLaneletIds
HdMapUtils::getClosestLaneletId ➖ removed
HdMapUtils::getCollisionPointInLaneCoordinate ➖ removed
HdMapUtils::getLaneletPolygon ➖ removed
HdMapUtils::getRightOfWayLaneletIds ➖ removed
HdMapUtils::getRightOfWayLaneletIds ➖ removed
HdMapUtils::isInIntersection ➡️ lanelet_wrapper::lanelet_map::isInIntersection
HdMapUtils::isInLanelet ➖ removed
HdMapUtils::toMapBin ➡️ lanelet_wrapper::LaneletLoader::convertMapToBin
HdMapUtils::toMapPoints ➖ removed
HdMapUtils::absoluteHull ➖ removed
HdMapUtils::calcEuclidDist ➖ removed
HdMapUtils::filterLanelets ➖ removed
HdMapUtils::mapCallback ➖ removed
HdMapUtils::toPoint2d ➖ removed
HdMapUtils::toPolygon ➖ removed
ScenarioSimulator::getOrigin ➖ removed
HdMapUtils::getNearbyLaneletIds ➖ removed

References

INTERNAL LINK

Destructive Changes

For code developped in parallel please see List of all functions changed.

Known Limitations

Related Issues