2
0
mirror of https://github.com/team2059/Dent synced 2024-12-18 20:52:29 -05:00
dent/Commands/Collector/RollVar.cpp

25 lines
681 B
C++
Raw Normal View History

2015-03-21 10:24:33 -04:00
#include "RollVar.h"
RollVar::RollVar(double speedVal): Command("RollVar"){
2015-03-23 10:52:02 -04:00
speed = speedVal;
2015-03-21 10:24:33 -04:00
}
void RollVar::Initialize(){
printf("Initialized RollVar\n");
SetTimeout(2.0);
Requires(DentRobot::drivetrain);
}
void RollVar::Execute(){
DentRobot::collector->MoveLeftRoller(1-(speed*(DentRobot::oi->GetLeftStick()->GetRawAxis(2)+1)/2));
DentRobot::collector->MoveRightRoller(-(speed*(DentRobot::oi->GetLeftStick()->GetRawAxis(2)+1)/2));
2015-03-21 10:24:33 -04:00
DentRobot::collector->MoveBottomRollers(speed*1.0);
}
bool RollVar::IsFinished(){
return IsTimedOut();
}
void RollVar::End(){
DentRobot::collector->MoveRollers(0.0);
}
void RollVar::Interrupted(){
End();
}
// vim: ts=2:sw=2:et