2015-01-16 19:29:55 -05:00
|
|
|
#include "Drivetrain.h"
|
|
|
|
#include "../RobotMap.h"
|
2015-01-17 12:55:51 -05:00
|
|
|
#include "../Commands/Drive.h"
|
2015-01-16 19:29:55 -05:00
|
|
|
|
2015-01-17 12:21:16 -05:00
|
|
|
Drivetrain::Drivetrain() : Subsystem("Drivetrain"){
|
2015-01-18 14:03:41 +00:00
|
|
|
frontLeft=new CANTalon(40);
|
|
|
|
frontRight=new CANTalon(41);
|
|
|
|
backLeft=new CANTalon(42);
|
|
|
|
backRight=new CANTalon(43);
|
2015-01-17 10:34:08 -05:00
|
|
|
drive=new RobotDrive(frontLeft, frontRight, backLeft, backRight);
|
2015-01-16 19:29:55 -05:00
|
|
|
}
|
2015-01-17 12:21:16 -05:00
|
|
|
void Drivetrain::InitDefaultCommand(){
|
2015-01-17 12:55:51 -05:00
|
|
|
SetDefaultCommand(new Drive());
|
2015-01-16 19:29:55 -05:00
|
|
|
}
|
2015-01-17 10:34:08 -05:00
|
|
|
void Drivetrain::DriveMecanum(float x, float y, float rotation){
|
|
|
|
drive->MecanumDrive_Cartesian(x, y, rotation);
|
|
|
|
}
|
|
|
|
void Drivetrain::DriveArcade(float x, float y){
|
|
|
|
drive->ArcadeDrive(x, y);
|
|
|
|
}
|