@@ -241,15 +241,19 @@ void StartPlannerModule::updateData()
241
241
DEBUG_PRINT (" StartPlannerModule::updateData() received new route, reset status" );
242
242
}
243
243
244
- constexpr double moving_velocity_threshold = 0.1 ;
245
- const double & ego_velocity = planner_data_->self_odometry ->twist .twist .linear .x ;
246
244
if (
247
245
planner_data_->operation_mode ->mode == OperationModeState::AUTONOMOUS &&
248
- status_.driving_forward && !status_.first_engaged_and_driving_forward_time &&
249
- ego_velocity > moving_velocity_threshold) {
246
+ status_.driving_forward && !status_.first_engaged_and_driving_forward_time ) {
250
247
status_.first_engaged_and_driving_forward_time = clock_->now ();
251
248
}
252
249
250
+ constexpr double moving_velocity_threshold = 0.1 ;
251
+ const double & ego_velocity = planner_data_->self_odometry ->twist .twist .linear .x ;
252
+ if (status_.first_engaged_and_driving_forward_time && ego_velocity > moving_velocity_threshold) {
253
+ // Ego is engaged, and has moved
254
+ status_.has_departed = true ;
255
+ }
256
+
253
257
status_.backward_driving_complete = hasFinishedBackwardDriving ();
254
258
if (status_.backward_driving_complete ) {
255
259
updateStatusAfterBackwardDriving ();
@@ -1270,10 +1274,8 @@ TurnSignalInfo StartPlannerModule::calcTurnSignalInfo()
1270
1274
// close to complete its shift, so it wrongly turns off the blinkers, this override helps avoid
1271
1275
// this issue. Also, if the ego is not engaged (so it is stopped), the blinkers should still be
1272
1276
// activated.
1273
- const bool override_ego_stopped_check = std::invoke ([&]() {
1274
- if (!status_.first_engaged_and_driving_forward_time ) {
1275
- return true ;
1276
- }
1277
+
1278
+ const bool geometric_planner_has_not_finished_first_path = std::invoke ([&]() {
1277
1279
if (status_.planner_type != PlannerType::GEOMETRIC) {
1278
1280
return false ;
1279
1281
}
@@ -1284,6 +1286,9 @@ TurnSignalInfo StartPlannerModule::calcTurnSignalInfo()
1284
1286
return distance_from_ego_to_stop_point < distance_threshold;
1285
1287
});
1286
1288
1289
+ const bool override_ego_stopped_check =
1290
+ !status_.has_departed || geometric_planner_has_not_finished_first_path;
1291
+
1287
1292
const auto [new_signal, is_ignore] = planner_data_->getBehaviorTurnSignalInfo (
1288
1293
path, shift_start_idx, shift_end_idx, current_lanes, current_shift_length,
1289
1294
status_.driving_forward , egos_lane_is_shifted, override_ego_stopped_check, is_pull_out);
0 commit comments