#include <maneuvers.h>
Public Types | |
enum | CarState { UNKNOWN, INIT, POSITIVE_VELOCITY, NEUTRAL_VELOCITY, NEGATIVE_VELOCITY, PARALLEL_PARKING, REVERSING, NEUTRAL_VELOCITY_PARKING } |
Car state machine status. More... | |
enum | sequentialState { FIRST, SECOND, THIRD, FOURTH, FIFTH, SIXTH, SEVENTH, EIGHTH, NINETH, TENTH } |
Public Member Functions | |
void | init () |
Initialize the class. More... | |
void | loop () |
Start main control loop. More... | |
Maneuvers (const ros::NodeHandle &nh_) | |
void | setupMessaging () |
Start ros message subscribing and advertising. More... | |
void | stateManager () |
State Manager. More... | |
Public Attributes | |
int | maneuver |
Parking status. More... | |
Protected Member Functions | |
double | map (double value, double min_value, double max_value, double min_required, double max_required) |
void | negative_velocity (int value) |
Callback - Change and send message to manager. More... | |
void | neutral_velocity (int value) |
Callback - Change and send message to manager. More... | |
void | neutral_velocity_parking (int value) |
Callback - Change and send message to manager. More... | |
void | parallel () |
Parallel. More... | |
void | parallel_parking (int value) |
Callback - Change and send message to manager. More... | |
void | positive_velocity (int value) |
Callback - Change and send message to manager. More... | |
void | reverse () |
Reverse. More... | |
void | reversing (int value) |
Callback - Change and send message to manager. More... | |
void | saveData (string report_name) |
void | statusCallback (const atlascar_base::ManagerStatusPtr &status) |
Callback - Status of all paramters. More... | |
Protected Attributes | |
Class variables | |
The class variables can be both public or private. They should preferably be private whenever possible. | |
CarState | current_state |
Current state of state machine. More... | |
sequentialState | pparking |
Moving to stopped state. More... | |
sequentialState | rreverse |
Moving to stopped state. More... | |
ros::NodeHandle | nh |
Ros node handler. More... | |
ros::Publisher | command_pub |
Ros command publisher. More... | |
ros::Subscriber | command_sub_ |
Ros command subscriber. More... | |
ros::Subscriber | status_sub |
Ros status subscriber. More... | |
atlascar_base::ManagerCommand | command_msg |
Command message. More... | |
atlascar_base::ManagerStatus | status_msg |
Status message. More... | |
atlascar_base::ManagerStatus | status_memory |
Status message memory. More... | |
Gamepad | gamepad |
Gamepad communication class. More... | |
Definition at line 45 of file maneuvers.h.
Car state machine status.
Define all states of macine
Enumerator | |
---|---|
UNKNOWN | |
INIT | |
POSITIVE_VELOCITY | |
NEUTRAL_VELOCITY | |
NEGATIVE_VELOCITY | |
PARALLEL_PARKING | |
REVERSING | |
NEUTRAL_VELOCITY_PARKING |
Definition at line 100 of file maneuvers.h.
Enumerator | |
---|---|
FIRST | |
SECOND | |
THIRD | |
FOURTH | |
FIFTH | |
SIXTH | |
SEVENTH | |
EIGHTH | |
NINETH | |
TENTH |
Definition at line 113 of file maneuvers.h.
|
inline |
Definition at line 48 of file maneuvers.h.
void atlascar_base::Maneuvers::init | ( | ) |
Initialize the class.
Add the safety message to the command queue.
Definition at line 36 of file maneuvers.cpp.
void atlascar_base::Maneuvers::loop | ( | ) |
Start main control loop.
Loop the module sending command messages (velocity) to the manager. It currently loops at about 100Hz.
Definition at line 474 of file maneuvers.cpp.
|
protected |
|
protected |
Callback - Change and send message to manager.
Impose a negative velocity
Definition at line 121 of file maneuvers.cpp.
|
protected |
Callback - Change and send message to manager.
Impose a neutral velocity 0 km/h
Definition at line 168 of file maneuvers.cpp.
|
protected |
Callback - Change and send message to manager.
Impose a neutral gear
Definition at line 180 of file maneuvers.cpp.
|
protected |
|
protected |
Callback - Change and send message to manager.
Impose a sequence of velocity and direction
Definition at line 134 of file maneuvers.cpp.
|
protected |
Callback - Change and send message to manager.
Impose a positive velocity
Definition at line 107 of file maneuvers.cpp.
|
protected |
|
protected |
Callback - Change and send message to manager.
Impose a sequence of velocity and direction
Definition at line 151 of file maneuvers.cpp.
|
protected |
void atlascar_base::Maneuvers::setupMessaging | ( | ) |
Start ros message subscribing and advertising.
Subscribe command messages and advertise status messages.
Definition at line 72 of file maneuvers.cpp.
void atlascar_base::Maneuvers::stateManager | ( | ) |
|
protected |
Callback - Status of all paramters.
Allow check all parameters from manager
Definition at line 80 of file maneuvers.cpp.
|
protected |
Command message.
Definition at line 229 of file maneuvers.h.
|
protected |
Ros command publisher.
Definition at line 220 of file maneuvers.h.
|
protected |
Ros command subscriber.
Definition at line 223 of file maneuvers.h.
|
protected |
Current state of state machine.
Definition at line 208 of file maneuvers.h.
|
protected |
Gamepad communication class.
Definition at line 238 of file maneuvers.h.
int atlascar_base::Maneuvers::maneuver |
|
protected |
Ros node handler.
Definition at line 217 of file maneuvers.h.
|
protected |
Moving to stopped state.
Definition at line 211 of file maneuvers.h.
|
protected |
Moving to stopped state.
Definition at line 214 of file maneuvers.h.
|
protected |
Status message memory.
Definition at line 235 of file maneuvers.h.
|
protected |
Status message.
Definition at line 232 of file maneuvers.h.
|
protected |
Ros status subscriber.
Definition at line 226 of file maneuvers.h.