From fd20d8b9cb7291518f6f9c6b52fe160951a20317 Mon Sep 17 00:00:00 2001 From: TaikiYamada4 <129915538+TaikiYamada4@users.noreply.github.com> Date: Fri, 1 Nov 2024 14:27:40 +0900 Subject: [PATCH 1/2] chore(autoware_lanelet2_map_validator): add maintainers (#141) * Add Sobue-san as maintainer of autoware_lanelet2_map_validator Signed-off-by: TaikiYamada4 * Added maintainers to autoware_lanelet2_map_validator Signed-off-by: TaikiYamada4 --------- Signed-off-by: TaikiYamada4 --- map/autoware_lanelet2_map_validator/package.xml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/map/autoware_lanelet2_map_validator/package.xml b/map/autoware_lanelet2_map_validator/package.xml index b147d461..d5d16065 100644 --- a/map/autoware_lanelet2_map_validator/package.xml +++ b/map/autoware_lanelet2_map_validator/package.xml @@ -5,6 +5,11 @@ 0.1.0 Validation tool for lanelet2 maps especially for Autoware usage Taiki Yamada + Mamoru Sobue + Yamato Ando + Masahiro Sakamoto + NGUYEN Viet Anh + Shintaro Sakoda Apache License 2.0 ament_cmake_auto From 3c33924534c5b3a2c7b997ff04b232adc87853a8 Mon Sep 17 00:00:00 2001 From: TaikiYamada4 <129915538+TaikiYamada4@users.noreply.github.com> Date: Tue, 5 Nov 2024 11:53:57 +0900 Subject: [PATCH 2/2] chore(autoware_lanelet2_map_validator): add requirement vm-02-02 to autoware_requirement_set (#143) * Add Sobue-san as maintainer of autoware_lanelet2_map_validator Signed-off-by: TaikiYamada4 * Added maintainers to autoware_lanelet2_map_validator Signed-off-by: TaikiYamada4 * Added vm-02-02 to autoware_requirement_set.json Signed-off-by: TaikiYamada4 * Fixed error of autoware_lanelet2_map_validator template Signed-off-by: TaikiYamada4 * Detect stop lines that are referred as `refers` role. Signed-off-by: TaikiYamada4 --------- Signed-off-by: TaikiYamada4 --- map/autoware_lanelet2_map_validator/README.md | 2 +- .../autoware_requirement_set.json | 8 ++++++++ .../missing_regulatory_elements_for_stop_lines.cpp | 12 +++++++++++- .../src/validators/validator_template.cpp | 3 +++ 4 files changed, 23 insertions(+), 2 deletions(-) diff --git a/map/autoware_lanelet2_map_validator/README.md b/map/autoware_lanelet2_map_validator/README.md index f20eab92..cd8ea6f0 100644 --- a/map/autoware_lanelet2_map_validator/README.md +++ b/map/autoware_lanelet2_map_validator/README.md @@ -278,7 +278,7 @@ The "Validators" column will be blank if it hasn't be implemented. | vm-01-17 | Side strip | | | vm-01-18 | Side strip Linestring sharing | | | vm-01-19 | Walkway | | -| vm-02-01 | Stop line alignment | | +| vm-02-01 | Stop line alignment | (Not detectable) | | vm-02-02 | Stop sign | [mapping.stop_line.missing_regulatory_elements](./docs/stop_line/missing_regulatory_elements_for_stop_lines.md) | | vm-03-01 | Intersection criteria | | | vm-03-02 | Lanelet's turn direction and virtual | | diff --git a/map/autoware_lanelet2_map_validator/autoware_requirement_set.json b/map/autoware_lanelet2_map_validator/autoware_requirement_set.json index 6277a712..5dd2edfb 100644 --- a/map/autoware_lanelet2_map_validator/autoware_requirement_set.json +++ b/map/autoware_lanelet2_map_validator/autoware_requirement_set.json @@ -1,5 +1,13 @@ { "requirements": [ + { + "id": "vm-02-02", + "validators": [ + { + "name": "mapping.stop_line.missing_regulatory_elements" + } + ] + }, { "id": "vm-04-01", "validators": [ diff --git a/map/autoware_lanelet2_map_validator/src/validators/stop_line/missing_regulatory_elements_for_stop_lines.cpp b/map/autoware_lanelet2_map_validator/src/validators/stop_line/missing_regulatory_elements_for_stop_lines.cpp index 1d48153e..b0d73d9c 100644 --- a/map/autoware_lanelet2_map_validator/src/validators/stop_line/missing_regulatory_elements_for_stop_lines.cpp +++ b/map/autoware_lanelet2_map_validator/src/validators/stop_line/missing_regulatory_elements_for_stop_lines.cpp @@ -63,7 +63,8 @@ MissingRegulatoryElementsForStopLinesValidator::checkMissingRegulatoryElementsFo // Filter regulatory elements whose ref_line type is stop line auto reg_elem_sl = map.regulatoryElementLayer | ranges::views::filter([](auto && elem) { const auto & params = elem->getParameters(); - return params.find(lanelet::RoleNameString::RefLine) != params.end(); + return (params.find(lanelet::RoleNameString::RefLine) != params.end()) || + (params.find(lanelet::RoleNameString::Refers) != params.end()); }); // Get all line strings of stop line referred by regulatory elements @@ -71,6 +72,8 @@ MissingRegulatoryElementsForStopLinesValidator::checkMissingRegulatoryElementsFo for (const auto & elem : reg_elem_sl) { const auto & ref_lines = elem->getParameters(lanelet::RoleName::RefLine); + const auto & refers = + elem->getParameters(lanelet::RoleName::Refers); for (const auto & ref_line : ref_lines) { const auto & attrs = ref_line.attributes(); const auto & it = attrs.find(lanelet::AttributeName::Type); @@ -78,6 +81,13 @@ MissingRegulatoryElementsForStopLinesValidator::checkMissingRegulatoryElementsFo sl_ids_reg_elem.insert(ref_line.id()); } } + for (const auto & ref : refers) { + const auto & attrs = ref.attributes(); + const auto & it = attrs.find(lanelet::AttributeName::Type); + if (it != attrs.end() && it->second == lanelet::AttributeValueString::StopLine) { + sl_ids_reg_elem.insert(ref.id()); + } + } } // Check if all line strings of stop line referred by regulatory elements diff --git a/map/autoware_lanelet2_map_validator/src/validators/validator_template.cpp b/map/autoware_lanelet2_map_validator/src/validators/validator_template.cpp index e50644be..42ae2769 100644 --- a/map/autoware_lanelet2_map_validator/src/validators/validator_template.cpp +++ b/map/autoware_lanelet2_map_validator/src/validators/validator_template.cpp @@ -18,7 +18,10 @@ namespace lanelet { namespace validation { +namespace +{ lanelet::validation::RegisterMapValidator reg; +} lanelet::validation::Issues ValidatorTemplate::operator()(const lanelet::LaneletMap & map) {