mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-19 00:41:43 +00:00
[wpimath] Fix DCMotor.getSpeed() (#5061)
This bug didn't occur in C++ because the units system caught it at compile time.
This commit is contained in:
@@ -86,7 +86,8 @@ public class DCMotor {
|
||||
* @return The speed of the motor.
|
||||
*/
|
||||
public double getSpeed(double torqueNm, double voltageInputVolts) {
|
||||
return voltageInputVolts - 1.0 / KtNMPerAmp * torqueNm * rOhms * KvRadPerSecPerVolt;
|
||||
return voltageInputVolts * KvRadPerSecPerVolt
|
||||
- 1.0 / KtNMPerAmp * torqueNm * rOhms * KvRadPerSecPerVolt;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user