feat(lanelet2_map_validator): enable to catch map loading issues such as invalid point elevations #205
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
Background
Currently, autoware_lanelet2_map_validator can validate a
LaneletMap
class object but cannot validate the osm file itself.However, Autoware requires all points in the map must have an
ele
tag defined, which is not able to validate from aLaneletMap
class object.Osm Parser for validation
Hence, I've created an original osm parser
autoware_validator_osm_parser
for autoware_lanelet2_map_validator to catch errors that happen in the osm parsing phase.I had to copy the portion of the Lanelet 2 library to create a osm_parser that can validate the
ele
tag in the osm file, so I made a license statement that this code copied and modified the ones in the Lanelet2 library.Passing errors on map loading
The current autoware_lanelet2_map_validator has a problem that issues happening in the map loading phase will not be passed to the
lanelet2_validation_results.json
. I've reorganized the process in the validation so that the map loading issues can be passed to the final result.Main changes in this PR
autoware_validator_osm_parser
to validate stuff inside in the parsing phaseele
tag and its value.autoware_validator_osm_parser
to load the lanelet2 map.lanelet2_validation_results.json
.autoware_validator_osm_parser
can detect points that have invalid elevation.How was this PR tested?
colcon test
Checked that all test codes passes 100%
colcon test --packages-select autoware_lanelet2_map_validator --event-handlers console_cohesion+
Usual practice
1. Succeed case
Checked that the usual
ros2 run
works againstsample_map.osm
, and see a new item[map_loading]
.2. Fail case
Checked that the usual
ros2 run
works againstsingle_lanelet_one_point_missing_ele.osm
, and see a new item[map_loading]
.You can see a new requirement block
map_loading
is created in thelanelet2_validation_results.json
.Notes for reviewers
autoware_validator_osm_parser.cpp
andautoware_validator_osm_parser.hpp
is based on the code of the Lanelet2 library.OsmHandlerLoad.cpp
OsmFile.cpp
.OsmFileParser
toAutowareValidatorOsmFileParser
and addedautoware
namespace to it.AutowareValidatorOsmParser
class (inherit fromOsmParser
) and modify theparse()
method to detect invalid elevation tags.parse()
methodlanelet::osm::read()
changed tolanelet::osm::autoware::read()
which is redirected to theread()
method in AutowareValidatorOsmFileParser`.readNodes()
method (which is called from theread()
method) so that invalid elevation can be detected.Effects on system behavior