Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/main/java/frc/robot/Constants.java
Original file line number Diff line number Diff line change
Expand Up @@ -716,4 +716,4 @@ public static TalonFXConfiguration getFXConfig() {
public static final double CLIMB_SPEED = 1.0;
public static final double HARD_STOP_CURRENT_LIMIT = 50.0;
}
}
}
13 changes: 6 additions & 7 deletions src/main/java/frc/robot/Robot.java
Original file line number Diff line number Diff line change
Expand Up @@ -192,12 +192,11 @@ public void simulationInit() {

// Register a robot for collision with fuel
fuelSim.registerRobot(
0.8, // from left to right in meters
0.8, // from front to back in meters
Inches.of(7).in(Meters), // from floor to top of bumpers in meters
() -> robotContainer.drive.getPose(), // Supplier<Pose2d> of robot pose
robotContainer.drive
::getChassisSpeeds); // Supplier<ChassisSpeeds> of field-centric chassis speed
0.8, // from left to right in meters
0.8, // from front to back in meters
Inches.of(7).in(Meters), // from floor to top of bumpers in meters
() -> robotContainer.drive.getPose(), // Supplier<Pose2d> of robot pose
() -> robotContainer.drive.getChassis); // Supplier<ChassisSpeeds> of field-centric chassis speed

fuelSim.registerIntake(
0.4,
Expand All @@ -224,4 +223,4 @@ public void simulationPeriodic() {

SmartDashboard.putNumber("Sim Balls", (double) robotContainer.intake.simBalls);
}
}
}
2 changes: 1 addition & 1 deletion src/main/java/frc/robot/RobotContainer.java
Original file line number Diff line number Diff line change
Expand Up @@ -338,4 +338,4 @@ private void configureButtonBindings() {
public Command getAutonomousCommand() {
return autoChooser.get();
}
}
}
16 changes: 2 additions & 14 deletions src/main/java/frc/robot/subsystems/Climber.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

import static edu.wpi.first.units.Units.Amps;
import static edu.wpi.first.units.Units.Meters;
import static edu.wpi.first.units.Units.Volts;

import edu.wpi.first.math.geometry.Pose3d;
import edu.wpi.first.math.geometry.Rotation3d;
Expand All @@ -16,6 +15,7 @@
import frc.robot.Constants.ClimberConstants;
import org.littletonrobotics.junction.Logger;


public class Climber extends SubsystemBase {
private LinearMechanism _io;
Distance goalDistance;
Expand Down Expand Up @@ -44,19 +44,7 @@ public boolean isAboveCurrentLimit() {
}

@Override
public void periodic() {
_io.periodic();

double z = Math.abs(Math.sin(Timer.getFPGATimestamp()) * 0.33); // Placeholder for position

// The z of the Translation3D should be
// 'ClimberConstants.CONVERTER.toDistance(_io.getPosition()).in(Meters)', change after fixing
// motor configs.
Logger.recordOutput(
"3DField/4_Climber", new Pose3d(new Translation3d(0, 0, z), new Rotation3d(0, 0, 0)));

_io.runVoltage(Volts.of(Math.sin(Timer.getFPGATimestamp()) * 0.25));
}
public void periodic() {}

public Command runClimber() {
return this.runOnce(
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/frc/robot/subsystems/Intake.java
Original file line number Diff line number Diff line change
Expand Up @@ -119,4 +119,4 @@ public void periodic() {

// _pivotIO.runVoltage(Volts.of(Math.sin(Timer.getFPGATimestamp())*0.25)); //--- Tests the pivot
}
}
}
2 changes: 1 addition & 1 deletion src/main/java/frc/robot/subsystems/Shooter.java
Original file line number Diff line number Diff line change
Expand Up @@ -182,4 +182,4 @@ public void periodic() {

_hood.runVoltage(Volts.of(Math.sin(Timer.getFPGATimestamp()) * 0.25));
}
}
}
8 changes: 8 additions & 0 deletions src/main/java/frc/robot/subsystems/climber/Climber.java
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,14 @@ private State(LinearVelocity velocity) {
this.velocity = velocity;
}
}
public boolean isAboveCurrentLimit() {
if (_io.getSupplyCurrent().in(Units.Amps) > ClimberConstants.HARD_STOP_CURRENT_LIMIT) {
return true;
}
else {
return false;
}
}

@Override
public void periodic() {}
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/frc/robot/subsystems/drive/Drive.java
Original file line number Diff line number Diff line change
Expand Up @@ -365,4 +365,4 @@ public static Translation2d[] getModuleTranslations() {
new Translation2d(TunerConstants.BackRight.LocationX, TunerConstants.BackRight.LocationY)
};
}
}
}
Loading
Loading