Tweaking pickup

This commit is contained in:
Jason Cox 2016-02-20 18:15:28 -05:00
parent ae402ff1ce
commit 1e9af3ce6d
2 changed files with 13 additions and 5 deletions

View File

@ -155,13 +155,16 @@ private:
unjamming = true;
shooter.Unjam();
}
else if(unjamming && !operator_stick.GetRawButton(UNJAM))
else if(!unjamming && operator_stick.GetRawButton(TRIGGER))
{
shooter.ShootLow();
unjamming = true;
}
else if(unjamming && !operator_stick.GetRawButton(UNJAM) && !operator_stick.GetRawButton(TRIGGER))
{
shooter.PickUp(false);
unjamming = false;
}
/*
* Run the Shooter only while the THUMB button is held down on the operator stick.
* the 'pickupRunning' boolean is there to prevent the shooter from calling PickUp

View File

@ -8,7 +8,7 @@
#ifndef SRC_SHOOTER_H_
#define SRC_SHOOTER_H_
#define PICKUP_POWER 0.5
#define PICKUP_POWER 0.75
#define LAUNCH_POWER 1
#define SPINUP_TIME 1.5 // seconds.
#define LAUNCH_TIME 0.5
@ -155,7 +155,7 @@ public:
void PickUp(bool state = true)
{
pickup->Set((float) (state * PICKUP_POWER));
launcher->Set((float) (state * PICKUP_POWER * -1));
launcher->Set((float) (state * PICKUP_POWER * -0.75));
//ramp->Set(-1.0*PICKUP_POWER);
//std::cout << "picking up!\n";
}
@ -168,6 +168,11 @@ public:
pickup->Set(-1 * PICKUP_POWER);
}
void ShootLow()
{
pickup->Set(-1);
}
void SetPower(float power)
{
pickup->Set(power);