This commit is contained in:
Tyler-j42 2025-05-20 16:47:48 -04:00
parent 626b92b769
commit ba7e8d59ad
3 changed files with 5 additions and 5 deletions

View File

@ -35,7 +35,7 @@ public Robot() {
if (isReal()) { if (isReal()) {
Logger.addDataReceiver(new WPILOGWriter()); // Log to a USB stick ("/U/logs") Logger.addDataReceiver(new WPILOGWriter()); // Log to a USB stick ("/U/logs")
//Logger.addDataReceiver(new NT4Publisher()); // Publish data to NetworkTables Logger.addDataReceiver(new NT4Publisher()); // Publish data to NetworkTables
new PowerDistribution(1, ModuleType.kRev); // Enables power distribution logging new PowerDistribution(1, ModuleType.kRev); // Enables power distribution logging
} else { } else {
setUseTiming(false); // Run as fast as possible setUseTiming(false); // Run as fast as possible

View File

@ -35,9 +35,9 @@ public class ElevatorConstants {
public static final double kMaintainP = 3; public static final double kMaintainP = 3;
*/ */
public static final double kP = 5.6;//7; // public static final double kP = 3;//7; //
public static final double kI = 0; public static final double kI = 0;
public static final double kD = 0.28;//0.28 public static final double kD = 0;//.28;//0.28
public static final double kAllowedError = 1; public static final double kAllowedError = 1;

View File

@ -144,7 +144,7 @@ public class Elevator extends SubsystemBase {
}, },
() -> { () -> {
controller.setReference( controller.setReference(
setpoint.position, encoder.getPosition(),
ControlType.kPosition, ControlType.kPosition,
ClosedLoopSlot.kSlot0, ClosedLoopSlot.kSlot0,
feedForward.calculate(0.0) feedForward.calculate(0.0)
@ -169,7 +169,7 @@ public class Elevator extends SubsystemBase {
* @return Sets motor voltage to achieve the target destination * @return Sets motor voltage to achieve the target destination
*/ */
public Command goToSetpoint(DoubleSupplier setGoal) { public Command goToSetpoint(DoubleSupplier setGoal) {
return startRun(() -> { return startRun(() -> {
goal = new TrapezoidProfile.State(setGoal.getAsDouble(), 0.0); goal = new TrapezoidProfile.State(setGoal.getAsDouble(), 0.0);
}, () -> { }, () -> {