2
0
mirror of https://github.com/team2059/Dent synced 2024-12-18 20:52:29 -05:00

Added drivetrain code

This commit is contained in:
Austen Adler 2015-01-17 10:34:08 -05:00
parent 3dd19f8a53
commit ade2ce7bfb
2 changed files with 15 additions and 0 deletions

View File

@ -2,6 +2,17 @@
#include "../RobotMap.h" #include "../RobotMap.h"
Drivetrain::Drivetrain() : Subsystem("Drivetrain") { Drivetrain::Drivetrain() : Subsystem("Drivetrain") {
frontLeft=new Talon(0);
frontRight=new Talon(1);
backLeft=new Talon(2);
backRight=new Talon(3);
drive=new RobotDrive(frontLeft, frontRight, backLeft, backRight);
} }
void Drivetrain::InitDefaultCommand() { void Drivetrain::InitDefaultCommand() {
} }
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);
}

View File

@ -5,8 +5,12 @@
class Drivetrain: public Subsystem class Drivetrain: public Subsystem
{ {
private: private:
Talon *frontLeft, *frontRight, *backLeft, *backRight;
RobotDrive *drive;
public: public:
Drivetrain(); Drivetrain();
void InitDefaultCommand(); void InitDefaultCommand();
void DriveMecanum(float, float, float);
void DriveArcade(float, float);
}; };
#endif #endif