Skip to content
This repository has been archived by the owner on Jul 1, 2024. It is now read-only.

Commit

Permalink
feat(lanelet2_extention): add getAllFences (#209)
Browse files Browse the repository at this point in the history
add getAllFences

Signed-off-by: kyoichi-sugahara <[email protected]>
  • Loading branch information
kyoichi-sugahara authored Oct 19, 2023
1 parent 44dc388 commit 36b3825
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,9 @@ lanelet::ConstPolygons3d getAllParkingLots(const lanelet::LaneletMapConstPtr & l
// query all partitions in lanelet2 map
lanelet::ConstLineStrings3d getAllPartitions(const lanelet::LaneletMapConstPtr & lanelet_map_ptr);

// query all fences in lanelet2 map
lanelet::ConstLineStrings3d getAllFences(const lanelet::LaneletMapConstPtr & lanelet_map_ptr);

// query all pedestrian markings in lanelet2 map
lanelet::ConstLineStrings3d getAllPedestrianMarkings(
const lanelet::LaneletMapConstPtr & lanelet_map_ptr);
Expand Down
12 changes: 12 additions & 0 deletions tmp/lanelet2_extension/lib/query.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -369,6 +369,18 @@ lanelet::ConstLineStrings3d query::getAllPartitions(
return partitions;
}

lanelet::ConstLineStrings3d query::getAllFences(const lanelet::LaneletMapConstPtr & lanelet_map_ptr)
{
lanelet::ConstLineStrings3d fences;
for (const auto & ls : lanelet_map_ptr->lineStringLayer) {
const std::string type = ls.attributeOr(lanelet::AttributeName::Type, "none");
if (type == "fence") {
fences.push_back(ls);
}
}
return fences;
}

lanelet::ConstLineStrings3d query::getAllPedestrianMarkings(
const lanelet::LaneletMapConstPtr & lanelet_map_ptr)
{
Expand Down

0 comments on commit 36b3825

Please sign in to comment.