some more bug fixes.
This commit is contained in:
parent
eccd90ea8a
commit
c3a621a5c4
@ -8,6 +8,7 @@
|
||||
#define THUMB 2 // Thumb button number
|
||||
#define RAMP_RAISE 3 // Button 3 for Raising 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
|
||||
// affecting the robot. Use this for cleaning up drive train and shooter.
|
||||
@ -45,6 +46,7 @@ private:
|
||||
bool inverting;
|
||||
bool ramping;
|
||||
bool shooting;
|
||||
bool unjamming;
|
||||
float shooter_power;
|
||||
|
||||
LiveWindow *lw = LiveWindow::GetInstance();
|
||||
@ -68,6 +70,7 @@ private:
|
||||
pickupRunning = false;
|
||||
ramping = false;
|
||||
shooting = false;
|
||||
unjamming = false;
|
||||
shooter_power = 0;
|
||||
|
||||
}
|
||||
@ -135,7 +138,9 @@ private:
|
||||
shooter.BoostRamp();
|
||||
ramping = true;
|
||||
}*/
|
||||
else if(ramping)
|
||||
else if(ramping
|
||||
&& !operator_stick.GetRawButton(RAMP_LOWER)
|
||||
&& !operator_stick.GetRawButton(RAMP_RAISE))
|
||||
{
|
||||
std::cout << "Stopping Ramp.";
|
||||
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.
|
||||
@ -191,7 +207,7 @@ private:
|
||||
shooting = true;
|
||||
shooter.Shoot();
|
||||
}
|
||||
else if(shooting)
|
||||
else if(shooting && !operator_stick.GetRawButton(TRIGGER))
|
||||
{
|
||||
shooting = false;
|
||||
shooter.StopShooter();
|
||||
|
Reference in New Issue
Block a user