Skip to content

Commit

Permalink
chore(autoware_lanelet2_map_validator): add requirement vm-02-02 to a…
Browse files Browse the repository at this point in the history
…utoware_requirement_set (#143)

* Add Sobue-san as maintainer of autoware_lanelet2_map_validator

Signed-off-by: TaikiYamada4 <[email protected]>

* Added maintainers to autoware_lanelet2_map_validator

Signed-off-by: TaikiYamada4 <[email protected]>

* Added vm-02-02 to autoware_requirement_set.json

Signed-off-by: TaikiYamada4 <[email protected]>

* Fixed error of autoware_lanelet2_map_validator template

Signed-off-by: TaikiYamada4 <[email protected]>

* Detect stop lines that are referred as `refers` role.

Signed-off-by: TaikiYamada4 <[email protected]>

---------

Signed-off-by: TaikiYamada4 <[email protected]>
  • Loading branch information
TaikiYamada4 authored Nov 5, 2024
1 parent fd20d8b commit 3c33924
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 2 deletions.
2 changes: 1 addition & 1 deletion map/autoware_lanelet2_map_validator/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 | |
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
{
"requirements": [
{
"id": "vm-02-02",
"validators": [
{
"name": "mapping.stop_line.missing_regulatory_elements"
}
]
},
{
"id": "vm-04-01",
"validators": [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,21 +63,31 @@ 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
std::set<lanelet::Id> sl_ids_reg_elem;
for (const auto & elem : reg_elem_sl) {
const auto & ref_lines =
elem->getParameters<lanelet::ConstLineString3d>(lanelet::RoleName::RefLine);
const auto & refers =
elem->getParameters<lanelet::ConstLineString3d>(lanelet::RoleName::Refers);
for (const auto & ref_line : ref_lines) {
const auto & attrs = ref_line.attributes();
const auto & it = attrs.find(lanelet::AttributeName::Type);
if (it != attrs.end() && it->second == lanelet::AttributeValueString::StopLine) {
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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,10 @@ namespace lanelet
{
namespace validation
{
namespace
{
lanelet::validation::RegisterMapValidator<ValidatorTemplate> reg;
}

lanelet::validation::Issues ValidatorTemplate::operator()(const lanelet::LaneletMap & map)
{
Expand Down

0 comments on commit 3c33924

Please sign in to comment.