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/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
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)
{