mirror of
https://github.com/Team4388/2025-Programer-Training.git
synced 2026-06-08 16:28:05 -06:00
start climber subsystem
This commit is contained in:
@@ -163,4 +163,10 @@ public final class Constants {
|
||||
public static final int RIGHT_SHOOTER_ID = 16;
|
||||
public static final double SHOOTER_SPEED = 0.50;
|
||||
}
|
||||
|
||||
public static final class climberConstants {
|
||||
public static final int CLIMBERMOTOR_ID = 19;
|
||||
public static final double CLIMBINSPEED = -1;
|
||||
public static final double CLIMBOUTSPEED = 0.87;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -26,6 +26,7 @@ import edu.wpi.first.wpilibj2.command.SequentialCommandGroup;
|
||||
import frc4388.utility.controller.VirtualController;
|
||||
import frc4388.robot.commands.Swerve.neoJoystickPlayback;
|
||||
import frc4388.robot.commands.Swerve.neoJoystickRecorder;
|
||||
import frc4388.robot.subsystems.Climber;
|
||||
import frc4388.robot.subsystems.Intake;
|
||||
// Subsystems
|
||||
import frc4388.robot.subsystems.Shooter;
|
||||
@@ -49,6 +50,8 @@ public class RobotContainer {
|
||||
public final RobotMap m_robotMap = new RobotMap();
|
||||
|
||||
/* Subsystems */
|
||||
public final Climber m_climber= new Climber(m_robotMap.climber);
|
||||
|
||||
public final Shooter m_robotShooter = new Shooter(m_robotMap.leftShooter, m_robotMap.rightShooter);
|
||||
// private final LED m_robotLED = new LED();
|
||||
public final Intake m_robotIntake= new Intake(m_robotMap.pivotArm, m_robotMap.intakeWheel);
|
||||
@@ -192,6 +195,9 @@ public class RobotContainer {
|
||||
new VirtualController[]{getVirtualDriverController(), getVirtualOperatorController()},
|
||||
true, false))
|
||||
.onFalse(new InstantCommand());
|
||||
|
||||
/* Climber */
|
||||
new Trigger(())
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -16,6 +16,7 @@ import frc4388.robot.Constants.ShooterConstants;
|
||||
// import edu.wpi.first.wpilibj.motorcontrol.Spark;
|
||||
// import frc4388.robot.Constants.LEDConstants;
|
||||
import frc4388.robot.Constants.SwerveDriveConstants;
|
||||
import frc4388.robot.Constants.climberConstants;
|
||||
import frc4388.robot.subsystems.SwerveModule;
|
||||
import frc4388.utility.RobotGyro;
|
||||
|
||||
@@ -56,10 +57,13 @@ public class RobotMap {
|
||||
public final TalonFX rightBackWheel = new TalonFX(SwerveDriveConstants.IDs.RIGHT_BACK_WHEEL_ID);
|
||||
public final TalonFX rightBackSteer = new TalonFX(SwerveDriveConstants.IDs.RIGHT_BACK_STEER_ID);
|
||||
public final CANcoder rightBackEncoder = new CANcoder(SwerveDriveConstants.IDs.RIGHT_BACK_ENCODER_ID);
|
||||
|
||||
/*Intake subsystem */
|
||||
public final TalonFX pivotArm = new TalonFX(IntakeConstants.IDs.PIVOTMOTOR_ID);
|
||||
public final TalonFX intakeWheel = new TalonFX(IntakeConstants.IDs.INTAKEMOTOR_ID);
|
||||
|
||||
/*climber subsystem */
|
||||
public final TalonFX climber = new TalonFX(climberConstants.CLIMBERMOTOR_ID);
|
||||
|
||||
/* Shooter Subsystem */
|
||||
public final TalonFX leftShooter = new TalonFX(ShooterConstants.LEFT_SHOOTER_ID);
|
||||
public final TalonFX rightShooter = new TalonFX(ShooterConstants.RIGHT_SHOOTER_ID);
|
||||
|
||||
@@ -0,0 +1,28 @@
|
||||
package frc4388.robot.subsystems;
|
||||
|
||||
import com.ctre.phoenix6.hardware.TalonFX;
|
||||
import com.ctre.phoenix6.signals.NeutralModeValue;
|
||||
|
||||
import frc4388.robot.Constants.climberConstants;
|
||||
|
||||
public class Climber {
|
||||
private TalonFX climber;
|
||||
|
||||
public Climber(TalonFX climberTalonFX){
|
||||
climber = climberTalonFX;
|
||||
|
||||
climber.setNeutralMode(NeutralModeValue.Brake);
|
||||
}
|
||||
|
||||
public void climberDown() {
|
||||
climber.set(climberConstants.CLIMBOUTSPEED);
|
||||
}
|
||||
|
||||
public void climberUp() {
|
||||
climber.set(climberConstants.CLIMBINSPEED);
|
||||
}
|
||||
|
||||
public void climberStop() {
|
||||
climber.set(0);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user