Skip to content

Commit

Permalink
fix(bpp): transition from IDLE to WAITING APPROVAL (autowarefoundatio…
Browse files Browse the repository at this point in the history
…n#6051)

* fix(bpp): explicitly set the initial state

Signed-off-by: Muhammad Zulfaqar Azmi <[email protected]>

* remove isWaitingApproval() from state transition

Signed-off-by: Muhammad Zulfaqar Azmi <[email protected]>

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

Co-authored-by: Fumiya Watanabe <[email protected]>

* explicitly set the initial state

Signed-off-by: Zulfaqar Azmi <[email protected]>

* remove setInitState in start_planner_module

Signed-off-by: Zulfaqar Azmi <[email protected]>

---------

Signed-off-by: Muhammad Zulfaqar Azmi <[email protected]>
Signed-off-by: Zulfaqar Azmi <[email protected]>
Co-authored-by: Fumiya Watanabe <[email protected]>
  • Loading branch information
zulfaqar-azmi-t4 and rej55 authored Feb 2, 2024
1 parent 1279359 commit 41366fb
Showing 1 changed file with 6 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -373,13 +373,10 @@ class SceneModuleInterface
RCLCPP_DEBUG(getLogger(), "%s", message.data());
};
if (current_state_ == ModuleStatus::IDLE) {
if (canTransitIdleToRunningState()) {
log_debug_throttled("transiting from IDLE to RUNNING");
return ModuleStatus::RUNNING;
}

log_debug_throttled("transiting from IDLE to IDLE");
return ModuleStatus::IDLE;
auto init_state = setInitState();
RCLCPP_DEBUG(
getLogger(), "transiting from IDLE to %s", magic_enum::enum_name(init_state).data());
return init_state;
}

if (current_state_ == ModuleStatus::RUNNING) {
Expand Down Expand Up @@ -460,9 +457,9 @@ class SceneModuleInterface
virtual bool canTransitFailureState() = 0;

/**
* @brief State transition condition IDLE -> RUNNING
* @brief Explicitly set the initial state
*/
virtual bool canTransitIdleToRunningState() = 0;
virtual ModuleStatus setInitState() const { return ModuleStatus::RUNNING; }

/**
* @brief Get candidate path. This information is used for external judgement.
Expand Down

0 comments on commit 41366fb

Please sign in to comment.