Class TalonFXSWrapper

java.lang.Object
yams.core.motorcontrollers.SmartMotorController
yams.core.motorcontrollers.remote.TalonFXSWrapper

public class TalonFXSWrapper extends SmartMotorController
TalonFXS wrapper for CTRE TalonFXS motor controllers.

External encoder discontinuity point support (CANcoder):

  • 0.5 rotations maps to AbsoluteSensorDiscontinuityPoint = 0.5, sensor range is [-0.5, 0.5)
  • 1.0 rotations maps to AbsoluteSensorDiscontinuityPoint = 1.0, sensor range is [0, 1)
Configuring a discontinuity point is optional for CANcoder; when omitted the CANcoder default is used. Set via SmartMotorControllerConfig.withExternalEncoderDiscontinuityPoint(Angle).

Example

// Configure and create a TalonFXS (Minion) on CAN ID 7
SmartMotorControllerConfig config = new SmartMotorControllerConfig()
    .withMotorInverted(false)
    .withStatorCurrentLimit(Amps.of(30))
    .withClosedLoopController(0.1,0,0);
SmartMotorController motor = new TalonFXSWrapper(
    new TalonFXS(7), DCMotor.getMinion(1), config);
FlyWheel flywheel = new FlyWheel(new FlyWheelConfig(motor));