diff --git a/mattlib2-ctre/src/main/java/xyz/auriium/mattlib/ctre/BaseTalonFXController.java b/mattlib2-ctre/src/main/java/xyz/auriium/mattlib/ctre/BaseTalonFXController.java new file mode 100644 index 0000000..3162f7b --- /dev/null +++ b/mattlib2-ctre/src/main/java/xyz/auriium/mattlib/ctre/BaseTalonFXController.java @@ -0,0 +1,24 @@ +package xyz.auriium.mattlib.ctre; + +import com.ctre.phoenix6.hardware.TalonFX; +import xyz.auriium.mattlib2.hardware.ILinearController; +import xyz.auriium.mattlib2.hardware.IRotationalController; +import xyz.auriium.mattlib2.hardware.config.MotorComponent; + +public class BaseTalonFXController extends BaseTalonFXMotor implements ILinearController, IRotationalController { + public BaseTalonFXController(TalonFX talonFX, MotorComponent motorComponent) { + super(talonFX, motorComponent); + } + + @Override public void controlToLinearReferenceArbitrary(double setpointMechanism_meters, double arbitraryFF_volts) { + + } + + @Override public void controlToNormalizedReferenceArbitrary(double setpoint_mechanismNormalizedRotations, double arbitraryFF_volts) { + + } + + @Override public void controlToInfiniteReferenceArbitrary(double setpoint_mechanismRotations, double arbitraryFF_volts) { + + } +} diff --git a/mattlib2-ctre/src/main/java/xyz/auriium/mattlib/ctre/BaseTalonFXMotor.java b/mattlib2-ctre/src/main/java/xyz/auriium/mattlib/ctre/BaseTalonFXMotor.java index 1e3a640..b543c4d 100644 --- a/mattlib2-ctre/src/main/java/xyz/auriium/mattlib/ctre/BaseTalonFXMotor.java +++ b/mattlib2-ctre/src/main/java/xyz/auriium/mattlib/ctre/BaseTalonFXMotor.java @@ -41,6 +41,8 @@ public static ExplainedException[] orThrow(StatusCode code, GenericPath path, Ex @Override public ExplainedException[] verifyInit() { + + ExplainedException[] exceptions = new ExplainedException[0]; //set feedback config diff --git a/mattlib2-hardware/src/main/java/xyz/auriium/mattlib2/hardware/config/CommonMotorComponent.java b/mattlib2-hardware/src/main/java/xyz/auriium/mattlib2/hardware/config/CommonMotorComponent.java index 9513c0e..4b522a3 100644 --- a/mattlib2-hardware/src/main/java/xyz/auriium/mattlib2/hardware/config/CommonMotorComponent.java +++ b/mattlib2-hardware/src/main/java/xyz/auriium/mattlib2/hardware/config/CommonMotorComponent.java @@ -20,10 +20,6 @@ enum Normally { CLOSED } - enum OptimizationMode { - NONE, - POSITION - } /** diff --git a/mattlib2-rev/src/main/java/xyz/auriium/mattlib2/rev/BaseSparkMotor.java b/mattlib2-rev/src/main/java/xyz/auriium/mattlib2/rev/BaseSparkMotor.java index 1f7d23a..55d7c15 100644 --- a/mattlib2-rev/src/main/java/xyz/auriium/mattlib2/rev/BaseSparkMotor.java +++ b/mattlib2-rev/src/main/java/xyz/auriium/mattlib2/rev/BaseSparkMotor.java @@ -146,6 +146,15 @@ public ExplainedException[] verifyInit() { motorComponent.openRampRate_seconds().ifPresent(sparkMax::setOpenLoopRampRate); motorComponent.closedRampRate_seconds().ifPresent(sparkMax::setClosedLoopRampRate); + + sparkMax.setPeriodicFramePeriod(CANSparkLowLevel.PeriodicFrame.kStatus0, 200); + sparkMax.setPeriodicFramePeriod(CANSparkLowLevel.PeriodicFrame.kStatus1, 20); + sparkMax.setPeriodicFramePeriod(CANSparkLowLevel.PeriodicFrame.kStatus2, 10); + sparkMax.setPeriodicFramePeriod(CANSparkLowLevel.PeriodicFrame.kStatus3, 100); + sparkMax.setPeriodicFramePeriod(CANSparkLowLevel.PeriodicFrame.kStatus4, 100); + sparkMax.setPeriodicFramePeriod(CANSparkLowLevel.PeriodicFrame.kStatus5, 500); + sparkMax.setPeriodicFramePeriod(CANSparkLowLevel.PeriodicFrame.kStatus6, 500); + return toThrow; }