launch spinny does stuff

This commit is contained in:
Aidan Ferguson 2016-02-11 17:17:42 -05:00
parent 9ce495f073
commit 71b8e5eeff
2 changed files with 9 additions and 8 deletions

View File

@ -15,7 +15,7 @@ class Robot: public IterativeRobot
{ {
Talon left_drive, right_drive; Talon left_drive, right_drive;
CANTalon shooter1, shooter2, CANTalon shooter1, shooter2,
ramp; launch_spinny;
RobotDrive drive; RobotDrive drive;
Shooter shooter; Shooter shooter;
Joystick driver_stick, operator_stick; Joystick driver_stick, operator_stick;
@ -25,10 +25,10 @@ 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
ramp(12), launch_spinny(12),
drive(&left_drive, &right_drive), drive(&left_drive, &right_drive),
shooter( // initialize Shooter object. shooter( // initialize Shooter object.
&shooter1, &shooter2, &ramp), &shooter1, &shooter2, &launch_spinny),
driver_stick(0), // right stick (operator) driver_stick(0), // right stick (operator)
operator_stick(1) // left stick (driver) operator_stick(1) // left stick (driver)
{ {
@ -101,21 +101,21 @@ private:
void TeleopPeriodic() void TeleopPeriodic()
{ {
std::cout << "Ramp position: "<< ramp.GetEncPosition() << std::endl; std::cout << "Ramp position: "<< launch_spinny.GetEncPosition() << std::endl;
drive.ArcadeDrive(&driver_stick, true); drive.ArcadeDrive(&driver_stick, true);
// This is shit code for testing. Replace it with real code. // This is shit code for testing. Replace it with real code.
if(operator_stick.GetRawButton(RAMP_RAISE)) if(operator_stick.GetRawButton(RAMP_RAISE))
{ {
ramp.Set(1); launch_spinny.Set(1);
} }
else if(operator_stick.GetRawButton(RAMP_LOWER)) else if(operator_stick.GetRawButton(RAMP_LOWER))
{ {
ramp.Set(-1); launch_spinny.Set(-1);
} }
else else
{ {
ramp.Set(0); launch_spinny.Set(0);
} }
if(operator_stick.GetRawButton(THUMB) && !pickupRunning) if(operator_stick.GetRawButton(THUMB) && !pickupRunning)

View File

@ -8,7 +8,7 @@
#ifndef SRC_SHOOTER_H_ #ifndef SRC_SHOOTER_H_
#define SRC_SHOOTER_H_ #define SRC_SHOOTER_H_
#define PICKUP_POWER 0.8 #define PICKUP_POWER 1.0
class Shooter { class Shooter {
public: public:
@ -37,6 +37,7 @@ public:
void PickUp(bool state = true) { void PickUp(bool state = true) {
pickup->Set((float) (state * PICKUP_POWER)); pickup->Set((float) (state * PICKUP_POWER));
launch_spinny->Set(-1.0*PICKUP_POWER);
std::cout << "picking up!\n"; std::cout << "picking up!\n";
} }