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.
LocalizationTransitionTable.hpp
Go to the documentation of this file.
1/*
2 * Copyright (C) 2022 LEIDOS.
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License"); you may not
5 * use this file except in compliance with the License. You may obtain a copy of
6 * the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
12 * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
13 * License for the specific language governing permissions and limitations under
14 * the License.
15 */
16
17#pragma once
18
19#include "LocalizationTypes.hpp"
20
22{
27 {
28 public:
30 std::function<void(LocalizationState prev_state, LocalizationState new_state, LocalizationSignal signal)>;
31
38
44
51
60
61 private:
64
66
68
69 // Helper functions for processing each the provided signal based on the current state
76
82
89 void setAndLogState(LocalizationState new_state, LocalizationSignal source_signal);
90 };
91} // namespace localization_manager
Class defining the state transition table behavior for the LocalizationManager.
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.
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.
std::function< void(LocalizationState prev_state, LocalizationState new_state, LocalizationSignal signal)> TransitionCallback
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...
LocalizationState
Enum describing the possible states of the localization system.
LocalizerMode
Enum describing the possible operational modes of the LocalizationManager.
LocalizationSignal
Enum describing the possible signals to change the current LocalizationState.