2
0
mirror of https://github.com/team2059/Dent synced 2025-01-07 22:14:14 -05:00
dent/Subsystems/Drivetrain.cpp

25 lines
689 B
C++
Raw Normal View History

2015-01-16 19:29:55 -05:00
#include "Drivetrain.h"
#include "../RobotMap.h"
#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