ASCO Aerial Autonomy
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Public Member Functions | Protected Attributes | List of all members
CommonSystemHandler< LogicStateMachineT, EventManagerT, RobotSystemT > Class Template Reference

Provides logic common to different system handlers to reduce code duplication. More...

#include <common_system_handler.h>

Collaboration diagram for CommonSystemHandler< LogicStateMachineT, EventManagerT, RobotSystemT >:
Collaboration graph
[legend]

Public Member Functions

 CommonSystemHandler (const CommonSystemHandlerConfig &config, RobotSystemT &robot_system)
 Constructor. More...
 
 CommonSystemHandler (const CommonSystemHandler &)=delete
 Delete copy constructor. More...
 
bool isConnected ()
 Checks if internal ROS topics are connected. More...
 
void startTimers ()
 Start state machine internal event processing and status timer. More...
 

Protected Attributes

ros::NodeHandle nh_
 
LogicStateMachineT logic_state_machine_
 State machine that gets run by the system. More...
 
EventManagerT event_manager_
 Event manager used by the state machine. More...
 
StateMachineGUIConnector
< EventManagerT,
LogicStateMachineT > 
state_machine_gui_connector_
 
SystemStatusPublisher
< LogicStateMachineT > 
system_status_pub_
 publishes status messages More...
 
AsyncTimer status_timer_
 Update uav status and state machine status. More...
 
AsyncTimer logic_state_machine_timer_
 Timer for running state machine. More...
 

Detailed Description

template<class LogicStateMachineT, class EventManagerT, class RobotSystemT>
class CommonSystemHandler< LogicStateMachineT, EventManagerT, RobotSystemT >

Provides logic common to different system handlers to reduce code duplication.

Template Parameters
LogicStateMachineTLogic state machine to use
EventManagerTEvent manager to use
RobotSystemTrobot system used by the state machine

Constructor & Destructor Documentation

template<class LogicStateMachineT, class EventManagerT, class RobotSystemT>
CommonSystemHandler< LogicStateMachineT, EventManagerT, RobotSystemT >::CommonSystemHandler ( const CommonSystemHandlerConfig &  config,
RobotSystemT &  robot_system 
)
inline

Constructor.

Instantiates state machine, timers. Individual system handlers must call startTimers to start the state machine and status timers.

A convenience function isConnected is provided to check if the ros topics associated with state machine event processing are connected or not. The individual system handlers must extend this function if needed.

Parameters
nhNodeHandle to use for event and command subscription
configProto configuration parameters
robot_systemrobot system used to create logic state machine
template<class LogicStateMachineT, class EventManagerT, class RobotSystemT>
CommonSystemHandler< LogicStateMachineT, EventManagerT, RobotSystemT >::CommonSystemHandler ( const CommonSystemHandler< LogicStateMachineT, EventManagerT, RobotSystemT > &  )
delete

Delete copy constructor.

Member Function Documentation

template<class LogicStateMachineT, class EventManagerT, class RobotSystemT>
bool CommonSystemHandler< LogicStateMachineT, EventManagerT, RobotSystemT >::isConnected ( )
inline

Checks if internal ROS topics are connected.

Returns
Returns true if connected and false otherwise
template<class LogicStateMachineT, class EventManagerT, class RobotSystemT>
void CommonSystemHandler< LogicStateMachineT, EventManagerT, RobotSystemT >::startTimers ( )
inline

Start state machine internal event processing and status timer.

Member Data Documentation

template<class LogicStateMachineT, class EventManagerT, class RobotSystemT>
EventManagerT CommonSystemHandler< LogicStateMachineT, EventManagerT, RobotSystemT >::event_manager_
protected

Event manager used by the state machine.

template<class LogicStateMachineT, class EventManagerT, class RobotSystemT>
LogicStateMachineT CommonSystemHandler< LogicStateMachineT, EventManagerT, RobotSystemT >::logic_state_machine_
protected

State machine that gets run by the system.

template<class LogicStateMachineT, class EventManagerT, class RobotSystemT>
AsyncTimer CommonSystemHandler< LogicStateMachineT, EventManagerT, RobotSystemT >::logic_state_machine_timer_
protected

Timer for running state machine.

template<class LogicStateMachineT, class EventManagerT, class RobotSystemT>
ros::NodeHandle CommonSystemHandler< LogicStateMachineT, EventManagerT, RobotSystemT >::nh_
protected
template<class LogicStateMachineT, class EventManagerT, class RobotSystemT>
StateMachineGUIConnector<EventManagerT, LogicStateMachineT> CommonSystemHandler< LogicStateMachineT, EventManagerT, RobotSystemT >::state_machine_gui_connector_
protected

Connects event manager to the state machine

template<class LogicStateMachineT, class EventManagerT, class RobotSystemT>
AsyncTimer CommonSystemHandler< LogicStateMachineT, EventManagerT, RobotSystemT >::status_timer_
protected

Update uav status and state machine status.

template<class LogicStateMachineT, class EventManagerT, class RobotSystemT>
SystemStatusPublisher<LogicStateMachineT> CommonSystemHandler< LogicStateMachineT, EventManagerT, RobotSystemT >::system_status_pub_
protected

publishes status messages


The documentation for this class was generated from the following file: