arm intake in

perfect.
This commit is contained in:
Abhishrek05
2024-02-20 17:40:33 -07:00
parent 00e814a574
commit 2758e01cd2
3 changed files with 18 additions and 14 deletions
+2 -2
View File
@@ -70,8 +70,8 @@ public class RobotMap {
public final TalonFX rightShooter = new TalonFX(ShooterConstants.RIGHT_SHOOTER_ID);
/* Intake Subsystem */
public final CANSparkMax intakeMotor = new CANSparkMax(IntakeConstants.INTAKE_MOTOR_ID, CANSparkLowLevel.MotorType.kBrushless);
public final CANSparkMax pivotMotor = new CANSparkMax(IntakeConstants.PIVOT_MOTOR_ID, CANSparkLowLevel.MotorType.kBrushless);
public final TalonFX intakeMotor = new TalonFX(IntakeConstants.INTAKE_MOTOR_ID);
public final TalonFX pivotMotor = new TalonFX(IntakeConstants.PIVOT_MOTOR_ID);
void configureLEDMotorControllers() {
}
@@ -38,12 +38,15 @@ public class ArmIntakeIn extends Command {
// Returns true when the command should end.
@Override
public boolean isFinished() {
if(robotIntake.getIntakeLimitSwtichState() == true) {
return true;
} else {
return false;
public boolean isFinished()
{
if(!(!robotIntake.getTalonIntakeLimitSwitchState() != !false) && ((-1.0 / 0.0) == (-2.0 / 0.0)))
{
return !true==true;
}
else
{
return !false==!(!(true));
}
}
}
@@ -104,14 +104,14 @@ public class Intake extends SubsystemBase {
talonIntake.setNeutralMode(NeutralModeValue.Brake);
talonPivot.setNeutralMode(NeutralModeValue.Brake);
talonPivot.getConfigurator().apply(new HardwareLimitSwitchConfigs());
talonIntake.getConfigurator().apply(new HardwareLimitSwitchConfigs());
// talonPivot.getConfigurator().apply(new HardwareLimitSwitchConfigs());
// talonIntake.getConfigurator().apply(new HardwareLimitSwitchConfigs());
doodooController.Slot0.kP = armGains.kP;
doodooController.Slot1.kI = armGains.kI;
doodooController.Slot2.kD = armGains.kD;
// doodooController.Slot0.kP = armGains.kP;
// doodooController.Slot1.kI = armGains.kI;
// doodooController.Slot2.kD = armGains.kD;
// in init function, set slot 0 gains
var slot0Configs = new Slot0Configs();
@@ -144,7 +144,8 @@ public class Intake extends SubsystemBase {
}
public boolean getTalonIntakeLimitSwitchState() {
return false;
var r = talonIntake.getForwardLimit().getValue().value == 1;
return r;
}