This class is not fully documented! More...
#include <gearbox.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 (Gearbox) it works by calling the ros::spinOnce() at a predefined rate.
| |
Gearbox (const ros::NodeHandle &nh) | |
Class constructor. More... | |
~Gearbox () | |
Class destructor. More... | |
void | init () |
Initialize the class. More... | |
void | setupMessaging () |
Start ros message subscribing and advertising. More... | |
void | loop () |
Start main control loop. More... | |
Private Types | |
enum | { OFFLINE =0, ONLINE } |
Online and offline states. More... | |
Private Member Functions | |
void | commandCallback (const atlascar_base::GearboxCommandPtr &command) |
Command message handler. More... | |
void | diagnostics (diagnostic_updater::DiagnosticStatusWrapper &stat) |
int | interpreterMessage (string &message) |
int | maintainConnection () |
Keep connection alive. More... | |
int | receiveMessage (string &message) |
Private Attributes | |
tcp_client * | comm_ |
TCP client communication class pointer. More... | |
atlascar_base::GearboxCommandPtr | command_ |
Command message pointer. More... | |
TopicQueuePriority < atlascar_base::GearboxCommandPtr > | command_queue_ |
Command queue holding class. More... | |
ros::Subscriber | command_sub_ |
Ros command subscriber. More... | |
int | connection_status_ |
Current connection status. More... | |
std::string | ip_ |
ros::NodeHandle | nh_ |
Ros node handler. More... | |
int | port_ |
atlascar_base::GearboxCommandPtr | safety_command_ |
Safety command message pointer. More... | |
atlascar_base::GearboxStatus | status_ |
Status message. More... | |
diagnostic_updater::HeaderlessTopicDiagnostic | status_freq_ |
double | status_max_frequency_ |
double | status_min_frequency_ |
ros::Publisher | status_pub_ |
Ros status publisher. More... | |
diagnostic_updater::Updater | updater_ |
bool | verbose_ |
Verbose mode. More... | |
This class is not fully documented!
The documentation of this class is the responsibility of masters student Pedro Pinheiro (assigned by Jorge Almeida)
|
private |
atlascar_base::Gearbox::Gearbox | ( | const ros::NodeHandle & | nh | ) |
Class constructor.
Mandatory. Should only be used for variable initialization.
Definition at line 38 of file gearbox.cpp.
atlascar_base::Gearbox::~Gearbox | ( | ) |
Class destructor.
Definition at line 52 of file gearbox.cpp.
|
private |
Command message handler.
Receive command messages and put them in the queue.
command | received command message |
Definition at line 135 of file gearbox.cpp.
|
inlineprivate |
void atlascar_base::Gearbox::init | ( | ) |
Initialize the class.
Mandatory. To specific initialization tasks, anything that cannot be preformed in the constructor should be done here.
Definition at line 56 of file gearbox.cpp.
|
private |
Definition at line 177 of file gearbox.cpp.
void atlascar_base::Gearbox::loop | ( | ) |
Start main control loop.
Mandatory. Do the main loop of the program, call ros spin or spinOnce as needed, should only quit on ros exit command.
Definition at line 79 of file gearbox.cpp.
|
private |
Keep connection alive.
Maintains the connection with the hardware active, reconnects if needed.
Definition at line 140 of file gearbox.cpp.
|
private |
Definition at line 231 of file gearbox.cpp.
void atlascar_base::Gearbox::setupMessaging | ( | ) |
Start ros message subscribing and advertising.
Mandatory. Subscribe command messages and advertise status messages.
Definition at line 73 of file gearbox.cpp.
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |