Skip to content

Commit d89459c

Browse files
committed
feat(goal_planner): add getBusStopArea function
Signed-off-by: Mamoru Sobue <mamoru.sobue@tier4.jp>
1 parent 95ba51d commit d89459c

File tree

3 files changed

+15
-4
lines changed

3 files changed

+15
-4
lines changed

map/autoware_map_projection_loader/src/load_info_from_lanelet2_map.cpp

-4
Original file line numberDiff line numberDiff line change
@@ -30,11 +30,7 @@ tier4_map_msgs::msg::MapProjectorInfo load_info_from_lanelet2_map(const std::str
3030
lanelet::ErrorMessages errors{};
3131
lanelet::projection::MGRSProjector projector{};
3232
const lanelet::LaneletMapPtr map = lanelet::load(filename, projector, &errors);
33-
3433
if (!errors.empty()) {
35-
for (const auto & error : errors) {
36-
std::cout << error << std::endl;
37-
}
3834
throw std::runtime_error("Error occurred while loading lanelet2 map");
3935
}
4036

planning/behavior_path_planner/autoware_behavior_path_goal_planner_module/include/autoware/behavior_path_goal_planner_module/goal_searcher.hpp

+1
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,7 @@ class GoalSearcher : public GoalSearcherBase
6565
const std::shared_ptr<const PlannerData> & planner_data) const;
6666
BasicPolygons2d getNoParkingAreaPolygons(const lanelet::ConstLanelets & lanes) const;
6767
BasicPolygons2d getNoStoppingAreaPolygons(const lanelet::ConstLanelets & lanes) const;
68+
BasicPolygons2d getBusStopAreaPolygons(const lanelet::ConstLanelets & lanes) const;
6869
bool isInAreas(const LinearRing2d & footprint, const BasicPolygons2d & areas) const;
6970

7071
LinearRing2d vehicle_footprint_{};

planning/behavior_path_planner/autoware_behavior_path_goal_planner_module/src/goal_searcher.cpp

+14
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,10 @@
1919
#include "autoware/behavior_path_planner_common/utils/path_utils.hpp"
2020
#include "autoware/behavior_path_planner_common/utils/utils.hpp"
2121
#include "autoware/universe_utils/geometry/boost_polygon_utils.hpp"
22+
#include "autoware_lanelet2_extension/regulatory_elements/bus_stop_area.hpp"
2223
#include "autoware_lanelet2_extension/regulatory_elements/no_parking_area.hpp"
2324
#include "autoware_lanelet2_extension/regulatory_elements/no_stopping_area.hpp"
25+
#include "autoware_lanelet2_extension/utility/query.hpp"
2426
#include "autoware_lanelet2_extension/utility/utilities.hpp"
2527

2628
#include <boost/geometry/algorithms/union.hpp>
@@ -490,6 +492,18 @@ BasicPolygons2d GoalSearcher::getNoStoppingAreaPolygons(const lanelet::ConstLane
490492
return area_polygons;
491493
}
492494

495+
BasicPolygons2d GoalSearcher::getBusStopAreaPolygons(const lanelet::ConstLanelets & lanes) const
496+
{
497+
BasicPolygons2d area_polygons{};
498+
for (const auto & bus_stop_area_reg_elem : lanelet::utils::query::busStopAreas(lanes)) {
499+
for (const auto & area : bus_stop_area_reg_elem->busStopAreas()) {
500+
const auto & area_poly = lanelet::utils::to2D(area).basicPolygon();
501+
area_polygons.push_back(area_poly);
502+
}
503+
}
504+
return area_polygons;
505+
}
506+
493507
bool GoalSearcher::isInAreas(const LinearRing2d & footprint, const BasicPolygons2d & areas) const
494508
{
495509
for (const auto & area : areas) {

0 commit comments

Comments
 (0)