Now has Sane pickup logic~

This commit is contained in:
Jason Cox 2016-02-13 11:26:07 -05:00
parent 2ad0f975b3
commit eccd90ea8a
2 changed files with 11 additions and 6 deletions

View File

@ -9,7 +9,7 @@
#define RAMP_RAISE 3 // Button 3 for Raising Ramp
#define RAMP_LOWER 4 // Button 4 to lower ramp.
#define DEADZONE_RADIUS 0.05 // 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.
// Also used for detecting changes in an axis' value.
@ -118,24 +118,28 @@ private:
// This is shit code for testing. Replace it with real code.
if(!ramping && operator_stick.GetRawButton(RAMP_RAISE))
{
std::cout << "Raising Ramp.";
//launch_spinny.Set(1);
shooter.RaiseRamp();
ramping =true;
}
else if(!ramping && operator_stick.GetRawButton(RAMP_LOWER))
{
std::cout << "Lowering Ramp.";
//launch_spinny.Set(-1);
shooter.LowerRamp();
ramping = true;
}
else if(!ramping && operator_stick.GetRawButton(TRIGGER))
/*else if(!ramping && operator_stick.GetRawButton(TRIGGER))
{
shooter.BoostRamp();
ramping = true;
}
}*/
else if(ramping)
{
launch_spinny.Set(0);
std::cout << "Stopping Ramp.";
shooter.StopRamp();
ramping = false;
}
@ -182,7 +186,7 @@ private:
* Every time the method is called. This cannot be a loop in the Shoot method because
* that would lock the robot every time the trigger is hit.
*/
if(operator_stick.GetRawButton(TRIGGER) && !shooting)
if(operator_stick.GetRawButton(TRIGGER))
{
shooting = true;
shooter.Shoot();

View File

@ -8,7 +8,7 @@
#ifndef SRC_SHOOTER_H_
#define SRC_SHOOTER_H_
#define PICKUP_POWER 1.0
#define PICKUP_POWER 0.5
#define SPINUP_TIME 1.5 // seconds.
class Shooter
@ -84,6 +84,7 @@ public:
void PickUp(bool state = true)
{
pickup->Set((float) (state * PICKUP_POWER));
launcher->Set((float) (state * PICKUP_POWER * -1));
//launch_spinny->Set(-1.0*PICKUP_POWER);
std::cout << "picking up!\n";
}