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 <route_state_worker.hpp>
Public Types | |
enum | RouteEvent { ROUTE_LOADED = 0 , ROUTE_SELECTED = 1 , ROUTE_STARTED = 2 , ROUTE_COMPLETED = 3 , ROUTE_DEPARTED = 4 , ROUTE_ABORTED = 5 , ROUTE_GEN_FAILED = 6 , ROUTE_INVALIDATION = 7 } |
enum | RouteState { LOADING = 0 , SELECTION = 1 , ROUTING = 2 , FOLLOWING = 3 } |
Public Member Functions | |
RouteStateWorker ()=default | |
void | onRouteEvent (RouteEvent event) |
Process route event based on designed state machine diagram. More... | |
RouteState | getRouteState () const |
Get current route state machine state. More... | |
void | setLoggerInterface (rclcpp::node_interfaces::NodeLoggingInterface::SharedPtr logger) |
Private Attributes | |
RouteState | state_ = RouteState::LOADING |
rclcpp::node_interfaces::NodeLoggingInterface::SharedPtr | logger_ |
Definition at line 24 of file route_state_worker.hpp.
Possible events for the RouteStateWorker to respond to: ROUTE_LOADED - Route worker received all necessary parameters and loaded route file path ROUTE_SELECTED - A route file has been selected by user ROUTE_STARTED - A route is generated by provided route file ROUTE_COMPLETED - Reached the destination of current route ROUTE_DEPARTED - Vehicle has deviated from the route ROUTE_ABORTED - User decides to stop following the current route ROUTE_GEN_FAILED - No route can be generated based on provided route file ROUTE_INVALIDATION - Certain portion of the route is invalidated based on situation.
Enumerator | |
---|---|
ROUTE_LOADED | |
ROUTE_SELECTED | |
ROUTE_STARTED | |
ROUTE_COMPLETED | |
ROUTE_DEPARTED | |
ROUTE_ABORTED | |
ROUTE_GEN_FAILED | |
ROUTE_INVALIDATION |
Definition at line 39 of file route_state_worker.hpp.
Possible states of the RouteStateWorker: LOADING - RouteState worker's initial state, waiting for all necessary parameters to be set SELECTION - RouteState worker is waiting on user to select a route ROUTING - Calling lanelet2 library to generate a route based on selected route file FOLLOWING - Following a route and tracking its downtrack and crosstrack distance
Enumerator | |
---|---|
LOADING | |
SELECTION | |
ROUTING | |
FOLLOWING |
Definition at line 57 of file route_state_worker.hpp.
|
default |
RouteStateWorker::RouteState route::RouteStateWorker::getRouteState | ( | ) | const |
Get current route state machine state.
Definition at line 21 of file route_state_worker.cpp.
References state_.
Referenced by route::RouteGeneratorWorker::abortActiveRouteCb(), route::RouteGeneratorWorker::bumperPoseCb(), route::RouteGeneratorWorker::getAvailableRouteCb(), route::RouteGeneratorWorker::setActiveRouteCb(), and route::RouteGeneratorWorker::spinCallback().
void route::RouteStateWorker::onRouteEvent | ( | RouteEvent | event | ) |
Process route event based on designed state machine diagram.
event | Incoming route event |
Definition at line 25 of file route_state_worker.cpp.
References logger_, state_, and carma_cooperative_perception::to_string().
Referenced by route::RouteGeneratorWorker::abortActiveRouteCb(), route::RouteGeneratorWorker::bumperPoseCb(), route::RouteGeneratorWorker::getAvailableRouteCb(), route::RouteGeneratorWorker::setActiveRouteCb(), route::RouteGeneratorWorker::setRouteFilePath(), and route::RouteGeneratorWorker::spinCallback().
void route::RouteStateWorker::setLoggerInterface | ( | rclcpp::node_interfaces::NodeLoggingInterface::SharedPtr | logger | ) |
Definition at line 70 of file route_state_worker.cpp.
References logger_.
Referenced by route::RouteGeneratorWorker::setLoggerInterface().
|
private |
Definition at line 85 of file route_state_worker.hpp.
Referenced by onRouteEvent(), and setLoggerInterface().
|
private |
Definition at line 82 of file route_state_worker.hpp.
Referenced by getRouteState(), and onRouteEvent().