Skip to content
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

chore(autoware_lanelet2_map_validator): add requirement vm-02-02 to autoware_requirement_set #143

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading