fixed fedforward bug, or at least it looks like it

This commit is contained in:
Pushkar9236
2022-01-28 17:05:28 -07:00
parent 26e54c1db7
commit 6369870590
@@ -12,11 +12,13 @@ import com.ctre.phoenix.motorcontrol.can.WPI_TalonFX;
import edu.wpi.first.wpilibj.smartdashboard.*;
import edu.wpi.first.math.controller.BangBangController;
import edu.wpi.first.math.controller.SimpleMotorFeedforward;
import edu.wpi.first.wpilibj2.command.SubsystemBase;
import frc4388.robot.Constants.ShooterConstants;
import frc4388.utility.ShooterTables;
import frc4388.utility.Gains;
import frc4388.utility.controller.IHandController;
import com.revrobotics.RelativeEncoder;
public class BoomBoom extends SubsystemBase {
public WPI_TalonFX m_shooterFalconLeft = new WPI_TalonFX(ShooterConstants.SHOOTER_FALCON_BALLER_ID);
@@ -35,6 +37,12 @@ public double m_fireVel;
public Hood m_hoodSubsystem;
public Turret m_turretSubsystem;
SimpleMotorFeedforward feedforward = new SimpleMotorFeedforward(69, 42, 0); //get real values later
/*
* Creates new BoomBoom subsystem, has drum shooter and angle adjuster
*/
@@ -42,6 +50,9 @@ public BoomBoom(){
//Testing purposes resetting gyros
//resetGryoAngleADj();
//shooterTrims = new Trims(0,0);
feedforward.calculate(15, 20); // feedforward.calculate(velocity, acceleration);
}
/** Creates a new BoomBoom. */
public BoomBoom(WPI_TalonFX shooterFalconLeft, WPI_TalonFX shooterFalconRight) {
@@ -60,6 +71,7 @@ public BoomBoom(){
m_shooterFalconLeft.configClosedLoopPeriod(0, closedLoopTimeMs, ShooterConstants.SHOOTER_TIMEOUT_MS);
m_shooterFalconLeft.configSupplyCurrentLimit(ShooterConstants.SUPPLY_CURRENT_LIMIT_CONFIG, ShooterConstants.SHOOTER_TIMEOUT_MS);
//RIGHT FALCON
m_shooterFalconRight.configFactoryDefault();
m_shooterFalconRight.setNeutralMode(NeutralMode.Coast);