Skip to content

Commit

Permalink
all the changes I made during the first hour
Browse files Browse the repository at this point in the history
  • Loading branch information
rohitalamgari authored and mray190 committed Apr 18, 2022
1 parent d044007 commit 12a717f
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 14 deletions.
8 changes: 4 additions & 4 deletions Competition/src/main/cpp/ValorAuto.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1252,11 +1252,11 @@ ValorAuto::ValorAuto(Drivetrain *_drivetrain, Shooter *_shooter, Feeder *_feeder
m_chooser.AddOption("RED 2 ball + 1 Defensive", shoot2RedAlt);
m_chooser.AddOption("Blue 2 ball + 1 Defensive", shoot2BlueAlt);

m_chooser.AddOption("RED 2 ball + 2 Defensive", shoot2Def2Red);
m_chooser.AddOption("Blue 2 ball + 2 Defensive", shoot2Def2Blue);
m_chooser.AddOption("RED 2 ball + 2 Defensive :: ELIMS", shoot2Def2Red);
m_chooser.AddOption("Blue 2 ball + 2 Defensive :: ELIMS", shoot2Def2Blue);

m_chooser.AddOption("RED 2 ball + 2 Defensive :: NO COAST", shoot2Def2RedNoCoast);
m_chooser.AddOption("Blue 2 ball + 2 Defensive :: NO COAST", shoot2Def2BlueNoCoast);
m_chooser.AddOption("RED 2 ball + 2 Defensive :: QUALS", shoot2Def2RedNoCoast);
m_chooser.AddOption("Blue 2 ball + 2 Defensive :: QUALS", shoot2Def2BlueNoCoast);



Expand Down
10 changes: 1 addition & 9 deletions Competition/src/main/cpp/subsystems/Shooter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ void Shooter::assessInputs()
state.bButton = operatorController->GetBButtonPressed();
state.driverLeftTrigger = driverController->GetLeftTriggerAxis() > 0.9;
state.driverDPadUp = driverController->GetPOV() == OIConstants::dpadUp;
state.driverDPadLeft = driverController->GetPOV() == OIConstants::dpadLeft;
state.driverBButton = driverController->GetBButton();

//Turret
if (std::abs(state.leftStickX) > ShooterConstants::kDeadband) {
Expand Down Expand Up @@ -442,12 +442,4 @@ void Shooter::assignOutputs()

void Shooter::assignTurret(double tg) {
state.turretDesired = tg;
if(state.driverDPadLeft){
if (state.turretDesired < 90){
state.turretDesired += 15;
}
else{
state.turretDesired -= 15;
}
}
}
4 changes: 4 additions & 0 deletions Competition/src/main/cpp/subsystems/TurretTracker.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,10 @@ void TurretTracker::assignOutputs() {
// 0.75 = limeligh KP
state.target = (-state.cachedTx * 0.75) + turretPos;

if(shooter-> state.driverBButton){
state.target += 15;
}

// state.target = -1 * robotHeading + state.cachedTurretPos;
// atan2(drivetrain->getKinematics().ToChassisSpeeds().vx.to(<double>()), drivetrain->getPose_m().X());

Expand Down
2 changes: 1 addition & 1 deletion Competition/src/main/include/subsystems/Shooter.h
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ class Shooter : public ValorSubsystem

bool driverLeftTrigger;
bool driverDPadUp;
bool driverDPadLeft;
bool driverBButton;
bool driverLastLeftTrigger;

double limelightDistance;
Expand Down

0 comments on commit 12a717f

Please sign in to comment.