Package frc.robot.motors
Interface LoggedMotor
- All Known Implementing Classes:
SparkMaxWrapper,TalonFXWrapper
public interface LoggedMotor
An interface for any motor wrapper implementation for logging purposes.
-
Method Summary
Modifier and TypeMethodDescriptionGets the unique identifier of a motor for logging purposes.doubleGets the current of the motor in amperes.doubleGets the position of the motor in rotations.doubleGets the setpoint of the motor in range [-1, 1].doubleGets the angular velocity of the motor in rotations per minute.doubleGets the voltage of the motor in volts.default voidinit()Initializes the motor by adding it to the global motor list in MotorManager.default voidUpdates the motors every tick.
-
Method Details
-
updateSimState
default void updateSimState()Updates the motors every tick. -
init
default void init()Initializes the motor by adding it to the global motor list in MotorManager. -
getIdentifier
String getIdentifier()Gets the unique identifier of a motor for logging purposes. This value is intended to be the CAN ID.- Returns:
- the unique identifier for the motor
-
getLoggedPosition
double getLoggedPosition()Gets the position of the motor in rotations.- Returns:
- the position of the motor in rotations
-
getLoggedVelocity
double getLoggedVelocity()Gets the angular velocity of the motor in rotations per minute.- Returns:
- the angular velocity of the motor in rotations per minute
-
getLoggedSetpoint
double getLoggedSetpoint()Gets the setpoint of the motor in range [-1, 1].- Returns:
- the setpoint in range [-1, 1]
-
getLoggedVoltage
double getLoggedVoltage()Gets the voltage of the motor in volts.- Returns:
- the voltage of the motor
-
getLoggedCurrent
double getLoggedCurrent()Gets the current of the motor in amperes.- Returns:
- the current of the motor
-