31 RCLCPP_DEBUG_STREAM(
rclcpp::get_logger(
"localization_manager"),
"LocalizationTransitionTable received unsupported signal of " <<
signal <<
"while in state" <<
state_);
40 RCLCPP_INFO_STREAM(
rclcpp::get_logger(
"localization_manager"),
"LocalizationTransitionTable changed localization state from " <<
state_ <<
" to " << new_state <<
" because of signal " << source_signal <<
" while in mode " <<
mode_);
192 throw std::runtime_error(
"GNSS_DATA_TIMEOUT occurred while in DEGRADED_NO_LIDAR_FIX state. Localization cannot recover");
242 throw std::invalid_argument(
"Invalid signal passed to LocalizationTransitionTable::signal");
void signal(LocalizationSignal signal)
Trigger signal for the transition table.
void setAndLogState(LocalizationState new_state, LocalizationSignal source_signal)
Function to change the current state and log the details of the transition.
void signalWhenDEGRADED_NO_LIDAR_FIX(LocalizationSignal signal)
void signalWhenAWAIT_MANUAL_INITIALIZATION(LocalizationSignal signal)
void signalWhenINITIALIZING(LocalizationSignal signal)
LocalizationState state_
Current state. This state should only ever be set using the setAndLogState() function.
void logDebugSignal(LocalizationSignal signal) const
Helper function for logging the provide signal.
void signalWhenUNINITIALIZED(LocalizationSignal signal)
TransitionCallback transition_callback_
void signalWhenDEGRADED(LocalizationSignal signal)
void signalWhenOPERATIONAL(LocalizationSignal signal)
std::function< void(LocalizationState prev_state, LocalizationState new_state, LocalizationSignal signal)> TransitionCallback
LocalizationTransitionTable(LocalizerMode mode)
Constructor.
LocalizationState getState() const
Returns the current state.
void setTransitionCallback(TransitionCallback cb)
Callback setting function. The provided callback will be triggered any time the current state changes...
rclcpp::Logger get_logger()
Return the module-level logger used by all basic_autonomy functions.
LocalizationState
Enum describing the possible states of the localization system.
@ AWAIT_MANUAL_INITIALIZATION
LocalizerMode
Enum describing the possible operational modes of the LocalizationManager.
LocalizationSignal
Enum describing the possible signals to change the current LocalizationState.
@ POOR_NDT_FREQ_OR_FITNESS_SCORE
@ UNUSABLE_NDT_FREQ_OR_FITNESS_SCORE
@ GOOD_NDT_FREQ_AND_FITNESS_SCORE
@ LIDAR_INITIALIZED_SWITCH_TO_GPS