driver.get(PS5Button.LB).onTrue(
new SequentialCommandGroup(
- new InstantCommand(()-> shooter.setShooter(ShooterConstants.SHOOTER_VELOCITY)),
+ new InstantCommand(()-> shooter.setShooter(-ShooterConstants.SHOOTER_VELOCITY)),
new WaitCommand(0.8),
new InstantCommand(()-> shooter.setFeeder(ShooterConstants.FEEDER_RUN_POWER))
)
}
})
);
+
}
public void setAlignmentPose(){
package frc.robot.subsystems.shooter;
+import java.lang.annotation.Target;
+
import org.littletonrobotics.junction.AutoLogOutput;
import org.littletonrobotics.junction.Logger;
import com.ctre.phoenix6.signals.NeutralModeValue;
import edu.wpi.first.wpilibj.smartdashboard.SmartDashboard;
import edu.wpi.first.wpilibj2.command.InstantCommand;
-
+import edu.wpi.first.wpilibj2.command.SubsystemBase;
import frc.robot.constants.Constants;
import frc.robot.constants.IdConstants;
-public class Shooter {
+public class Shooter extends SubsystemBase {
private TalonFX shooterMotorLeft = new TalonFX(IdConstants.SHOOTER_LEFT_ID, Constants.RIO_CAN);
private TalonFX shooterMotorRight = new TalonFX(IdConstants.SHOOTER_RIGHT_ID, Constants.RIO_CAN);
public void setShooter(double linearVelocityMps) {
double wheelCircumference = Math.PI * ShooterConstants.SHOOTER_LAUNCH_DIAMETER;
+ System.out.println("PRINTING WHEEEEEEEEEEEEL CIRUM:" + wheelCircumference);
shooterTargetSpeed = linearVelocityMps * ShooterConstants.SHOOTER_GEAR_RATIO / wheelCircumference; // rps
+ System.out.println("PRINTING TARGET SPEED:" + shooterTargetSpeed);
}
public double getFeederVelocity() {
SmartDashboard.putData("Set to 180 degrees", new InstantCommand(() -> setSetpoint(180, 0)));
SmartDashboard.putData("Set to -180 degrees", new InstantCommand(() -> setSetpoint(-180, 0)));
SmartDashboard.putData("Set to -90 degrees", new InstantCommand(() -> setSetpoint(-90, 0)));
-
+ SmartDashboard.putData("Reset Yaw", new InstantCommand(() -> resetYaw()));
}
public double getPosition() {
return inputs.positionDeg;
}
+ public void resetYaw() {
+ inputs.positionDeg = 0;
+ }
+
public boolean atSetPoint(){
return Math.abs(getPosition() - setpoint) < 3.0;
}
public static double MAX_ANGLE = 180;
public static double MIN_ANGLE = -180;
- public static double MAX_VELOCITY = 1.0; // m/s
- public static double MAX_ACCELERATION = 5; // m/s^2
+ public static double MAX_VELOCITY = 2.0; // m/s
+ public static double MAX_ACCELERATION = 10; // m/s^2
public static double TURRET_WIDTH = Units.feetToMeters(1.0);
public static double TURRET_RADIUS = TURRET_WIDTH / 2;