diff --git a/planning/behavior_path_start_planner_module/include/behavior_path_start_planner_module/start_planner_module.hpp b/planning/behavior_path_start_planner_module/include/behavior_path_start_planner_module/start_planner_module.hpp index a9eb81c3ba235..067bbd5d74aee 100644 --- a/planning/behavior_path_start_planner_module/include/behavior_path_start_planner_module/start_planner_module.hpp +++ b/planning/behavior_path_start_planner_module/include/behavior_path_start_planner_module/start_planner_module.hpp @@ -71,7 +71,7 @@ struct PullOutStatus std::shared_ptr prev_stop_path_after_approval{nullptr}; std::optional stop_pose{std::nullopt}; //! record the first time when the state changed from !isActivated() to isActivated() - std::optional first_approved_time{std::nullopt}; + std::optional first_engaged_time{std::nullopt}; PullOutStatus() {} }; diff --git a/planning/behavior_path_start_planner_module/src/start_planner_module.cpp b/planning/behavior_path_start_planner_module/src/start_planner_module.cpp index acccd5319bab0..2171373cd85ff 100644 --- a/planning/behavior_path_start_planner_module/src/start_planner_module.cpp +++ b/planning/behavior_path_start_planner_module/src/start_planner_module.cpp @@ -176,8 +176,10 @@ void StartPlannerModule::updateData() DEBUG_PRINT("StartPlannerModule::updateData() received new route, reset status"); } - if (!status_.first_approved_time && isActivated()) { - status_.first_approved_time = clock_->now(); + if ( + planner_data_->operation_mode->mode == OperationModeState::AUTONOMOUS && + !status_.first_engaged_time) { + status_.first_engaged_time = clock_->now(); } if (hasFinishedBackwardDriving()) { @@ -1084,11 +1086,11 @@ bool StartPlannerModule::hasFinishedPullOut() const bool StartPlannerModule::needToPrepareBlinkerBeforeStart() const { - if (!status_.first_approved_time) { + if (!status_.first_engaged_time) { return true; } - const auto first_approved_time = status_.first_approved_time.value(); - const double elapsed = rclcpp::Duration(clock_->now() - first_approved_time).seconds(); + const auto first_engaged_time = status_.first_engaged_time.value(); + const double elapsed = rclcpp::Duration(clock_->now() - first_engaged_time).seconds(); return elapsed < parameters_->prepare_time_before_start; }