-launch_spinny
+ramp
This commit is contained in:
parent
37458e6d5c
commit
98fa52cf26
@ -20,7 +20,7 @@ class Robot: public IterativeRobot
|
|||||||
{
|
{
|
||||||
Talon left_drive, right_drive;
|
Talon left_drive, right_drive;
|
||||||
CANTalon shooter1, shooter2,
|
CANTalon shooter1, shooter2,
|
||||||
launch_spinny,
|
ramp,
|
||||||
arms;
|
arms;
|
||||||
RobotDrive drive;
|
RobotDrive drive;
|
||||||
Shooter shooter;
|
Shooter shooter;
|
||||||
@ -31,11 +31,11 @@ public:
|
|||||||
right_drive(1), // Right DriveTrain Talons plug // left wheel 2
|
right_drive(1), // Right DriveTrain Talons plug // left wheel 2
|
||||||
shooter1(11), // shooter drive 1
|
shooter1(11), // shooter drive 1
|
||||||
shooter2(10), // shooter drive 2
|
shooter2(10), // shooter drive 2
|
||||||
launch_spinny(12),
|
ramp(12),
|
||||||
arms(13),
|
arms(13),
|
||||||
drive(&left_drive, &right_drive),
|
drive(&left_drive, &right_drive),
|
||||||
shooter( // initialize Shooter object.
|
shooter( // initialize Shooter object.
|
||||||
&shooter1, &shooter2, &launch_spinny),
|
&shooter1, &shooter2, &ramp),
|
||||||
driver_stick(0), // right stick (operator)
|
driver_stick(0), // right stick (operator)
|
||||||
operator_stick(1) // left stick (driver)
|
operator_stick(1) // left stick (driver)
|
||||||
{
|
{
|
||||||
@ -68,7 +68,7 @@ private:
|
|||||||
shooter2.Enable();
|
shooter2.Enable();
|
||||||
left_drive.SetInverted(true);
|
left_drive.SetInverted(true);
|
||||||
right_drive.SetInverted(true);
|
right_drive.SetInverted(true);
|
||||||
//launch_spinny.SetInverted(true);
|
//ramp.SetInverted(true);
|
||||||
inverting = false;
|
inverting = false;
|
||||||
pickupRunning = false;
|
pickupRunning = false;
|
||||||
ramping = false;
|
ramping = false;
|
||||||
@ -127,14 +127,14 @@ private:
|
|||||||
if(!ramping && operator_stick.GetRawButton(RAMP_RAISE))
|
if(!ramping && operator_stick.GetRawButton(RAMP_RAISE))
|
||||||
{
|
{
|
||||||
std::cout << "Raising Ramp.";
|
std::cout << "Raising Ramp.";
|
||||||
//launch_spinny.Set(1);
|
//ramp.Set(1);
|
||||||
shooter.RaiseRamp();
|
shooter.RaiseRamp();
|
||||||
ramping =true;
|
ramping =true;
|
||||||
}
|
}
|
||||||
else if(!ramping && operator_stick.GetRawButton(RAMP_LOWER))
|
else if(!ramping && operator_stick.GetRawButton(RAMP_LOWER))
|
||||||
{
|
{
|
||||||
std::cout << "Lowering Ramp.";
|
std::cout << "Lowering Ramp.";
|
||||||
//launch_spinny.Set(-1);
|
//ramp.Set(-1);
|
||||||
shooter.LowerRamp();
|
shooter.LowerRamp();
|
||||||
ramping = true;
|
ramping = true;
|
||||||
}
|
}
|
||||||
|
@ -37,7 +37,7 @@ public:
|
|||||||
// shooterDrive = new RobotDrive(s1, s2);
|
// shooterDrive = new RobotDrive(s1, s2);
|
||||||
launcher = s1;
|
launcher = s1;
|
||||||
pickup = s2;
|
pickup = s2;
|
||||||
launch_spinny = r;
|
ramp = r;
|
||||||
ready = true;
|
ready = true;
|
||||||
state = READY;
|
state = READY;
|
||||||
}
|
}
|
||||||
@ -51,35 +51,35 @@ public:
|
|||||||
{
|
{
|
||||||
delete launcher;
|
delete launcher;
|
||||||
delete pickup;
|
delete pickup;
|
||||||
delete launch_spinny;
|
delete ramp;
|
||||||
}
|
}
|
||||||
|
|
||||||
void StopShooter()
|
void StopShooter()
|
||||||
{
|
{
|
||||||
ready = true;
|
ready = true;
|
||||||
launch_spinny->Set(0);
|
ramp->Set(0);
|
||||||
launcher->Set(0);
|
launcher->Set(0);
|
||||||
pickup->Set(0);
|
pickup->Set(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
void LowerRamp()
|
void LowerRamp()
|
||||||
{
|
{
|
||||||
launch_spinny->Set(-1);
|
ramp->Set(-1);
|
||||||
}
|
}
|
||||||
|
|
||||||
void RaiseRamp()
|
void RaiseRamp()
|
||||||
{
|
{
|
||||||
launch_spinny->Set(1);
|
ramp->Set(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
void StopRamp()
|
void StopRamp()
|
||||||
{
|
{
|
||||||
launch_spinny->Set(0);
|
ramp->Set(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
void BoostRamp()
|
void BoostRamp()
|
||||||
{
|
{
|
||||||
launch_spinny->Set(1);
|
ramp->Set(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
void Shoot()
|
void Shoot()
|
||||||
@ -96,7 +96,7 @@ public:
|
|||||||
case READY:
|
case READY:
|
||||||
{
|
{
|
||||||
state = SPINNINGUP;
|
state = SPINNINGUP;
|
||||||
launch_spinny->Set(-1);
|
ramp->Set(-1);
|
||||||
launcher->Set(PICKUP_POWER);
|
launcher->Set(PICKUP_POWER);
|
||||||
pickup->Set(PICKUP_POWER);
|
pickup->Set(PICKUP_POWER);
|
||||||
shotClock.Reset();
|
shotClock.Reset();
|
||||||
@ -118,7 +118,7 @@ public:
|
|||||||
}
|
}
|
||||||
case LAUNCH:
|
case LAUNCH:
|
||||||
{
|
{
|
||||||
launch_spinny->Set(1);
|
ramp->Set(1);
|
||||||
state = LAUNCHING;
|
state = LAUNCHING;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@ -139,7 +139,7 @@ public:
|
|||||||
{
|
{
|
||||||
pickup->Set((float) (state * PICKUP_POWER));
|
pickup->Set((float) (state * PICKUP_POWER));
|
||||||
launcher->Set((float) (state * PICKUP_POWER * -1));
|
launcher->Set((float) (state * PICKUP_POWER * -1));
|
||||||
//launch_spinny->Set(-1.0*PICKUP_POWER);
|
//ramp->Set(-1.0*PICKUP_POWER);
|
||||||
//std::cout << "picking up!\n";
|
//std::cout << "picking up!\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -162,7 +162,7 @@ private:
|
|||||||
//RobotDrive *shooterDrive;
|
//RobotDrive *shooterDrive;
|
||||||
CANTalon *launcher;
|
CANTalon *launcher;
|
||||||
CANTalon *pickup;
|
CANTalon *pickup;
|
||||||
CANTalon *launch_spinny;
|
CANTalon *ramp;
|
||||||
ShooterState state;
|
ShooterState state;
|
||||||
|
|
||||||
Timer shotClock;
|
Timer shotClock;
|
||||||
|
Reference in New Issue
Block a user