2015-02-06 13:45:01 -05:00
|
|
|
#ifndef AUTODRIVE_H
|
|
|
|
#define AUTODRIVE_H
|
|
|
|
|
|
|
|
#include "Commands/Command.h"
|
|
|
|
#include "../../CommandBase.h"
|
|
|
|
#include "../../DentRobot.h"
|
|
|
|
#include "WPILib.h"
|
|
|
|
|
2015-03-01 17:19:00 -05:00
|
|
|
/**
|
|
|
|
* @brief Drives the robot without a joystick
|
|
|
|
*
|
|
|
|
* Drives the robot given a timeout and joystick values
|
|
|
|
*/
|
2015-02-06 13:45:01 -05:00
|
|
|
class AutoDrive: public Command{
|
2015-02-13 21:41:38 -05:00
|
|
|
private:
|
2015-03-02 08:28:03 -05:00
|
|
|
double x, //<! The x value of the simulated joystick value
|
|
|
|
y; //<! The y value of the simulated joystick value
|
2015-02-06 13:45:01 -05:00
|
|
|
public:
|
2015-03-01 17:19:00 -05:00
|
|
|
/**
|
|
|
|
* @brief Constructs AutoDrive
|
|
|
|
*
|
|
|
|
* @param double Timeout in seconds
|
|
|
|
* @param double Joystick x value (default: 0.0)
|
|
|
|
* @param double Joystick y value (default: 0.75)
|
|
|
|
*/
|
2015-02-27 15:44:18 -05:00
|
|
|
AutoDrive(double, double, double);
|
2015-03-01 17:19:00 -05:00
|
|
|
/**
|
|
|
|
* @brief Initializes the class
|
|
|
|
*/
|
2015-02-06 13:45:01 -05:00
|
|
|
void Initialize();
|
2015-03-01 17:19:00 -05:00
|
|
|
/**
|
|
|
|
* @brief Drives the robot
|
|
|
|
*/
|
2015-02-06 13:45:01 -05:00
|
|
|
void Execute();
|
2015-03-01 17:19:00 -05:00
|
|
|
/**
|
|
|
|
* @brief Checks if the command is finished
|
|
|
|
*
|
|
|
|
* @return True only if the timeout was reached
|
|
|
|
*/
|
2015-02-06 13:45:01 -05:00
|
|
|
bool IsFinished();
|
2015-03-01 17:19:00 -05:00
|
|
|
/**
|
|
|
|
* @brief Sets the drivetrain to stop
|
|
|
|
*/
|
2015-02-06 13:45:01 -05:00
|
|
|
void End();
|
2015-03-01 17:19:00 -05:00
|
|
|
/**
|
|
|
|
* @brief Calls End()
|
|
|
|
*/
|
2015-02-06 13:45:01 -05:00
|
|
|
void Interrupted();
|
|
|
|
};
|
|
|
|
#endif
|
2015-02-08 12:26:15 -05:00
|
|
|
// vim: ts=2:sw=2:et
|