Skip to content

Commit d890bb5

Browse files
fix issue when ego does not straddle lane bounds and starts from 0 speed
Signed-off-by: Daniel Sanchez <danielsanchezaran@gmail.com>
1 parent b6bd750 commit d890bb5

File tree

2 files changed

+13
-3
lines changed

2 files changed

+13
-3
lines changed

planning/behavior_path_planner_common/src/turn_signal_decider.cpp

+4-1
Original file line numberDiff line numberDiff line change
@@ -731,10 +731,13 @@ std::pair<TurnSignalInfo, bool> TurnSignalDecider::getBehaviorTurnSignalInfo(
731731
return std::make_pair(TurnSignalInfo{}, true);
732732
}
733733

734-
if (!straddleRoadBound(path, shift_line, current_lanelets, p.vehicle_info)) {
734+
// Check if the ego will cross lane bounds.
735+
// Note that pull out requires blinkers, even if the ego does not cross lane bounds
736+
if (!is_pull_out && !straddleRoadBound(path, shift_line, current_lanelets, p.vehicle_info)) {
735737
return std::make_pair(TurnSignalInfo{}, true);
736738
}
737739

740+
// If the ego has stopped and its close to completing its shift, turn off the blinkers
738741
constexpr double STOPPED_THRESHOLD = 0.1; // [m/s]
739742
if (ego_speed < STOPPED_THRESHOLD && !override_ego_stopped_check) {
740743
if (isNearEndOfShift(

planning/behavior_path_start_planner_module/src/start_planner_module.cpp

+9-2
Original file line numberDiff line numberDiff line change
@@ -241,9 +241,12 @@ void StartPlannerModule::updateData()
241241
DEBUG_PRINT("StartPlannerModule::updateData() received new route, reset status");
242242
}
243243

244+
constexpr double moving_velocity_threshold = 0.1;
245+
const double & ego_velocity = planner_data_->self_odometry->twist.twist.linear.x;
244246
if (
245247
planner_data_->operation_mode->mode == OperationModeState::AUTONOMOUS &&
246-
status_.driving_forward && !status_.first_engaged_and_driving_forward_time) {
248+
status_.driving_forward && !status_.first_engaged_and_driving_forward_time &&
249+
ego_velocity > moving_velocity_threshold) {
247250
status_.first_engaged_and_driving_forward_time = clock_->now();
248251
}
249252

@@ -1265,8 +1268,12 @@ TurnSignalInfo StartPlannerModule::calcTurnSignalInfo()
12651268
// In Geometric pull out, the ego stops once and then steers the wheels to the opposite direction.
12661269
// This sometimes causes the getBehaviorTurnSignalInfo method to detect the ego as stopped and
12671270
// close to complete its shift, so it wrongly turns off the blinkers, this override helps avoid
1268-
// this issue.
1271+
// this issue. Also, if the ego is not engaged (so it is stopped), the blinkers should still be
1272+
// activated.
12691273
const bool override_ego_stopped_check = std::invoke([&]() {
1274+
if (!status_.first_engaged_and_driving_forward_time) {
1275+
return true;
1276+
}
12701277
if (status_.planner_type != PlannerType::GEOMETRIC) {
12711278
return false;
12721279
}

0 commit comments

Comments
 (0)