2015-01-16 19:29:55 -05:00
|
|
|
#include "Collector.h"
|
2015-01-11 16:02:49 -05:00
|
|
|
#include "../RobotMap.h"
|
|
|
|
|
2015-01-16 19:29:55 -05:00
|
|
|
Collector::Collector() : Subsystem("Collector") {
|
2015-02-02 12:14:27 -05:00
|
|
|
windowMotorLeft=new CANTalon(50);
|
|
|
|
windowMotorRight=new CANTalon(51);
|
|
|
|
collectorMotorLeft=new CANTalon(52);
|
|
|
|
collectorMotorRight=new CANTalon(53);
|
|
|
|
boxSwitch=new DigitalInput(9);
|
2015-01-11 16:02:49 -05:00
|
|
|
}
|
2015-01-16 19:29:55 -05:00
|
|
|
void Collector::InitDefaultCommand() {
|
2015-01-11 16:02:49 -05:00
|
|
|
}
|
2015-02-02 12:14:27 -05:00
|
|
|
void Collector::MoveArms(float a){
|
2015-02-02 18:53:02 -05:00
|
|
|
windowMotorLeft->Set(a);
|
|
|
|
windowMotorRight->Set(-a);
|
|
|
|
a++;
|
2015-02-02 12:14:27 -05:00
|
|
|
}
|
|
|
|
void Collector::MoveRollers(float a){
|
2015-02-02 18:53:02 -05:00
|
|
|
collectorMotorLeft->Set(a);
|
|
|
|
collectorMotorRight->Set(-a);
|
|
|
|
r++;
|
2015-02-02 12:14:27 -05:00
|
|
|
}
|
|
|
|
bool Collector::ArmsDoneMoving(){
|
2015-02-02 18:53:02 -05:00
|
|
|
//TODO calibrate these values or find a sensor to use
|
|
|
|
if(a>=200){
|
|
|
|
return true;
|
|
|
|
}else{
|
|
|
|
return false;
|
|
|
|
}
|
2015-02-02 12:14:27 -05:00
|
|
|
}
|
|
|
|
bool Collector::BoxCollected(){
|
2015-02-02 18:53:02 -05:00
|
|
|
return boxSwitch->Get();
|
2015-01-17 12:21:16 -05:00
|
|
|
}
|