From 2f010032da695f31973a97257f8011d819ac951d Mon Sep 17 00:00:00 2001 From: Aidan Ferguson Date: Mon, 22 Feb 2016 21:19:51 -0500 Subject: [PATCH] untested tweaks: different TURN_FACTOR, buttons toggle between piecewise and arcade drive --- Robot2016/src/Robot.cpp | 30 +++++++++++++++++++++++------- 1 file changed, 23 insertions(+), 7 deletions(-) diff --git a/Robot2016/src/Robot.cpp b/Robot2016/src/Robot.cpp index e656fd4..0fb82ac 100644 --- a/Robot2016/src/Robot.cpp +++ b/Robot2016/src/Robot.cpp @@ -14,7 +14,7 @@ // affecting the robot. Use this for cleaning up drive train and shooter. // Also used for detecting changes in an axis' value. -#define TURN_FACTOR 1.5 // Left(x,y) = y*(1 + TF*x) : x < 0 +#define TURN_FACTOR 0.5 // Left(x,y) = y*(1 + TF*x) : x < 0 // = y : x >= 0 // Right(x,y) = y : x < 0 // = y*(1 - TF*x) : x >= 0 @@ -52,6 +52,7 @@ private: bool ramping; bool shooting; bool unjamming; + bool arcade; float shooter_power; LiveWindow *lw = LiveWindow::GetInstance(); @@ -119,16 +120,31 @@ private: void TeleopPeriodic() { - if (driver_stick.GetRawButton(THUMB)) + if(driver_stick.GetRawButton(7)) { - float left = driver_stick.GetTwist(); - float right = -driver_stick.GetTwist(); - - drive.TankDrive(left, right); + arcade = true; + } + if(driver_stick.GetRawButton(8)) + { + arcade = false; + } + if (arcade) + { + drive.ArcadeDrive(driver_stick); } else { - UpdateDrive(); + if (driver_stick.GetRawButton(THUMB)) + { + float left = driver_stick.GetTwist(); + float right = -driver_stick.GetTwist(); + + drive.TankDrive(left, right); + } + else + { + UpdateDrive(); + } } //bool rampDoing = false; // This is shit code for testing. Replace it with real code.