purged the concept of a ramp
This commit is contained in:
parent
21f26a8907
commit
8c91ac34db
@ -53,12 +53,12 @@ private:
|
||||
chooser->AddDefault(autoNameDefault, (void*)&autoNameDefault);
|
||||
chooser->AddObject(autoNameCustom, (void*)&autoNameCustom);
|
||||
SmartDashboard::PutData("Auto Modes", chooser);
|
||||
ramp.Enable();
|
||||
shooter1.Enable();
|
||||
shooter2.Enable();
|
||||
left_drive.SetInverted(true);
|
||||
right_drive.SetInverted(true);
|
||||
inverting = false;
|
||||
shooter_power = 0;
|
||||
|
||||
}
|
||||
|
||||
@ -74,9 +74,6 @@ private:
|
||||
*/
|
||||
void AutonomousInit()
|
||||
{
|
||||
shooter.CalibrateRamp();
|
||||
shooter.SetRamp(Shoot);
|
||||
|
||||
autoSelected = *((std::string*)chooser->GetSelected());
|
||||
//std::string autoSelected = SmartDashboard::GetString("Auto Selector", autoNameDefault);
|
||||
std::cout << "Auto selected: " << autoSelected << std::endl;
|
||||
@ -99,9 +96,7 @@ private:
|
||||
|
||||
void TeleopInit()
|
||||
{
|
||||
shooter.CalibrateRamp();
|
||||
shooter.SetRamp(Shoot); // start in the full up position!
|
||||
power = 0;
|
||||
|
||||
}
|
||||
|
||||
void TeleopPeriodic()
|
||||
|
@ -9,28 +9,11 @@
|
||||
#define SRC_SHOOTER_H_
|
||||
|
||||
#define PICKUP_POWER 0.8
|
||||
#define RAMP_LOWER_DURATION 2 //Rotations.
|
||||
|
||||
|
||||
/**
|
||||
* You can use the values assigned to each of these values as the number
|
||||
* of rotations to run the motor down from the "Shoot" position.
|
||||
*
|
||||
* This might not be the best way to do it, and also requires that we
|
||||
* figure out how to read the Hall Effect signal from the motor.
|
||||
*/
|
||||
enum RampState {
|
||||
Shoot = 0, // 0 rotations
|
||||
Half = (RAMP_LOWER_DURATION / 2), // 1 rotation?
|
||||
Down = RAMP_LOWER_DURATION, // 2 rotations?
|
||||
Uncalibrated = -1,
|
||||
Transitioning = -2
|
||||
};
|
||||
|
||||
class Shooter {
|
||||
public:
|
||||
/**
|
||||
* Shooter talons and ramp talon.
|
||||
* Shooter talons and launch-spinny talon.
|
||||
* s2 is also for the pickup-mechanism and can be controlled independently.
|
||||
*
|
||||
*/
|
||||
@ -38,25 +21,18 @@ public:
|
||||
// shooterDrive = new RobotDrive(s1, s2);
|
||||
launcher = s1;
|
||||
pickup = s2;
|
||||
ramp = r;
|
||||
rampState = Uncalibrated;
|
||||
launch_spinny = r;
|
||||
}
|
||||
|
||||
/**
|
||||
* Call this method on TeleopInit so that the ramp is properly
|
||||
* set at the beginning of the match.
|
||||
*/
|
||||
RampState CalibrateRamp() {
|
||||
// TODO:
|
||||
// Ramp no longer exists, replace with more wheels.
|
||||
|
||||
return Down;
|
||||
}
|
||||
|
||||
virtual ~Shooter() {
|
||||
delete launcher;
|
||||
delete pickup;
|
||||
delete ramp;
|
||||
delete launch_spinny;
|
||||
}
|
||||
|
||||
void PickUp(bool state = true) {
|
||||
@ -64,34 +40,6 @@ public:
|
||||
std::cout << "picking up!\n";
|
||||
}
|
||||
|
||||
void SetRamp(RampState state) {
|
||||
// TODO:
|
||||
// Move the Ramp to the set position.
|
||||
switch (state)
|
||||
{
|
||||
case Shoot:
|
||||
{
|
||||
if (ramp->GetForwardLimitOK())
|
||||
{
|
||||
ramp->Set(1);
|
||||
} else
|
||||
{
|
||||
ramp->Set(0);
|
||||
}
|
||||
}
|
||||
case Half:
|
||||
{
|
||||
//yeah, put something here when you get the encoder working.
|
||||
std::cout << "Hey! Didja install an encoder? Because this is placeholder that Aidan would have removed if you had installed one and told him about it.\n";
|
||||
}
|
||||
case Down:
|
||||
{
|
||||
//see half.
|
||||
std::cout << "Hey! Didja install an encoder? Because this is placeholder that Aidan would have removed if you had installed one and told him about it.\n";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Call this to run the pickup backwards if the ball gets jammed somehow...
|
||||
*/
|
||||
@ -110,11 +58,7 @@ private:
|
||||
RobotDrive *shooterDrive;
|
||||
CANTalon *launcher;
|
||||
CANTalon *pickup;
|
||||
CANTalon *ramp;
|
||||
|
||||
RampState rampState;
|
||||
RampState targetState;
|
||||
RampState previousState;
|
||||
CANTalon *launch_spinny;
|
||||
};
|
||||
|
||||
#endif /* SRC_SHOOTER_H_ */
|
||||
|
Reference in New Issue
Block a user