2015-01-16 19:29:55 -05:00
|
|
|
#include "Drivetrain.h"
|
|
|
|
#include "../RobotMap.h"
|
2015-02-03 15:55:11 -05:00
|
|
|
#include "../Commands/Drivetrain/Drive.h"
|
2015-01-16 19:29:55 -05:00
|
|
|
|
2015-03-09 07:25:11 -04:00
|
|
|
Drivetrain::Drivetrain(): Subsystem("Drivetrain"){
|
2016-05-16 13:38:59 +00:00
|
|
|
rightFront = new Talon(DRIVE_FRONT_RIGHT_CAN);
|
|
|
|
leftFront = new Talon(DRIVE_FRONT_LEFT_CAN);
|
|
|
|
rightRear = new Talon(DRIVE_BACK_RIGHT_CAN);
|
|
|
|
leftRear = new Talon(DRIVE_BACK_LEFT_CAN);
|
2015-03-10 20:14:38 -04:00
|
|
|
gyro = new Gyro(DRIVE_GYRO_ANALOG);
|
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
|
|
|
}
|
2016-05-16 13:38:59 +00:00
|
|
|
void Drivetrain::DriveMecanum(double x, double y, double z){
|
|
|
|
rightFront->Set(y+(x+z));
|
|
|
|
rightRear->Set(y+(x+z));
|
|
|
|
leftFront->Set(-y+(x+z));
|
|
|
|
leftRear->Set(-y+(x+z));
|
2015-02-07 14:17:20 +00:00
|
|
|
}
|
2015-03-10 20:14:38 -04:00
|
|
|
void Drivetrain::ResetGyro(){
|
|
|
|
gyro->Reset();
|
|
|
|
}
|
2015-02-08 12:26:15 -05:00
|
|
|
// vim: ts=2:sw=2:et
|