44 throw std::invalid_argument(
"Transition table in unsupported state");
145 RCLCPP_INFO_STREAM(rclcpp::get_logger(
"approaching_emergency_vehicle_plugin"),
"ApproachingEmergencyVehicleTransitionTable received unsupported event of " <<
event <<
" while in state "
156 RCLCPP_INFO_STREAM(rclcpp::get_logger(
"approaching_emergency_vehicle_plugin"),
"ApproachingEmergencyVehicleTransitionTable changed ApproachingEmergencyVehicle Strategic Plugin state from "
157 <<
state_ <<
" to " << new_state <<
" because of event " << source_event);
ApproachingEmergencyVehicleState getState() const
Returns the current state.
void eventWhenSLOWING_DOWN_FOR_ERV(ApproachingEmergencyVehicleEvent event)
void eventWhenNO_APPROACHING_ERV(ApproachingEmergencyVehicleEvent event)
void logDebugEvent(ApproachingEmergencyVehicleEvent event) const
Helper function for logging the provide event.
void setAndLogState(ApproachingEmergencyVehicleState new_state, ApproachingEmergencyVehicleEvent source_event)
Function to change the current state and log the details of the transition.
void event(ApproachingEmergencyVehicleEvent event)
Trigger event for the transition table.
ApproachingEmergencyVehicleState state_
Current state. This state should only ever be set using the setAndLogState() function.
TransitionCallback transition_callback_
void setTransitionCallback(TransitionCallback cb)
Callback setting function. The provided callback will be triggered any time the current state changes...
void eventWhenMOVING_OVER_FOR_APPROACHING_ERV(ApproachingEmergencyVehicleEvent event)
std::function< void(ApproachingEmergencyVehicleState prev_state, ApproachingEmergencyVehicleState new_state, ApproachingEmergencyVehicleEvent event)> TransitionCallback
ApproachingEmergencyVehicleEvent
Enum describing the possible signals to change the current ApproachingEmergencyVehicleState.
@ APPROACHING_ERV_IN_PATH
@ APPROACHING_ERV_NOT_IN_PATH
ApproachingEmergencyVehicleState
Enum describing the possible states of the ApproachingEmergencyVehiclePlugin (Strategic Plugin)
@ MOVING_OVER_FOR_APPROACHING_ERV