Skip to content

Commit

Permalink
various changes
Browse files Browse the repository at this point in the history
  • Loading branch information
auriium2 committed Feb 11, 2024
1 parent 4b417ab commit b7d259b
Show file tree
Hide file tree
Showing 4 changed files with 35 additions and 4 deletions.
Original file line number Diff line number Diff line change
@@ -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) {

}
}
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,6 @@ enum Normally {
CLOSED
}

enum OptimizationMode {
NONE,
POSITION
}


/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down

0 comments on commit b7d259b

Please sign in to comment.