untested tweaks: different TURN_FACTOR, buttons toggle between piecewise and arcade drive

This commit is contained in:
Aidan Ferguson 2016-02-22 21:19:51 -05:00
parent 5153aaa161
commit 2f010032da
1 changed files with 23 additions and 7 deletions

View File

@ -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.