18#include <rclcpp/rclcpp.hpp>
55 throw std::invalid_argument(
"Transition table in unsupported state");
120 RCLCPP_DEBUG_STREAM(rclcpp::get_logger(
"lci_strategic_plugin"),
"LCIStrategicStateTransitionTable received unsupported signal of " <<
signal <<
" while in state "
131 RCLCPP_INFO_STREAM(rclcpp::get_logger(
"lci_strategic_plugin"),
"LCIStrategicStateTransitionTable changed LCIStrategic Strategic Plugin state from "
132 <<
state_ <<
" to " << new_state <<
" because of signal " << source_signal);
void setTransitionCallback(TransitionCallback cb)
Callback setting function. The provided callback will be triggered any time the current state changes...
void logDebugSignal(TransitEvent signal) const
Helper function for logging the provide signal.
TransitState getState() const
Returns the current state.
void setAndLogState(TransitState new_state, TransitEvent source_signal)
Function to change the current state and log the details of the transition.
void signalWhenDEPARTING(TransitEvent signal)
void signalWhenAPPROACHING(TransitEvent signal)
void signalWhenWAITING(TransitEvent signal)
void signalWhenUNAVAILABLE(TransitEvent signal)
void signal(TransitEvent signal)
Trigger signal for the transition table.
TransitionCallback transition_callback_
std::function< void(TransitState prev_state, TransitState new_state, TransitEvent signal)> TransitionCallback
TransitState state_
Current state. This state should only ever be set using the setAndLogState() function.
TransitEvent
Enum describing the possible signals to change the current TransitState.
TransitState
Enum describing the possible states of the LCIStrategic Strategic Plugin.