Package frclib.motor

Class FrcCANTalonSRX

java.lang.Object
trclib.motor.TrcMotor
frclib.motor.FrcCANPhoenix5Controller<com.ctre.phoenix.motorcontrol.can.TalonSRX>
frclib.motor.FrcCANTalonSRX
All Implemented Interfaces:
TrcMotorController, TrcExclusiveSubsystem, TrcOdometrySensor

public class FrcCANTalonSRX extends FrcCANPhoenix5Controller<com.ctre.phoenix.motorcontrol.can.TalonSRX>
This class implements a CanTalonSrx motor controller. It extends the TrcMotor class and implements the abstract methods required by TrcMotor to be compatible with the TRC library.
  • Constructor Details

    • FrcCANTalonSRX

      public FrcCANTalonSRX(String instanceName, int canId, TrcMotor.ExternalSensors sensors)
      Constructor: Create an instance of the object.
      Parameters:
      instanceName - specifies the instance name.
      canId - specifies the CAN ID of the device.
      sensors - specifies external sensors, can be null if none.
    • FrcCANTalonSRX

      public FrcCANTalonSRX(String instanceName, int canId)
      Constructor: Create an instance of the object.
      Parameters:
      instanceName - specifies the instance name.
      canId - specifies the CAN ID of the device.
  • Method Details

    • setAbsoluteZeroOffset

      public void setAbsoluteZeroOffset(int rangeLow, int rangeHigh, boolean crossZeroOnInterval, int zeroOffset)
      This method synchronizes the internal encoder to the absolute zero position.
      Parameters:
      rangeLow - specifies the low range of the absolute encoder reading.
      rangeHigh - specifies the high range of the absolute encoder reading.
      crossZeroOnInterval - specifies true if the absoulte encoder will cross the zero point.
      zeroOffset - specifies the encoder offset of the absolute zero position.