2015-01-11 16:02:49 -05:00
|
|
|
#ifndef OI_H
|
|
|
|
#define OI_H
|
|
|
|
|
|
|
|
#include "WPILib.h"
|
2015-02-12 21:18:48 -05:00
|
|
|
#include "Commands/Command.h"
|
2015-01-11 16:02:49 -05:00
|
|
|
|
2015-03-01 17:19:00 -05:00
|
|
|
/**
|
|
|
|
* @brief Controls the robot with joysticks
|
|
|
|
*/
|
2015-03-08 21:27:33 -04:00
|
|
|
class OI{
|
2015-01-16 20:12:48 -05:00
|
|
|
private:
|
2015-03-23 10:52:02 -04:00
|
|
|
Joystick *leftStick, //<! Left joystick
|
|
|
|
*rightStick; //<! Right joystick
|
2015-01-16 20:12:48 -05:00
|
|
|
public:
|
2015-03-01 17:19:00 -05:00
|
|
|
/**
|
|
|
|
* @brief Constructs OI
|
|
|
|
*/
|
2015-01-16 20:12:48 -05:00
|
|
|
OI();
|
2015-03-23 10:52:02 -04:00
|
|
|
Command *raise, //<! Raise command
|
|
|
|
*lower, //<! Lower command
|
|
|
|
*binLower, //<! BinLower command
|
|
|
|
*binRaise; //<! BinRaise command
|
2015-03-23 11:05:05 -04:00
|
|
|
/**
|
|
|
|
* @brief Gets the value of a throttle on the left controller
|
|
|
|
*
|
|
|
|
* @param stick The stick to get. Can be "left" or "right"
|
|
|
|
* @param axis The axis to get. Can be "x", "y", or "trigger"
|
|
|
|
*
|
|
|
|
* @return
|
|
|
|
*/
|
|
|
|
float GetLeftAxis(std::string stick, std::string axis);
|
|
|
|
/**
|
|
|
|
* @brief Gets the state of a button on the left controller
|
|
|
|
*
|
|
|
|
* @param button The button to get. Can be "x", "y", "a", "b", "lb", "rb", "back", "start", "lpress", "or" "rpress"
|
|
|
|
*
|
|
|
|
* @return True if the button is pressed
|
|
|
|
*/
|
|
|
|
bool GetLeftButton(std::string button);
|
2015-03-01 17:19:00 -05:00
|
|
|
/**
|
|
|
|
* @brief Returns the right joystick
|
|
|
|
*
|
|
|
|
* @return The right joystick
|
|
|
|
*/
|
2015-01-17 12:21:16 -05:00
|
|
|
Joystick* GetRightStick();
|
2015-03-01 17:19:00 -05:00
|
|
|
/**
|
|
|
|
* @brief Returns the left joystick
|
|
|
|
*
|
|
|
|
* @return The left joystick
|
|
|
|
*/
|
2015-01-17 12:21:16 -05:00
|
|
|
Joystick* GetLeftStick();
|
2015-03-01 17:19:00 -05:00
|
|
|
/**
|
|
|
|
* @brief Returns the left joystick throttle
|
|
|
|
*
|
|
|
|
* @return The left joystick throttle
|
|
|
|
*/
|
2015-02-15 17:10:20 -05:00
|
|
|
double GetLeftThrottle();
|
2015-03-01 17:19:00 -05:00
|
|
|
/**
|
|
|
|
* @brief Returns the right joystick throttle
|
|
|
|
*
|
|
|
|
* @return The right joystick throttle
|
|
|
|
*/
|
2015-02-15 17:10:20 -05:00
|
|
|
double GetRightThrottle();
|
2015-01-11 16:02:49 -05:00
|
|
|
};
|
|
|
|
#endif
|
2015-02-08 12:26:15 -05:00
|
|
|
// vim: ts=2:sw=2:et
|