From fe5466484b77d67ee5baa6b85ed637757fb43226 Mon Sep 17 00:00:00 2001 From: C4llSiqn <83995467+C4llSqin@users.noreply.github.com> Date: Mon, 3 Mar 2025 16:45:07 -0700 Subject: [PATCH] Revert "Merge pull request #40 from Team4388/Climber" This reverts commit 97630fe2b456542fb5889d181065b53f75a81bfe, reversing changes made to 1763225d5349eda3d04e4bec55a57d38059d00c6. --- src/main/java/frc4388/robot/Constants.java | 6 +-- .../java/frc4388/robot/RobotContainer.java | 10 ----- src/main/java/frc4388/robot/RobotMap.java | 18 +++++--- .../frc4388/robot/subsystems/Climber.java | 43 ------------------- 4 files changed, 13 insertions(+), 64 deletions(-) delete mode 100644 src/main/java/frc4388/robot/subsystems/Climber.java diff --git a/src/main/java/frc4388/robot/Constants.java b/src/main/java/frc4388/robot/Constants.java index e9cce41..70df5bc 100644 --- a/src/main/java/frc4388/robot/Constants.java +++ b/src/main/java/frc4388/robot/Constants.java @@ -21,7 +21,6 @@ import com.ctre.phoenix6.configs.MotorOutputConfigs; import com.ctre.phoenix6.configs.OpenLoopRampsConfigs; import com.ctre.phoenix6.configs.Slot0Configs; import com.ctre.phoenix6.configs.TalonFXConfiguration; -import com.ctre.phoenix6.hardware.TalonFX; import com.ctre.phoenix6.signals.NeutralModeValue; import com.ctre.phoenix6.signals.StaticFeedforwardSignValue; import com.ctre.phoenix6.swerve.SwerveDrivetrainConstants; @@ -419,10 +418,7 @@ public final class Constants { public static final double LEFT_AXIS_DEADBAND = 0.1; } - public static final class ClimberConstants { - public static final CanDevice CLIMBER_ID = new CanDevice("Climber", 311); - public static final double CLIMBER_SPEED = 0.1; - } + public static final class ElevatorConstants { public static final CanDevice ENDEFFECTOR_ID = new CanDevice("Endeffector", 15); public static final CanDevice ELEVATOR_ID = new CanDevice("Elevator", 16); diff --git a/src/main/java/frc4388/robot/RobotContainer.java b/src/main/java/frc4388/robot/RobotContainer.java index 064ce54..982e1a7 100644 --- a/src/main/java/frc4388/robot/RobotContainer.java +++ b/src/main/java/frc4388/robot/RobotContainer.java @@ -61,7 +61,6 @@ import frc4388.robot.subsystems.LED; import frc4388.robot.subsystems.Vision; import frc4388.robot.subsystems.Elevator.CoordinationState; import frc4388.robot.subsystems.Lidar; -import frc4388.robot.subsystems.Climber; import frc4388.robot.subsystems.Elevator; // import frc4388.robot.subsystems.Endeffector; import frc4388.robot.subsystems.SwerveDrive; @@ -92,7 +91,6 @@ public class RobotContainer { public final Lidar m_lidar = new Lidar(); public final Elevator m_robotElevator = new Elevator(m_robotMap.elevator, m_robotMap.endeffector, m_robotMap.basinLimitSwitch, m_robotMap.endeffectorLimitSwitch, m_vision, m_robotLED); public final SwerveDrive m_robotSwerveDrive = new SwerveDrive(m_robotMap.swerveDrivetrain, m_vision); - public final Climber m_robotClimber = new Climber(m_robotMap.climber); // public final SwerveDrive m_robotSwerveDrive = new SwerveDrive(m_robotMap.swerveDrivetrain); @@ -559,14 +557,6 @@ public class RobotContainer { new Trigger(() -> getDeadbandedOperatorController().getPOV() == 0 && !operatorManualMode) .onTrue(rightAlgaeRemove); - new Trigger(() -> getDeadbandedOperatorController().getPOV() == 90) - .onTrue(new InstantCommand(() -> m_robotClimber.climberOut())) - .onFalse(new InstantCommand(() -> m_robotClimber.stopClimber())); - - new Trigger(() -> getDeadbandedOperatorController().getPOV() == 270) - .onTrue(new InstantCommand(() -> m_robotClimber.climberIn())) - .onFalse(new InstantCommand(() -> m_robotClimber.stopClimber())); - // ? /* Programer Buttons (Controller 3)*/ // * /* Auto Recording */ diff --git a/src/main/java/frc4388/robot/RobotMap.java b/src/main/java/frc4388/robot/RobotMap.java index cd58c9c..0313a70 100644 --- a/src/main/java/frc4388/robot/RobotMap.java +++ b/src/main/java/frc4388/robot/RobotMap.java @@ -7,16 +7,25 @@ package frc4388.robot; +import com.ctre.phoenix6.hardware.TalonFX; + import org.photonvision.PhotonCamera; import com.ctre.phoenix6.hardware.CANcoder; -import com.ctre.phoenix6.hardware.TalonFX; +import com.ctre.phoenix6.hardware.Pigeon2; import com.ctre.phoenix6.swerve.SwerveDrivetrain; +import com.ctre.phoenix6.swerve.SwerveDrivetrainConstants; +import com.ctre.phoenix6.swerve.SwerveModuleConstants; +import com.ctre.phoenix6.swerve.SwerveModuleConstantsFactory; import edu.wpi.first.wpilibj.DigitalInput; -import frc4388.robot.Constants.ClimberConstants; import frc4388.robot.Constants.ElevatorConstants; +// import edu.wpi.first.wpilibj.motorcontrol.Spark; +// import frc4388.robot.Constants.LEDConstants; +import frc4388.robot.Constants.SwerveDriveConstants; import frc4388.robot.Constants.VisionConstants; +// import frc4388.robot.subsystems.SwerveModule; +import frc4388.utility.RobotGyro; /** * Defines and holds all I/O objects on the Roborio. This is useful for unit @@ -50,9 +59,6 @@ public class RobotMap { public final DigitalInput basinLimitSwitch = new DigitalInput(ElevatorConstants.BASIN_LIMIT_SWITCH); public final DigitalInput endeffectorLimitSwitch = new DigitalInput(ElevatorConstants.ENDEFFECTOR_LIMIT_SWITCH); - /* Climber Subsytem */ - public final TalonFX climber = new TalonFX(ClimberConstants.CLIMBER_ID.id); - void configureDriveMotorControllers() {} - + } diff --git a/src/main/java/frc4388/robot/subsystems/Climber.java b/src/main/java/frc4388/robot/subsystems/Climber.java deleted file mode 100644 index 34d8e65..0000000 --- a/src/main/java/frc4388/robot/subsystems/Climber.java +++ /dev/null @@ -1,43 +0,0 @@ -// Copyright (c) FIRST and other WPILib contributors. -// Open Source Software; you can modify and/or share it under the terms of -// the WPILib BSD license file in the root directory of this project. - -package frc4388.robot.subsystems; - -import com.ctre.phoenix6.hardware.TalonFX; -import com.ctre.phoenix6.signals.NeutralModeValue; - -import edu.wpi.first.wpilibj2.command.SubsystemBase; -import frc4388.robot.Constants.ClimberConstants; - -public class Climber extends SubsystemBase { - /** Creates a new Climber. */ - - public TalonFX climberMotor; - - public Climber(TalonFX climberTalonFX) { - climberMotor = climberTalonFX; - climberMotor.setNeutralMode(NeutralModeValue.Brake); - - } - - public void stopClimber(){ - climberMotor.set(0); - } - - - public void climberOut(){ - climberMotor.set(ClimberConstants.CLIMBER_SPEED); - - } - - public void climberIn(){ - climberMotor.set(-ClimberConstants.CLIMBER_SPEED); - - } - - @Override - public void periodic() { - // This method will be called once per scheduler run - } -}