fixed bugs (still not working -_-)

This commit is contained in:
aarav18
2022-01-28 17:12:28 -07:00
parent 26e54c1db7
commit 4e497acab6
7 changed files with 154 additions and 16 deletions
@@ -4,6 +4,7 @@
package frc4388.robot.subsystems;
import java.io.Console;
import java.util.Base64.Encoder;
import com.ctre.phoenix.motorcontrol.NeutralMode;
@@ -25,6 +26,7 @@ public ShooterTables m_shooterTable;
public static Gains m_drumShooterGains = ShooterConstants.DRUM_SHOOTER_GAINS;
public static BoomBoom m_boomBoom;
public static IHandController m_driverController; //not sure if driverController in 2022 = m_controller in 2020
BangBangController m_controller = new BangBangController();
double velP;
double input;
@@ -122,12 +124,11 @@ public void setShooterGains() {
m_shooterFalconLeft.set(TalonFXControlMode.Velocity, targetVel); //Init
m_shooterFalconRight.follow(m_shooterFalconLeft);
// New BoomBoom controller stuff
BangBangController controller = new BangBangController();
//Controls a motor with the output of the BangBang controller
//Controls a motor with the output of the BangBang conroller and a feedforward
//Shrinks the feedforward slightly to avoid over speeding the shooter
m_shooterFalconLeft.set(controller.calculate(encoder.getRate(), targetVel) + 0.9 * feedforward.calculate(targetVel));
// m_shooterFalconLeft.set(controller.calculate(encoder.getRate(), targetVel) + 0.9 * feedforward.calculate(targetVel));
m_shooterFalconLeft.set(m_controller.calculate(m_shooterFalconLeft.get(), targetVel));
System.err.println(targetVel);
}
}
}