-
Notifications
You must be signed in to change notification settings - Fork 60
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 (PR 1/6) - create lanelet_wrapper: use ::lanelet_map and ::pose #1472
Open
dmoszynski
wants to merge
30
commits into
master
Choose a base branch
from
ref/RJD-1387-hdmap-utils-to-lanelet-wrapper-pose
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
HdMapUtils refactor (PR 1/6) - create lanelet_wrapper: use ::lanelet_map and ::pose #1472
dmoszynski
wants to merge
30
commits into
master
from
ref/RJD-1387-hdmap-utils-to-lanelet-wrapper-pose
+2,689
−1,826
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
…ap_utils, at this point mainly for pose calculations
…n, simple_sensor_simulator): use pose:: from lanelet_wrapper instead of hdmap_utils methods
…se:: from lanelet_wrapper
…ose in parts previously overlooked
…ap_utils, adapt hdmap_utils test to lanelet_wrapper::pose
…anelet_map in parts previusly overlooked
… of hdmap_utils, adapt hdmap_utils test to lanelet_wrapper::lanelet_map
Checklist for reviewers ☑️All references to "You" in the following text refer to the code reviewer.
|
…icRulesWithRoutingGraph
dmoszynski
added
wait for regression test
refactor
bump minor
If this pull request merged, bump minor version of the scenario_simulator_v2
labels
Dec 4, 2024
dmoszynski
changed the title
ref(traffic_simulator, behavior_tree_plugin): hdmap_utils refactor - create lanelet_wrapper, use ::lanelet_map and ::pose
HdMapUtils refactor (PR 1/X) - create lanelet_wrapper: use lanelet_map:: and pose::
Dec 5, 2024
dmoszynski
changed the title
HdMapUtils refactor (PR 1/X) - create lanelet_wrapper: use lanelet_map:: and pose::
HdMapUtils refactor (PR 1/X) - create lanelet_wrapper: use ::lanelet_map and ::pose
Dec 5, 2024
…utils-to-lanelet-wrapper-pose
…ly sonar recommendations
dmoszynski
force-pushed
the
ref/RJD-1387-hdmap-utils-to-lanelet-wrapper-pose
branch
from
December 10, 2024 15:01
768b84e
to
8fa1f2b
Compare
dmoszynski
changed the title
HdMapUtils refactor (PR 1/X) - create lanelet_wrapper: use ::lanelet_map and ::pose
HdMapUtils refactor (PR 1/6) - create lanelet_wrapper: use ::lanelet_map and ::pose
Dec 11, 2024
…tation to distance calc, remove toCanonicalizedLaneletPose(point...) because it can cause a another issues
…o-lanelet-wrapper-pose
…o-lanelet-wrapper-pose
Quality Gate passedIssues Measures |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
bump minor
If this pull request merged, bump minor version of the scenario_simulator_v2
refactor
wait for regression test
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
The non-regression is evidenced here.
Abstract
This is the first PR of 6 related to the
HdMapUtils
refactor - a class that allows you to get access to lanelet data - from an*.osm
file.The refactor is implemented in accordance with the proposal presented in the report
WP11_Q2_2023
: shared here.As a result of merging all 6 PRs,
HdMapUtils
will no longer exist in the source code - it will be replaced by theLaneletWrapper
and its namespacelanelet_wrapper
- see a diagram below.Background
The
lanelet_wrapper
namespace contains:LaneletLoader
LaneletWrapper
RouteCache
,CenterPointsCache
,LaneletLengthCache
TrafficRulesWithRoutingGraph
Main class
LaneletWrapper
is developed in the singleton pattern, and contains theactivate(<path_to_lanelet_file>)
method.LaneletWrapper
uses static methods from theLaneletLoader
class to load data from a*.osm
file. This namespace also containsRouteCache
,CenterPointsCache
andLaneletLengthCache
classes which are analogous to those inHdMapUtils
.LaneletWrapper
allows access to map data, graphs, rules and caches via static methods:scenario_simulator_v2/simulation/traffic_simulator/include/traffic_simulator/lanelet_wrapper/lanelet_wrapper.hpp
Lines 271 to 281 in 2645a65
These static methods are used by the sub-namespaces of
lanelet_wrapper
.lanelet_wrapper
namespace consist of 6 sub-namespaces:lanelet_wrapper::lanelet_map
,lanelet_wrapper::pose
,lanelet_wrapper::distance
,lanelet_wrapper::route
,lanelet_wrapper::lane_change
,lanelet_wrapper::traffic_lights
.As a result of the merge of this PR 1/6, the necessary source code for
LaneletWrapper
as a singleton and its activation in the required places is added to the project. As well as the first and second namespaces:lanelet_wrapper::lanelet_map
,lanelet_wrapper::pose
are added, But most importantly, the::pose
fromutils
is adapted for its use.In addition to this, PR is making several other improvements to the code, see below for details.
Details
LaneletWrapper
is added and thelanelet_map
namespace inutils
is developed.Now, in order to access the lanelet data, there is no need to create
HdMapUtils
, just calllanelet_map::activate()
in a single instance of the program - passing the path to the*.osm
map.Currently,
LaneletWrapper
is activated in:openscenario_intepreter
andcpp_scenario_node
,simple_sensor_simulator
,TrafficLightsTest
.Note: By moving from
HdMapUtils
, we mean moving the entire method tolanelet_wrapper
(as a free function), whichtraffic_simulator
has access to via free functions fromutils
. Sample of the relationship betweenutils
andlanelet_wrapper
after changes:<HdMapUtils method name>
to<utils namespace and function name>
-><lanelet_wrapper namespace and function name>
.Moved from
HdMapUtils
tolanelet_wrapper
namespaces - used by lanelet_map andpose
fromutils
:getLaneletLength
tolanelet_map::laneletLength -> lanelet_wrapper::lanelet_map::laneletLength
getLaneletAltitude
tolanelet_map::laneletAltitude -> lanelet_wrapper::lanelet_map::laneletAltitude
getCenterPoints
tolanelet_wrapper::lanelet_map::centerPoints
- this has been copied, the original will be deleted sooncanonicalizeLaneletPose
topose::canonicalize() -> lanelet_wrapper::pose::canonicalizeLaneletPose
getAllCanonicalizedLaneletPoses
topose::alternativeLaneletPoses -> lanelet_wrapper::pose::alternativeLaneletPoses
getAlongLaneletPose
topose::alongLaneletPose -> lanelet_wrapper::pose::alongLaneletPose
getLeftLaneletIds
topose::leftLaneletIds -> lanelet_wrapper::pose::leftLaneletIds
getRightLaneletIds
topose::rightLaneletIds -> lanelet_wrapper::pose::rightLaneletIds
getNextLaneletIds
topose::nextLaneletIds -> lanelet_wrapper::pose::nextLaneletIds
getPreviousLaneletIds
topose::previousLaneletIds -> lanelet_wrapper::pose::previousLaneletIds
toMapPose
topose::toMapPose -> lanelet_wrapper::pose::toMapPose
matchToLane
topose::matchToLane -> lanelet_wrapper::pose::matchToLane
toLaneletPose
topose::toLaneletPose -> lanelet_wrapper::pose::toLaneletPose
toLaneletPoses
topose::toLaneletPoses -> lanelet_wrapper::pose::toLaneletPoses
isAltitudeMatching
topose::isAltitudeMatching -> lanelet_wrapper::pose::isAltitudeMatching
Thanks to this, the passing of
HdMapUtils
ptr has been removed from functions:CanonicalizedEntityStatus::set
pose::canonicalize
pose::toCanonicalizedLaneletPose
pose::toMapPose
pose::pedestrian::transformToCanonicalizedLaneletPose
CanonicalizedLaneletPose
contructorhelper::constructCanonicalizedLaneletPose
helper::constructLaneletPose
In addition:
test_hdmap_utils
- to use functions fromlanelet_wrapper
- in the next PRs this file will be broken down so that tests for each sub-namespace oflanelet_wrapper
will be separated file.helper_functions
and other files from thetest/*
folder tolanelet_wrapper
.pose::canonicalize()
- now it returnsLaneletPose
and throws an exception - which is in harmony with the name and expectations. WheneverCanonicalizedLaneletPose
is needed, thepose::toCanonicalizedLaneletPose()
function is used. In addition, there is no longer aCanonicalizedLaneletPose::canonicalize()
method - commonpose::canonicalize
is used there.Configuration
constructor and its use incpp_scenario_node
andopenscenario_interpreter
.follow_trajectory_action
- previously the orientation was not taken into account leading to failures in some scenarios,ActionNode::getDistanceToTargetEntityPolygon
- by developing a more coherent version ofpose::isAltitudeMatching
ActionNode::calculateUpdatedEntityStatus
- thanks to the separation of the functionlanelet_wrapper::pose::alongLaneletPose
(in subsequent PRs an intermediate route:: sub-namespace will be created, then it will be route::moveAlongLaneletPose)TrafficController::appendAutoSinks
- by separating the functionlanelet_map::boarderlinePoses
math::geometry::convertDirectionToQuaternion
- i.e. an assistant function to convert a direction vector into an orientation in a quaternionCanonicalizedLaneletPose::getAltitude()
CanonicalizedLaneletPose::getLaneletId()
CanonicalziedLaneletPose::alignOrientationtoLanelet()
pose::isInLanelet -> lanelet_wrapper::pose::isInLanelet
- with argument type ofgeometry_msgs::msg::Point
References
Internal Jira Link
Destructive Changes
None
Known Limitations
None