Skip to content

Commit e0e29e4

Browse files
committed
just count the elapsed time from engage
Signed-off-by: Mamoru Sobue <mamoru.sobue@tier4.jp>
1 parent eb72adb commit e0e29e4

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

planning/behavior_path_start_planner_module/include/behavior_path_start_planner_module/start_planner_module.hpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ struct PullOutStatus
7171
std::shared_ptr<PathWithLaneId> prev_stop_path_after_approval{nullptr};
7272
std::optional<Pose> stop_pose{std::nullopt};
7373
//! record the first time when the state changed from !isActivated() to isActivated()
74-
std::optional<rclcpp::Time> first_approved_time{std::nullopt};
74+
std::optional<rclcpp::Time> first_engaged_time{std::nullopt};
7575

7676
PullOutStatus() {}
7777
};

planning/behavior_path_start_planner_module/src/start_planner_module.cpp

+5-5
Original file line numberDiff line numberDiff line change
@@ -178,8 +178,8 @@ void StartPlannerModule::updateData()
178178

179179
if (
180180
planner_data_->operation_mode->mode == OperationModeState::AUTONOMOUS &&
181-
!status_.first_approved_time && isActivated()) {
182-
status_.first_approved_time = clock_->now();
181+
!status_.first_engaged_time) {
182+
status_.first_engaged_time = clock_->now();
183183
}
184184

185185
if (hasFinishedBackwardDriving()) {
@@ -1086,11 +1086,11 @@ bool StartPlannerModule::hasFinishedPullOut() const
10861086

10871087
bool StartPlannerModule::needToPrepareBlinkerBeforeStart() const
10881088
{
1089-
if (!status_.first_approved_time) {
1089+
if (!status_.first_engaged_time) {
10901090
return true;
10911091
}
1092-
const auto first_approved_time = status_.first_approved_time.value();
1093-
const double elapsed = rclcpp::Duration(clock_->now() - first_approved_time).seconds();
1092+
const auto first_engaged_time = status_.first_engaged_time.value();
1093+
const double elapsed = rclcpp::Duration(clock_->now() - first_engaged_time).seconds();
10941094
return elapsed < parameters_->prepare_time_before_start;
10951095
}
10961096

0 commit comments

Comments
 (0)