Definition at line 15 of file joystickManager.h.
Public Types | |
enum | Status { LISTENING = 2, INITIALIZE = 3, CLOSED = 0, ERROR = -2, OPEN = 1 } |
enumeration for the status of the JoystickManager More... | |
Public Member Functions | |
int | startJoystickCtrl () |
calls the thread to begin pulling values from the joystick | |
int | stopJoystickCtrl () |
stop pulling values from the joystick | |
void | setStatus (Status newStatus) |
set the status of the joystick | |
void | highStickCheck () |
starts the thread to check if the joystick is centered properly and sets the status of the joystick | |
void | setInitWheel (int value) |
set the value of the joystick wheel | |
void | convertToSC (int x, int y, int factor) |
convert joystick inputs to the speed controller commands | |
void | setXAxis (int x) |
set the xAxis | |
void | setYAxis (int y) |
set the yAxis | |
void | setMaxSpeed (int spd) |
set the max speed the robot should go | |
void | spin (int x, int y, int factor) |
make the robot spin in place | |
Status | getStatus () |
get the status of the Joystick Manager | |
int | getfd () |
get the file descriptor for the joystick Manager thread | |
unsigned char | getAxes () |
returns how many axis' are on the joystick | |
unsigned char | getButtons () |
returns how many buttons are on the joystick | |
int | getInitWheel () |
get the value of the initWheel | |
int | getXAxis () |
get the current value of the xAxis | |
int | getYAxis () |
get the current value of the yAxis | |
int | getMaxSpeed () |
read the value that the max speed controller speed is sent to | |
Static Public Member Functions | |
JoystickManager * | theInstance () |
returns the singleton instance of the JoystickManager | |
void | highStickThread () |
Thread function to check if the joystick is centered. | |
void | joystickCtrl () |
thread function to the pull values from the joystick | |
Protected Member Functions | |
JoystickManager () | |
Gets the joystick ready to use and checks to make sure it is not off center startJoystickCtrl must be called to acutally use the joystick. | |
~JoystickManager () | |
Destructor for the JoystickManager. | |
Private Attributes | |
pthread_t | joystickThread |
Thread for pulling data from the joystick. | |
int | jsfd |
File descriptor for the joystick. | |
unsigned char | axes |
number of axes' | |
unsigned char | buttons |
number of buttons | |
int | initWheel |
value of the initWheel | |
int | xAxis |
The current xAxis value. | |
int | yAxis |
The current yAxis value. | |
int | maxSpeed |
The max speed set by the user 1-127. | |
Static Private Attributes | |
Status | status |
Status of the JoystickManager. | |
SysLog * | systemLogger |
Reference to the systemLogger. | |
RoboteqSC * | speedCtrl |
Reference to the speedController. |
|
enumeration for the status of the JoystickManager
Definition at line 20 of file joystickManager.h. Referenced by getStatus(). |
|
convert joystick inputs to the speed controller commands
|
|
returns how many axis' are on the joystick
Definition at line 129 of file joystickManager.h. References axes. |
|
returns how many buttons are on the joystick
Definition at line 135 of file joystickManager.h. References buttons. |
|
get the file descriptor for the joystick Manager thread
Definition at line 123 of file joystickManager.h. References jsfd. |
|
get the value of the initWheel
Definition at line 141 of file joystickManager.h. References initWheel. |
|
read the value that the max speed controller speed is sent to
Definition at line 159 of file joystickManager.h. References maxSpeed. |
|
get the status of the Joystick Manager
Definition at line 117 of file joystickManager.h. |
|
get the current value of the xAxis
Definition at line 147 of file joystickManager.h. References xAxis. |
|
get the current value of the yAxis
Definition at line 153 of file joystickManager.h. References yAxis. |
|
set the value of the joystick wheel
|
|
set the max speed the robot should go
|
|
set the status of the joystick
|
|
set the xAxis
|
|
set the yAxis
|
|
make the robot spin in place
|
|
calls the thread to begin pulling values from the joystick
|
|
stop pulling values from the joystick
|
|
returns the singleton instance of the JoystickManager
|