Class ThriftyBotDevices
java.lang.Object
swervelib.core.parser.deserializer.reflections.ThriftyBotDevices
Reflection class for
SmartMotorControllers and other devices from ThriftyBot.-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumAbsolute encoder types on theNova's data port, named after the encoder in the JSON<encoder>_attachedtype.static enumMotor controller types. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongetAbsoluteEncoder(int canid, String canbus, boolean inverted) Get the Thrifty CAN Encoder angle.getAttachedAbsoluteEncoder(String attachType, Object motorController, boolean inverted) Get the absolute encoder attached to theNova's data port.static SmartMotorControllergetMotorController(int canid, String canbus, SmartMotorControllerConfig config, org.wpilib.math.system.DCMotor motor, String motorControllerType) Get theNovaas aSmartMotorController.
-
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 theNovaas aSmartMotorController.- Parameters:
canid- CAN ID of theNovacanbus- CAN bus number of theNova, seeCANBusesconfig-SmartMotorControllerConfigto apply to theSmartMotorControllermotor-DCMotorto use with theSmartMotorControllermotorControllerType- Motor controller type.- Returns:
SmartMotorController
-
getAbsoluteEncoder
-
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 theNova's data port.- Parameters:
attachType- Absolute encoder type, one ofThriftyBotDevices.AbsoluteEncoder.motorController-Novato get the absolute encoder from.inverted- Inverted absolute encoder readings.- Returns:
PairofSupplierandMotor.FeedbackSensorType.ABS, which is whatNovaWrapperexpects as its external encoder.
-