Skip to content

Commit bd70cf0

Browse files
satoshi-otaKhalilSelyan
authored and
KhalilSelyan
committed
feat(avoidance): keep enough distance to avoid object in front of red signal (#6898)
Signed-off-by: satoshi-ota <satoshi.ota928@gmail.com>
1 parent d3cff29 commit bd70cf0

File tree

4 files changed

+19
-1
lines changed

4 files changed

+19
-1
lines changed

planning/autoware_behavior_path_static_obstacle_avoidance_module/include/autoware_behavior_path_static_obstacle_avoidance_module/data_structs.hpp

+3
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@ enum class ObjectInfo {
5959
// unavoidable reasons
6060
NEED_DECELERATION,
6161
SAME_DIRECTION_SHIFT,
62+
LIMIT_DRIVABLE_SPACE_TEMPORARY,
6263
INSUFFICIENT_DRIVABLE_SPACE,
6364
INSUFFICIENT_LONGITUDINAL_DISTANCE,
6465
INVALID_SHIFT_LINE,
@@ -546,6 +547,8 @@ struct AvoidancePlanningData
546547
// nearest object that should be avoid
547548
std::optional<ObjectData> stop_target_object{std::nullopt};
548549

550+
std::optional<lanelet::ConstLanelet> red_signal_lane{std::nullopt};
551+
549552
// new shift point
550553
AvoidLineArray new_shift_line{};
551554

planning/autoware_behavior_path_static_obstacle_avoidance_module/include/autoware_behavior_path_static_obstacle_avoidance_module/helper.hpp

+5
Original file line numberDiff line numberDiff line change
@@ -357,6 +357,11 @@ class AvoidanceHelper
357357
return false;
358358
}
359359

360+
// can avoid it after relax drivable space limitation.
361+
if (object.info == ObjectInfo::LIMIT_DRIVABLE_SPACE_TEMPORARY) {
362+
return false;
363+
}
364+
360365
return true;
361366
}
362367

planning/autoware_behavior_path_static_obstacle_avoidance_module/src/scene.cpp

+4
Original file line numberDiff line numberDiff line change
@@ -210,6 +210,9 @@ void StaticObstacleAvoidanceModule::fillFundamentalData(
210210
utils::static_obstacle_avoidance::isWithinLanes(data.current_lanelets, planner_data_);
211211
const auto red_signal_lane_itr = std::find_if(
212212
data.current_lanelets.begin(), data.current_lanelets.end(), [&](const auto & lanelet) {
213+
if (utils::traffic_light::isTrafficSignalStop({lanelet}, planner_data_)) {
214+
return true;
215+
}
213216
const auto next_lanes = planner_data_->route_handler->getNextLanelets(lanelet);
214217
return utils::traffic_light::isTrafficSignalStop(next_lanes, planner_data_);
215218
});
@@ -229,6 +232,7 @@ void StaticObstacleAvoidanceModule::fillFundamentalData(
229232
} else {
230233
data.drivable_lanes.push_back(
231234
utils::static_obstacle_avoidance::generateNotExpandedDrivableLanes(lanelet));
235+
data.red_signal_lane = lanelet;
232236
}
233237
});
234238

planning/autoware_behavior_path_static_obstacle_avoidance_module/src/shift_line_generator.cpp

+7-1
Original file line numberDiff line numberDiff line change
@@ -246,7 +246,13 @@ AvoidOutlines ShiftLineGenerator::generateAvoidOutline(
246246
AvoidOutlines outlines;
247247
for (auto & o : data.target_objects) {
248248
if (!o.avoid_margin.has_value()) {
249-
o.info = ObjectInfo::INSUFFICIENT_DRIVABLE_SPACE;
249+
if (!data.red_signal_lane.has_value()) {
250+
o.info = ObjectInfo::INSUFFICIENT_DRIVABLE_SPACE;
251+
} else if (data.red_signal_lane.value().id() == o.overhang_lanelet.id()) {
252+
o.info = ObjectInfo::LIMIT_DRIVABLE_SPACE_TEMPORARY;
253+
} else {
254+
o.info = ObjectInfo::INSUFFICIENT_DRIVABLE_SPACE;
255+
}
250256
if (o.avoid_required && is_forward_object(o)) {
251257
break;
252258
} else {

0 commit comments

Comments
 (0)