some more bug fixes.

This commit is contained in:
Jason Cox 2016-02-13 12:00:28 -05:00
parent eccd90ea8a
commit c3a621a5c4

View File

@ -8,6 +8,7 @@
#define THUMB 2 // Thumb button number #define THUMB 2 // Thumb button number
#define RAMP_RAISE 3 // Button 3 for Raising Ramp #define RAMP_RAISE 3 // Button 3 for Raising Ramp
#define RAMP_LOWER 4 // Button 4 to lower ramp. #define RAMP_LOWER 4 // Button 4 to lower ramp.
#define UNJAM 11
#define DEADZONE_RADIUS 0.01 // Deadzone Radius prevents tiny twitches in the joystick's value from #define DEADZONE_RADIUS 0.01 // Deadzone Radius prevents tiny twitches in the joystick's value from
// affecting the robot. Use this for cleaning up drive train and shooter. // affecting the robot. Use this for cleaning up drive train and shooter.
@ -45,6 +46,7 @@ private:
bool inverting; bool inverting;
bool ramping; bool ramping;
bool shooting; bool shooting;
bool unjamming;
float shooter_power; float shooter_power;
LiveWindow *lw = LiveWindow::GetInstance(); LiveWindow *lw = LiveWindow::GetInstance();
@ -68,6 +70,7 @@ private:
pickupRunning = false; pickupRunning = false;
ramping = false; ramping = false;
shooting = false; shooting = false;
unjamming = false;
shooter_power = 0; shooter_power = 0;
} }
@ -135,7 +138,9 @@ private:
shooter.BoostRamp(); shooter.BoostRamp();
ramping = true; ramping = true;
}*/ }*/
else if(ramping) else if(ramping
&& !operator_stick.GetRawButton(RAMP_LOWER)
&& !operator_stick.GetRawButton(RAMP_RAISE))
{ {
std::cout << "Stopping Ramp."; std::cout << "Stopping Ramp.";
shooter.StopRamp(); shooter.StopRamp();
@ -143,6 +148,17 @@ private:
} }
if(!unjamming && operator_stick.GetRawButton(UNJAM))
{
unjamming = true;
shooter.Unjam();
}
else if(unjamming && !operator_stick.GetRawButton(UNJAM))
{
shooter.PickUp(false);
unjamming = false;
}
/* /*
* Run the Shooter only while the THUMB button is held down on the operator stick. * Run the Shooter only while the THUMB button is held down on the operator stick.
@ -191,7 +207,7 @@ private:
shooting = true; shooting = true;
shooter.Shoot(); shooter.Shoot();
} }
else if(shooting) else if(shooting && !operator_stick.GetRawButton(TRIGGER))
{ {
shooting = false; shooting = false;
shooter.StopShooter(); shooter.StopShooter();