Class ThriftyBotDevices

java.lang.Object
swervelib.core.parser.deserializer.reflections.ThriftyBotDevices

public class ThriftyBotDevices extends Object
Reflection class for SmartMotorControllers and other devices from ThriftyBot.
  • Constructor Details

    • ThriftyBotDevices

      public ThriftyBotDevices()
  • Method Details

    • getMotorController

      public static SmartMotorController getMotorController(int canid, String canbus, SmartMotorControllerConfig config, org.wpilib.math.system.DCMotor motor, String motorControllerType)
      Get the Nova as a SmartMotorController.
      Parameters:
      canid - CAN ID of the Nova
      canbus - CAN bus number of the Nova, see CANBuses
      config - SmartMotorControllerConfig to apply to the SmartMotorController
      motor - DCMotor to use with the SmartMotorController
      motorControllerType - Motor controller type.
      Returns:
      SmartMotorController
    • getAbsoluteEncoder

      public static org.wpilib.util.Pair<Supplier<org.wpilib.units.measure.Angle>, Object> getAbsoluteEncoder(int canid, String canbus, boolean inverted)
      Get the Thrifty CAN Encoder angle.
      Parameters:
      canid - CAN ID of the encoder.
      canbus - CAN bus number of the encoder, see CANBuses
      inverted - Inversion of the encoder.
      Returns:
      Supplier of Angle and CanEncoder
    • getAttachedAbsoluteEncoder

      public static org.wpilib.util.Pair<Supplier<org.wpilib.units.measure.Angle>, Object> getAttachedAbsoluteEncoder(String attachType, Object motorController, boolean inverted)
      Get the absolute encoder attached to the Nova's data port.
      Parameters:
      attachType - Absolute encoder type, one of ThriftyBotDevices.AbsoluteEncoder.
      motorController - Nova to get the absolute encoder from.
      inverted - Inverted absolute encoder readings.
      Returns:
      Pair of Supplier and Motor.FeedbackSensorType.ABS, which is what NovaWrapper expects as its external encoder.