Skip to content

Commit

Permalink
Merge branch 'main' into fix_same_name_launch
Browse files Browse the repository at this point in the history
  • Loading branch information
Owen-Liuyuxuan authored Nov 5, 2024
2 parents 9b194f6 + 3c33924 commit 0b21e6e
Show file tree
Hide file tree
Showing 5 changed files with 28 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
5 changes: 5 additions & 0 deletions map/autoware_lanelet2_map_validator/package.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,11 @@
<version>0.1.0</version>
<description>Validation tool for lanelet2 maps especially for Autoware usage</description>
<maintainer email="[email protected]">Taiki Yamada</maintainer>
<maintainer email="[email protected]">Mamoru Sobue</maintainer>
<maintainer email="[email protected]">Yamato Ando</maintainer>
<maintainer email="[email protected]">Masahiro Sakamoto</maintainer>
<maintainer email="[email protected]">NGUYEN Viet Anh</maintainer>
<maintainer email="[email protected]">Shintaro Sakoda</maintainer>
<license>Apache License 2.0</license>

<buildtool_depend>ament_cmake_auto</buildtool_depend>
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 0b21e6e

Please sign in to comment.