Merge branch 'shooter' into release

# Conflicts:
#	Robot2016/src/Robot.cpp
#	Robot2016/src/Shooter.h
This commit is contained in:
dkbug 2016-02-27 13:24:39 -05:00
commit 2cbfd58934
2 changed files with 20 additions and 22 deletions

View File

@ -170,12 +170,10 @@ private:
{
shooter.BoostRamp();
ramping = true;
}*/
else if(ramping
&& !operator_stick.GetRawButton(RAMP_LOWER)
&& !operator_stick.GetRawButton(RAMP_RAISE))
}
else if(ramping && !operator_stick.GetRawButton(RAMP_RAISE)
&& !operator_stick.GetRawButton(RAMP_LOWER))
{
std::cout << "Stopping Ramp.";
shooter.StopRamp();
ramping = false;
}
@ -213,7 +211,6 @@ private:
shooter.PickUp(false);
pickupRunning = false;
}
/*
* The 'inverting' variable is used to make sure that the drive train isn't getting
* inverted every iteration of the TeleopPeriodic method while the button is held down.
@ -239,7 +236,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))
if(operator_stick.GetRawButton(TRIGGER) || (shooter.GetState() != 0))
{
shooting = true;
shooter.Shoot();

View File

@ -88,21 +88,18 @@ public:
}
void Shoot()
{
// TODO: Shooter Logic should go as follows:
/*
Assuming a ball is held in the shooter. When the trigger is pulled,
the launch-spinny should be STOPPED. Start a Timer object counting
When... too hard to write.. I emailed you a flow chart.
*/
if (shotClock.Get() > (SPINUP_TIME + 0.1))
{
state = RESETTING;
}
switch (state)
{
case READY:
{
state = SPINNINGUP;
ramp->Set(-1);
launcher->Set(PICKUP_POWER);
pickup->Set(PICKUP_POWER);
launcher->Set(LAUNCH_POWER);
pickup->Set(LAUNCH_POWER);
shotClock.Reset();
shotClock.Start();
break;
@ -116,13 +113,13 @@ public:
shotClock.Start();
} else
{
std::cout << "*Goku noises*\n";
//std::cout << "*Goku noises*\n";
}
break;
}
case LAUNCH:
{
ramp->Set(1);
ramp->Set(LAUNCH_POWER);
state = LAUNCHING;
break;
}
@ -155,8 +152,7 @@ public:
void PickUp(bool state = true)
{
pickup->Set((float) (state * PICKUP_POWER));
launcher->Set((float) (state * PICKUP_POWER * -0.75));
//ramp->Set(-1.0*PICKUP_POWER);
launcher->Set((float) (state * PICKUP_POWER * -1));
//std::cout << "picking up!\n";
}
@ -165,7 +161,7 @@ public:
*/
void Unjam()
{
pickup->Set(PICKUP_POWER * -0.75);
pickup->Set(-1 * PICKUP_POWER);
}
void ShootLow()
@ -179,6 +175,11 @@ public:
launcher->Set(power);
//std::cout << "setting shooter power" << std::endl;
}
int GetState()
{
return state;
}
private:
//RobotDrive *shooterDrive;