Control changes

This commit is contained in:
TheRealGrayden 2026-03-14 09:53:50 -04:00
parent 65c6462d97
commit a4253cfd35
6 changed files with 29 additions and 16 deletions

View File

@ -102,10 +102,10 @@ public final class Constants {
public static class HopperConstants {
public static final int KICKER_MOTOR_ID = 9;
public static final InvertedValue KICKER_MOTOR_DIRECTION = InvertedValue.CounterClockwise_Positive;
public static final InvertedValue KICKER_MOTOR_DIRECTION = InvertedValue.Clockwise_Positive;
public static final int SPINDEXER_MOTOR_ID = 8;
public static final InvertedValue SPINDEXER_MOTOR_DIRECTION = InvertedValue.Clockwise_Positive;
public static final double SPINDEXER_MOTOR_SPEED = 0;
public static final InvertedValue SPINDEXER_MOTOR_DIRECTION = InvertedValue.CounterClockwise_Positive;
public static final double SPINDEXER_MOTOR_SPEED = .6;
}
}

View File

@ -77,7 +77,7 @@ public class RobotContainer {
m_driverController.x().onTrue(intakeSubsystem.killSpeedCommand());
m_driverController.a().onTrue(intakeSubsystem.startSpeedCommand());
m_driverController.b().onTrue(intakeSubsystem.revSpeedCommand());
//m_driverController.b().onTrue(intakeSubsystem.revSpeedCommand());
intakeSubsystem.setDefaultCommand(new ManualIntake(intakeSubsystem, m_driverController.getHID()));
}

View File

@ -23,7 +23,10 @@ public class ManualHopperCommand extends Command {
// Called when the command is initially scheduled.
@Override
public void initialize() {
m_subsystem.spin(Constants.HopperConstants.SPINDEXER_MOTOR_SPEED);
if(m_xboxController.getRightBumper())
{
m_subsystem.spin(Constants.HopperConstants.SPINDEXER_MOTOR_SPEED);
}
}
// Called every time the scheduler runs while the command is scheduled.

View File

@ -6,6 +6,7 @@ package frc.robot.commands;
import frc.robot.subsystems.TurretSubsystem;
import edu.wpi.first.wpilibj.XboxController;
import edu.wpi.first.wpilibj.GenericHID.RumbleType;
import edu.wpi.first.wpilibj2.command.Command;
/** An example command that uses an example subsystem. */
@ -23,14 +24,25 @@ public class ManualShootCommand extends Command {
// Called every time the scheduler runs while the command is scheduled.
@Override
public void execute() {
if(m_controller.getLeftTriggerAxis()>.5 || m_controller.getRightTriggerAxis()>.5)
if(m_controller.getRightTriggerAxis()>.4)
{
m_subsystem.setLauncher(.6);
m_controller.setRumble(RumbleType.kBothRumble, .33);
}
else if(m_controller.getRightTriggerAxis()>.6)
{
m_subsystem.setLauncher(.8);
m_controller.setRumble(RumbleType.kBothRumble, .67);
}
else if(m_controller.getRightTriggerAxis()>.8)
{
m_subsystem.setLauncher(1);
System.out.println("Test");
m_controller.setRumble(RumbleType.kBothRumble, 1);
}
else
{
m_subsystem.setLauncher(0);
m_controller.setRumble(RumbleType.kBothRumble, 0);
}
}

View File

@ -84,7 +84,7 @@ public class IntakeSubsystem extends TestableSubsystem {
public Command startSpeedCommand()
{
return this.runOnce(() -> setSpeed(.5));
return this.runOnce(() -> setSpeed(-.5));
}
public Command killSpeedCommand()
@ -94,6 +94,6 @@ public class IntakeSubsystem extends TestableSubsystem {
public Command revSpeedCommand()
{
return this.runOnce(() -> setSpeed(-.5));
return this.runOnce(() -> setSpeed(.5));
}
}

View File

@ -67,21 +67,21 @@ public class TurretSubsystem extends TestableSubsystem {
public void startHoming()
{
//turretMotor.set(Constants.ShooterConstants.HOMING_SPEED);
currentState = TurretState.HOMING;
//currentState = TurretState.HOMING;
}
public void startRotate(double speed)
{
turretGoingPos=speed>0;
/*turretGoingPos=speed>0;
if(!passedLimit())
{
//turretMotor.set(speed);
turretMotor.set(speed);
}
else
{
//turretMotor.set(0);
}
turretMotor.set(0);
}*/
}
public boolean passedLimit(){
@ -128,7 +128,5 @@ public class TurretSubsystem extends TestableSubsystem {
{
//turretMotor.set(0);
}*/
}
}