More work bringing 2026 into 2027, ignoring errors for pos/vel conversion factor for now
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
package first.robot.constants;
|
||||
|
||||
import java.util.function.Function;
|
||||
import org.wpilib.hardware.bus.CANPort;
|
||||
|
||||
import com.revrobotics.spark.FeedbackSensor;
|
||||
import com.revrobotics.spark.config.SparkBaseConfig.IdleMode;
|
||||
@@ -24,6 +24,8 @@ public class ClimberConstants {
|
||||
}
|
||||
}
|
||||
|
||||
public static final CANPort kCANPort = CANPort.CAN_S0;
|
||||
|
||||
public static final int kMotorCANID = 0;
|
||||
|
||||
public static final double kConversionFactor = 0;
|
||||
@@ -45,19 +47,17 @@ public class ClimberConstants {
|
||||
|
||||
public static final SparkMaxConfig kMotorConfig = new SparkMaxConfig();
|
||||
|
||||
public static final Function<Double, Double> kPositionConversionFunction = (d) -> {
|
||||
return d * kConversionFactor;
|
||||
};
|
||||
|
||||
public static final Function<Double, Double> kVelocityConversionFunction = (d) -> {
|
||||
return kPositionConversionFunction.apply(d) / 60;
|
||||
};
|
||||
|
||||
static {
|
||||
kMotorConfig
|
||||
.inverted(kMotorInverted)
|
||||
.smartCurrentLimit(kCurrentLimit)
|
||||
.idleMode(kIdleMode);
|
||||
kMotorConfig.encoder
|
||||
// Ignoring the red here for now. REVLib 2027alpha8 is entirely missing
|
||||
// a solution for this. Issue is open and pending
|
||||
// https://github.com/wpilibsuite/SystemcoreTesting/issues/401
|
||||
.positionConversionFactor(kConversionFactor)
|
||||
.velocityConversionFactor(kConversionFactor / 60);
|
||||
kMotorConfig.closedLoop
|
||||
.feedbackSensor(FeedbackSensor.kPrimaryEncoder)
|
||||
.pid(kP, kI, kD)
|
||||
|
||||
Reference in New Issue
Block a user