Global management and control class. More...
#include <manager.h>
Public Member Functions | |
Mandatory common functions | |
These functions are mandatory to all low level classes in the atlacar_base namespace. All these must operate in a similar fashion across class. The constructor must only initialize variable values, all major initializations must be done in the init() function, setupMessaging() subscribes and advertises command messages and status (in that order). The loop() function will block the program in a constant loop relaying information to the hardware. The loop() function can operate in two fashions: setting a spin rate and calling ros::spinOnce() or calling directly ros::spin() if the command callback has been setup properly. In this class (Manager) it works by calling the ros::spinOnce() at a predefined rate.
| |
void | init () |
Initialize the class. | |
void | loop () |
Start main control loop. | |
Manager (const ros::NodeHandle &nh) | |
Class constructor. | |
void | setupMessaging () |
Start ros message subscribing and advertising. | |
~Manager () | |
Class destructor. | |
Private Member Functions | |
void | commandCallback (const atlascar_base::ManagerCommandPtr &command) |
Main command callback. | |
void | driverStatusCallback (const human_driver_monitor::HumanDriverMonitorStatusPtr &status) |
Driver status callback. | |
void | gearboxStatusCallback (const atlascar_base::GearboxStatusPtr &status) |
Gearbox status callback. | |
void | odometerStatusCallback (const odometer::OdometerStatusPtr &status) |
Velocity status callback. | |
void | plcStatusCallback (const atlascar_base::PlcStatusPtr &status) |
Plc status callback. | |
void | stateManager (const atlascar_base::ManagerCommandPtr &command) |
void | throttleStatusCallback (const atlascar_base::ThrottleStatusPtr &status) |
Throttle status callback. | |
void | toOutgoingMessages (const atlascar_base::ManagerCommandPtr &command) |
Private Attributes | |
atlascar_base::ManagerCommandPtr | command_ |
Command message pointer. | |
ros::Publisher | command_gearbox_pub_ |
Gearbox command publisher. | |
ros::Publisher | command_plc_pub_ |
Plc command publisher. | |
TopicQueuePriority < atlascar_base::ManagerCommandPtr > | command_queue_ |
Command queue holding class. | |
ros::Subscriber | command_sub_ |
Ros command subscriber. | |
ros::Publisher | command_throttle_pub_ |
Throttle command publisher. | |
human_driver_monitor::HumanDriverMonitorStatus | driver_status_ |
Driver status message. | |
atlascar_base::GearboxCommand | gearbox_command_ |
Gearbox command message. | |
atlascar_base::GearboxStatus | gearbox_status_ |
Gearbox status message. | |
ros::NodeHandle | nh_ |
Ros node handler. | |
odometer::OdometerStatus | odometer_status_ |
Velocity status message. | |
atlascar_base::PlcCommand | plc_command_ |
Plc command message. | |
atlascar_base::PlcStatus | plc_status_ |
Plc status message. | |
atlascar_base::ManagerCommandPtr | safety_command_ |
Safety command message pointer. | |
atlascar_base::ManagerStatus | status_ |
Status message. | |
ros::Subscriber | status_driver_sub_ |
Driver status subscriber. | |
ros::Subscriber | status_gearbox_sub_ |
Gearbox status subscriber. | |
ros::Subscriber | status_odometer_sub_ |
Velocity status subscriber. | |
ros::Subscriber | status_plc_sub_ |
Plc status subscriber. | |
ros::Publisher | status_pub_ |
Ros status publisher. | |
ros::Subscriber | status_throttle_sub_ |
Throttle status subscriber. | |
atlascar_base::ThrottleCommand | throttle_command_ |
Throttle command message. | |
atlascar_base::ThrottleStatus | throttle_status_ |
Throttle status message. | |
bool | verbose_ |
Verbose mode. |
Global management and control class.
This class is responsible for the synchronization, calibration and contextual control for the atlascar vehicle. The class communicates locally with the low level modules via command and status messages. The received status messages must be interpreted and calibrated while being integrated into global asynchronous status publisher. The global atlascar_base::ManagerStatus in periodically published independently of the frequency of incoming partial status messages. The manager receives global control messages atlascar_base::ManagerCommand.
Definition at line 70 of file manager.h.
atlascar_base::Manager::Manager | ( | const ros::NodeHandle & | nh | ) |
Class constructor.
Initialize variables, do not call any function
Definition at line 35 of file manager.cpp.
atlascar_base::Manager::~Manager | ( | ) |
void atlascar_base::Manager::commandCallback | ( | const atlascar_base::ManagerCommandPtr & | command | ) | [private] |
Main command callback.
Receive command messages from outside the atlascar_base.
Definition at line 111 of file manager.cpp.
void atlascar_base::Manager::driverStatusCallback | ( | const human_driver_monitor::HumanDriverMonitorStatusPtr & | status | ) | [private] |
Driver status callback.
Receive status messages from the Driver low level module
Definition at line 144 of file manager.cpp.
void atlascar_base::Manager::gearboxStatusCallback | ( | const atlascar_base::GearboxStatusPtr & | status | ) | [private] |
Gearbox status callback.
Receive status messages from the Gearbox low level module
Definition at line 166 of file manager.cpp.
void atlascar_base::Manager::init | ( | ) |
Initialize the class.
Add the safety message to the command queue.
Definition at line 42 of file manager.cpp.
void atlascar_base::Manager::loop | ( | ) |
Start main control loop.
Start ros spin and main state machine.
Definition at line 184 of file manager.cpp.
void atlascar_base::Manager::odometerStatusCallback | ( | const odometer::OdometerStatusPtr & | status | ) | [private] |
Velocity status callback.
Receive status messages from the Velocity low level module
Definition at line 161 of file manager.cpp.
void atlascar_base::Manager::plcStatusCallback | ( | const atlascar_base::PlcStatusPtr & | status | ) | [private] |
Plc status callback.
Receive status messages from the Plc low level module
Definition at line 126 of file manager.cpp.
void atlascar_base::Manager::setupMessaging | ( | ) |
Start ros message subscribing and advertising.
Subscribe local command messages and advertise local status messages. Subscribe to all low level status messages, and advertise all low level command messages.
Definition at line 54 of file manager.cpp.
void atlascar_base::Manager::stateManager | ( | const atlascar_base::ManagerCommandPtr & | command | ) | [private] |
Definition at line 179 of file manager.cpp.
void atlascar_base::Manager::throttleStatusCallback | ( | const atlascar_base::ThrottleStatusPtr & | status | ) | [private] |
Throttle status callback.
Receive status messages from the Throttle low level module
Definition at line 172 of file manager.cpp.
void atlascar_base::Manager::toOutgoingMessages | ( | const atlascar_base::ManagerCommandPtr & | command | ) | [private] |
Definition at line 72 of file manager.cpp.
atlascar_base::ManagerCommandPtr atlascar_base::Manager::command_ [private] |
ros::Publisher atlascar_base::Manager::command_gearbox_pub_ [private] |
ros::Publisher atlascar_base::Manager::command_plc_pub_ [private] |
TopicQueuePriority<atlascar_base::ManagerCommandPtr> atlascar_base::Manager::command_queue_ [private] |
ros::Subscriber atlascar_base::Manager::command_sub_ [private] |
ros::Publisher atlascar_base::Manager::command_throttle_pub_ [private] |
human_driver_monitor::HumanDriverMonitorStatus atlascar_base::Manager::driver_status_ [private] |
atlascar_base::GearboxCommand atlascar_base::Manager::gearbox_command_ [private] |
atlascar_base::GearboxStatus atlascar_base::Manager::gearbox_status_ [private] |
ros::NodeHandle atlascar_base::Manager::nh_ [private] |
odometer::OdometerStatus atlascar_base::Manager::odometer_status_ [private] |
atlascar_base::PlcCommand atlascar_base::Manager::plc_command_ [private] |
atlascar_base::PlcStatus atlascar_base::Manager::plc_status_ [private] |
atlascar_base::ManagerCommandPtr atlascar_base::Manager::safety_command_ [private] |
atlascar_base::ManagerStatus atlascar_base::Manager::status_ [private] |
ros::Subscriber atlascar_base::Manager::status_driver_sub_ [private] |
ros::Subscriber atlascar_base::Manager::status_gearbox_sub_ [private] |
ros::Subscriber atlascar_base::Manager::status_odometer_sub_ [private] |
ros::Subscriber atlascar_base::Manager::status_plc_sub_ [private] |
ros::Publisher atlascar_base::Manager::status_pub_ [private] |
ros::Subscriber atlascar_base::Manager::status_throttle_sub_ [private] |
atlascar_base::ThrottleCommand atlascar_base::Manager::throttle_command_ [private] |
atlascar_base::ThrottleStatus atlascar_base::Manager::throttle_status_ [private] |
bool atlascar_base::Manager::verbose_ [private] |