2015-01-16 19:29:55 -05:00
|
|
|
#ifndef LOWER_H
|
|
|
|
#define LOWER_H
|
|
|
|
|
2015-01-17 12:55:51 -05:00
|
|
|
#include "Commands/Command.h"
|
2015-01-16 19:29:55 -05:00
|
|
|
#include "WPILib.h"
|
|
|
|
|
2015-03-01 17:19:00 -05:00
|
|
|
/**
|
|
|
|
* @brief Lowers the elevator until a timeout is reached
|
|
|
|
*/
|
2015-07-31 12:52:15 -04:00
|
|
|
class Lower: public Command {
|
|
|
|
private:
|
|
|
|
bool softLimits; //<! Enables/Disables hall effect sensors
|
2015-10-10 02:51:23 -04:00
|
|
|
double speed; //<! speed to lower the elevator
|
2015-07-31 12:52:15 -04:00
|
|
|
public:
|
|
|
|
/**
|
|
|
|
* @brief Constructs Lower
|
|
|
|
*
|
|
|
|
* @param timeout Timeout in seconds (default: 3.0)
|
2015-10-10 02:51:23 -04:00
|
|
|
*
|
2015-07-31 12:52:15 -04:00
|
|
|
* @param useSoftLimits Enables/Disables soft limits via hall effect sensors (default: true)
|
2015-10-10 02:51:23 -04:00
|
|
|
*
|
2015-10-09 13:10:34 -04:00
|
|
|
* @param liftSpeed Speed at which to lower the lift
|
2015-07-31 12:52:15 -04:00
|
|
|
*/
|
2015-10-09 13:10:34 -04:00
|
|
|
Lower(double timeout = 3.0, bool useSoftLimits = true, double liftSpeed=0);
|
2015-07-31 12:52:15 -04:00
|
|
|
/**
|
|
|
|
* @brief Initializes the class
|
|
|
|
*/
|
|
|
|
void Initialize();
|
|
|
|
/**
|
|
|
|
* @brief Lowers the elevator at -1.0 power
|
|
|
|
*/
|
|
|
|
void Execute();
|
|
|
|
/**
|
|
|
|
* @brief Checks if the command is finished
|
|
|
|
*
|
2015-10-10 02:51:23 -04:00
|
|
|
* @return True if the timeout was reached
|
2015-07-31 12:52:15 -04:00
|
|
|
*/
|
|
|
|
bool IsFinished();
|
|
|
|
/**
|
|
|
|
* @brief Sets the elevator to stop
|
|
|
|
*/
|
|
|
|
void End();
|
|
|
|
/**
|
|
|
|
* @brief Calls End()
|
|
|
|
*/
|
|
|
|
void Interrupted();
|
2015-01-16 19:29:55 -05:00
|
|
|
};
|
|
|
|
#endif
|
2015-02-08 12:26:15 -05:00
|
|
|
// vim: ts=2:sw=2:et
|