2015-01-16 19:29:55 -05:00
|
|
|
#include "Collector.h"
|
2015-01-11 16:02:49 -05:00
|
|
|
#include "../RobotMap.h"
|
|
|
|
|
2015-03-09 07:25:11 -04:00
|
|
|
Collector::Collector(): Subsystem("Collector"){
|
2015-02-02 19:56:27 -05:00
|
|
|
collectorMotorLeft=new CANTalon(COLLECTOR_LEFT_CAN);
|
2015-02-08 12:19:39 -05:00
|
|
|
collectorMotorBottom=new CANTalon(COLLECTOR_BOTTOM_CAN);
|
2015-02-14 17:12:58 -05:00
|
|
|
collectorMotorRamp=new CANTalon(COLLECTOR_RAMP_CAN);
|
2015-02-02 19:56:27 -05:00
|
|
|
collectorMotorRight=new CANTalon(COLLECTOR_RIGHT_CAN);
|
2015-02-15 07:53:19 -05:00
|
|
|
sonarAnalog=new AnalogInput(COLLECTOR_SONAR_ANALOG);
|
2015-01-11 16:02:49 -05:00
|
|
|
}
|
2015-02-14 16:16:03 -05:00
|
|
|
void Collector::InitDefaultCommand(){
|
2015-01-11 16:02:49 -05:00
|
|
|
}
|
2015-03-10 20:49:32 -04:00
|
|
|
void Collector::MoveRollers(double power){
|
2015-03-21 10:24:33 -04:00
|
|
|
MoveLeftRoller(power);
|
|
|
|
MoveRightRoller(-power);
|
|
|
|
MoveBottomRollers(power);
|
|
|
|
printf("Roller power: %f\n", power);
|
|
|
|
}
|
|
|
|
void Collector::MoveLeftRoller(double power){
|
2015-03-10 20:49:32 -04:00
|
|
|
collectorMotorLeft->Set(power);
|
2015-03-21 10:24:33 -04:00
|
|
|
}
|
|
|
|
void Collector::MoveRightRoller(double power){
|
|
|
|
collectorMotorRight->Set(power);
|
|
|
|
}
|
|
|
|
void Collector::MoveBottomRollers(double power){
|
2015-03-10 20:49:32 -04:00
|
|
|
collectorMotorBottom->Set(-power);
|
|
|
|
collectorMotorRamp->Set(power);
|
2015-02-15 07:53:19 -05:00
|
|
|
}
|
2015-02-15 17:10:20 -05:00
|
|
|
double Collector::GetSonarDistance(){
|
|
|
|
return sonarAnalog->GetAverageVoltage();
|
2015-02-02 12:14:27 -05:00
|
|
|
}
|
2015-02-08 12:26:15 -05:00
|
|
|
// vim: ts=2:sw=2:et
|