Carma-platform v4.2.0
CARMA Platform is built on robot operating system (ROS) and utilizes open source software (OSS) that enables Cooperative Driving Automation (CDA) features to allow Automated Driving Systems to interact and cooperate with infrastructure and other vehicles through communication.
|
#include <lightbar_manager_sm.hpp>
Public Member Functions | |
LightBarManagerStateMachine () | |
Default constructor for LightBarManagerStateMachine. More... | |
void | next (const LightBarEvent &event) |
Transition to the next state of the LightBarStateMachine. More... | |
LightBarState | getCurrentState () |
Get current state machine status. More... | |
void | handleStateChange (const carma_planning_msgs::msg::GuidanceState &msg) |
This function triggers the transitioning to the next state in LightBarStateMachine based on the guidance state change. More... | |
Private Member Functions | |
void | onDisengage () |
void | onActive () |
void | onEngage () |
Private Attributes | |
uint8_t | guidance_state_ = carma_planning_msgs::msg::GuidanceState::SHUTDOWN |
carma_ros2_utils::ClientPtr< carma_msgs::srv::ReleaseIndicatorControl > | request_control_client_ |
carma_ros2_utils::ClientPtr< carma_msgs::srv::RequestIndicatorControl > | release_control_client_ |
carma_ros2_utils::ClientPtr< carma_driver_msgs::srv::SetLightBarIndicator > | set_indicator_client_ |
LightBarState | current_state_ = DISENGAGED |
Definition at line 53 of file lightbar_manager_sm.hpp.
lightbar_manager::LightBarManagerStateMachine::LightBarManagerStateMachine | ( | ) |
Default constructor for LightBarManagerStateMachine.
Definition at line 22 of file lightbar_manager_sm.cpp.
LightBarState lightbar_manager::LightBarManagerStateMachine::getCurrentState | ( | ) |
Get current state machine status.
Definition at line 114 of file lightbar_manager_sm.cpp.
References current_state_.
Referenced by lightbar_manager::LightBarManagerWorker::getCurrentState().
void lightbar_manager::LightBarManagerStateMachine::handleStateChange | ( | const carma_planning_msgs::msg::GuidanceState & | msg | ) |
This function triggers the transitioning to the next state in LightBarStateMachine based on the guidance state change.
Definition at line 62 of file lightbar_manager_sm.cpp.
References lightbar_manager::ACTIVE, lightbar_manager::ENGAGED, guidance_state_, port_drayage_plugin::INACTIVE, onActive(), onDisengage(), onEngage(), and arbitrator::SHUTDOWN.
Referenced by lightbar_manager::LightBarManagerWorker::handleStateChange().
void lightbar_manager::LightBarManagerStateMachine::next | ( | const LightBarEvent & | event | ) |
Transition to the next state of the LightBarStateMachine.
Definition at line 25 of file lightbar_manager_sm.cpp.
References lightbar_manager::ACTIVE, current_state_, lightbar_manager::DISENGAGED, lightbar_manager::ENGAGED, lightbar_manager::GUIDANCE_CONNECTED, lightbar_manager::GUIDANCE_DISCONNECTED, lightbar_manager::GUIDANCE_DISENGAGED, and lightbar_manager::GUIDANCE_ENGAGED.
Referenced by lightbar_manager::LightBarManagerWorker::next(), onActive(), onDisengage(), and onEngage().
|
private |
Definition at line 98 of file lightbar_manager_sm.cpp.
References lightbar_manager::ENGAGED, lightbar_manager::GUIDANCE_CONNECTED, lightbar_manager::GUIDANCE_DISCONNECTED, guidance_state_, and next().
Referenced by handleStateChange().
|
private |
Definition at line 93 of file lightbar_manager_sm.cpp.
References lightbar_manager::GUIDANCE_DISENGAGED, and next().
Referenced by handleStateChange().
|
private |
Definition at line 108 of file lightbar_manager_sm.cpp.
References lightbar_manager::GUIDANCE_ENGAGED, and next().
Referenced by handleStateChange().
|
private |
Definition at line 94 of file lightbar_manager_sm.hpp.
Referenced by getCurrentState(), and next().
|
private |
Definition at line 86 of file lightbar_manager_sm.hpp.
Referenced by handleStateChange(), and onActive().
|
private |
Definition at line 90 of file lightbar_manager_sm.hpp.
|
private |
Definition at line 89 of file lightbar_manager_sm.hpp.
|
private |
Definition at line 91 of file lightbar_manager_sm.hpp.