Package trclib.drivebase
Interface TrcDriveBase.MotorPowerMapper
- Enclosing class:
- TrcDriveBase
public static interface TrcDriveBase.MotorPowerMapper
This interface is provided by the caller to translate the motor power to actual motor power according to
the motor curve. This is useful to linearize the motor performance. This is very useful for many reasons.
It could allow the drive base to drive straight by translating wheel power to actual torque. It could also
allow us to implement our own ramp rate to limit acceleration and deceleration.
-
Method Summary
Modifier and TypeMethodDescriptiondouble
translateMotorPower
(double power, double velocity) This method is called to translate the desired motor power to the actual motor power taking into consideration of the motor torque curve with the current motor velocity.
-
Method Details
-
translateMotorPower
double translateMotorPower(double power, double velocity) This method is called to translate the desired motor power to the actual motor power taking into consideration of the motor torque curve with the current motor velocity.- Parameters:
power
- specifies the desired motor power.velocity
- specifies the current motor velocity in the unit of encoder counts per second.- Returns:
- resulting motor power.
-