Skip to content

Commit 1279359

Browse files
authored
feat(avoidance): make it possible to use freespace areas in avoidance module (autowarefoundation#6001)
* fix(static_drivable_area_expansion): check right/left bound id Signed-off-by: satoshi-ota <satoshi.ota928@gmail.com> * feat(static_drivable_area): use freespace area Signed-off-by: satoshi-ota <satoshi.ota928@gmail.com> * feat(avoidance): use freespace Signed-off-by: satoshi-ota <satoshi.ota928@gmail.com> * fix(AbLC): fix flag Signed-off-by: satoshi-ota <satoshi.ota928@gmail.com> * fix(planner_manager): fix flag Signed-off-by: satoshi-ota <satoshi.ota928@gmail.com> * refactor(static_drivable_area_expansion): remove unused arg Signed-off-by: satoshi-ota <satoshi.ota928@gmail.com> * refactor(static_drivable_area_expansion): use lambda Signed-off-by: satoshi-ota <satoshi.ota928@gmail.com> * fix(static_drivable_area_expansion): fix invalid access Signed-off-by: satoshi-ota <satoshi.ota928@gmail.com> * refactor(static_drivable_area_expansion): improve readability Signed-off-by: satoshi-ota <satoshi.ota928@gmail.com> * fix(avoidance): add param Signed-off-by: satoshi-ota <satoshi.ota928@gmail.com> --------- Signed-off-by: satoshi-ota <satoshi.ota928@gmail.com>
1 parent 4e0b4ac commit 1279359

File tree

3 files changed

+400
-202
lines changed

3 files changed

+400
-202
lines changed

Diff for: planning/behavior_path_planner_common/include/behavior_path_planner_common/data_manager.hpp

+1
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,7 @@ struct DrivableAreaInfo
106106
std::vector<Obstacle> obstacles{}; // obstacles to extract from the drivable area
107107
bool enable_expanding_hatched_road_markings{false};
108108
bool enable_expanding_intersection_areas{false};
109+
bool enable_expanding_freespace_areas{false};
109110

110111
// temporary only for pull over's freespace planning
111112
double drivable_margin{0.0};

Diff for: planning/behavior_path_planner_common/include/behavior_path_planner_common/utils/drivable_area_expansion/static_drivable_area.hpp

+21-7
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919

2020
#include <memory>
2121
#include <string>
22+
#include <utility>
2223
#include <vector>
2324
namespace behavior_path_planner::utils
2425
{
@@ -40,8 +41,8 @@ std::vector<DrivableLanes> getNonOverlappingExpandedLanes(
4041
void generateDrivableArea(
4142
PathWithLaneId & path, const std::vector<DrivableLanes> & lanes,
4243
const bool enable_expanding_hatched_road_markings, const bool enable_expanding_intersection_areas,
43-
const double vehicle_length, const std::shared_ptr<const PlannerData> planner_data,
44-
const bool is_driving_forward = true);
44+
const bool enable_expanding_freespace_areas,
45+
const std::shared_ptr<const PlannerData> planner_data, const bool is_driving_forward = true);
4546

4647
void generateDrivableArea(
4748
PathWithLaneId & path, const double vehicle_length, const double offset,
@@ -62,6 +63,11 @@ std::vector<DrivableLanes> expandLanelets(
6263
void extractObstaclesFromDrivableArea(
6364
PathWithLaneId & path, const std::vector<DrivableAreaInfo::Obstacle> & obstacles);
6465

66+
std::pair<std::vector<lanelet::ConstPoint3d>, bool> getBoundWithFreeSpaceAreas(
67+
const std::vector<lanelet::ConstPoint3d> & original_bound,
68+
const std::vector<lanelet::ConstPoint3d> & other_side_bound,
69+
const std::shared_ptr<const PlannerData> planner_data, const bool is_left);
70+
6571
std::vector<lanelet::ConstPoint3d> getBoundWithHatchedRoadMarkings(
6672
const std::vector<lanelet::ConstPoint3d> & original_bound,
6773
const std::shared_ptr<RouteHandler> & route_handler);
@@ -72,14 +78,22 @@ std::vector<lanelet::ConstPoint3d> getBoundWithIntersectionAreas(
7278
const std::vector<DrivableLanes> & drivable_lanes, const bool is_left);
7379

7480
std::vector<geometry_msgs::msg::Point> calcBound(
75-
const std::shared_ptr<RouteHandler> route_handler,
81+
const PathWithLaneId & path, const std::shared_ptr<const PlannerData> planner_data,
82+
const std::vector<DrivableLanes> & drivable_lanes,
83+
const bool enable_expanding_hatched_road_markings, const bool enable_expanding_intersection_areas,
84+
const bool enable_expanding_freespace_areas, const bool is_left,
85+
const bool is_driving_forward = true);
86+
87+
std::vector<geometry_msgs::msg::Point> postProcess(
88+
const std::vector<geometry_msgs::msg::Point> & original_bound, const PathWithLaneId & path,
89+
const std::shared_ptr<const PlannerData> planner_data,
7690
const std::vector<DrivableLanes> & drivable_lanes,
7791
const bool enable_expanding_hatched_road_markings, const bool enable_expanding_intersection_areas,
78-
const bool is_left);
92+
const bool is_left, const bool is_driving_forward = true);
7993

80-
void makeBoundLongitudinallyMonotonic(
81-
PathWithLaneId & path, const std::shared_ptr<const PlannerData> & planner_data,
82-
const bool is_bound_left);
94+
std::vector<geometry_msgs::msg::Point> makeBoundLongitudinallyMonotonic(
95+
const std::vector<geometry_msgs::msg::Point> & original_bound, const PathWithLaneId & path,
96+
const std::shared_ptr<const PlannerData> & planner_data, const bool is_left);
8397

8498
DrivableAreaInfo combineDrivableAreaInfo(
8599
const DrivableAreaInfo & drivable_area_info1, const DrivableAreaInfo & drivable_area_info2);

0 commit comments

Comments
 (0)