Skip to content

Commit 41366fb

Browse files
fix(bpp): transition from IDLE to WAITING APPROVAL (autowarefoundation#6051)
* fix(bpp): explicitly set the initial state Signed-off-by: Muhammad Zulfaqar Azmi <zulfaqar.azmi@tier4.jp> * remove isWaitingApproval() from state transition Signed-off-by: Muhammad Zulfaqar Azmi <zulfaqar.azmi@tier4.jp> * Update planning/behavior_path_planner_common/include/behavior_path_planner_common/interface/scene_module_interface.hpp Co-authored-by: Fumiya Watanabe <rej55.g@gmail.com> * explicitly set the initial state Signed-off-by: Zulfaqar Azmi <zulfaqar.azmi@tier4.jp> * remove setInitState in start_planner_module Signed-off-by: Zulfaqar Azmi <zulfaqar.azmi@tier4.jp> --------- Signed-off-by: Muhammad Zulfaqar Azmi <zulfaqar.azmi@tier4.jp> Signed-off-by: Zulfaqar Azmi <zulfaqar.azmi@tier4.jp> Co-authored-by: Fumiya Watanabe <rej55.g@gmail.com>
1 parent 1279359 commit 41366fb

File tree

1 file changed

+6
-9
lines changed

1 file changed

+6
-9
lines changed

planning/behavior_path_planner_common/include/behavior_path_planner_common/interface/scene_module_interface.hpp

+6-9
Original file line numberDiff line numberDiff line change
@@ -373,13 +373,10 @@ class SceneModuleInterface
373373
RCLCPP_DEBUG(getLogger(), "%s", message.data());
374374
};
375375
if (current_state_ == ModuleStatus::IDLE) {
376-
if (canTransitIdleToRunningState()) {
377-
log_debug_throttled("transiting from IDLE to RUNNING");
378-
return ModuleStatus::RUNNING;
379-
}
380-
381-
log_debug_throttled("transiting from IDLE to IDLE");
382-
return ModuleStatus::IDLE;
376+
auto init_state = setInitState();
377+
RCLCPP_DEBUG(
378+
getLogger(), "transiting from IDLE to %s", magic_enum::enum_name(init_state).data());
379+
return init_state;
383380
}
384381

385382
if (current_state_ == ModuleStatus::RUNNING) {
@@ -460,9 +457,9 @@ class SceneModuleInterface
460457
virtual bool canTransitFailureState() = 0;
461458

462459
/**
463-
* @brief State transition condition IDLE -> RUNNING
460+
* @brief Explicitly set the initial state
464461
*/
465-
virtual bool canTransitIdleToRunningState() = 0;
462+
virtual ModuleStatus setInitState() const { return ModuleStatus::RUNNING; }
466463

467464
/**
468465
* @brief Get candidate path. This information is used for external judgement.

0 commit comments

Comments
 (0)