diff --git a/Commands/Drivetrain/Drive.cpp b/Commands/Drivetrain/Drive.cpp index 0424d45..baa348f 100644 --- a/Commands/Drivetrain/Drive.cpp +++ b/Commands/Drivetrain/Drive.cpp @@ -5,24 +5,15 @@ Drive::Drive(): Command("Drive") { } void Drive::Initialize() {} void Drive::Execute() { - double x, y, z; - x = DentRobot::oi->GetLeftStick()->GetRawAxis(0); - y = -DentRobot::oi->GetLeftStick()->GetRawAxis(1); + float x, y, z; + x = -DentRobot::oi->GetLeftStick()->GetRawAxis(0); + y = DentRobot::oi->GetLeftStick()->GetRawAxis(1); z = DentRobot::oi->GetLeftStick()->GetRawAxis(2); - // Lock the x axis when not holding button 1 - //if(DentRobot::oi->GetLeftStick()->GetRawButton(1)){ - // x = 0; - //} - //if(DentRobot::oi->GetLeftStick()->GetRawButton(2)){ - // y = 0; - //} //X axis, Y axis, Z axis, sensitivity, speed threshold (usually throttle) if(DentRobot::oi->GetLeftStick()->GetRawButton(11)) { x = -x; y = -y; } - printf("X:%d\n",x); - printf("Y:%d\n",y); DentRobot::drivetrain->DriveArcade(x, y, z, 0.9); } bool Drive::IsFinished() { diff --git a/Subsystems/Drivetrain.cpp b/Subsystems/Drivetrain.cpp index 48ee988..99b4d68 100644 --- a/Subsystems/Drivetrain.cpp +++ b/Subsystems/Drivetrain.cpp @@ -21,8 +21,8 @@ void Drivetrain::DriveArcade(double x, double y, double z, double sensitivity, b } else { correctZ = -z * 0.5; } - leftRear->Set(correctY+correctX); - rightRear->Set(correctY-correctX); + leftRear->Set(correctY+(correctX-correctZ)); + rightRear->Set(correctY-(correctX-correctZ)); } //Used in pretest void Drivetrain::TestMotor(e_motors motor, double power) {