mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-07-03 03:01:44 +00:00
Invert when getting motor speed in SpeedControllerGroup (#886)
This commit is contained in:
committed by
Peter Johnson
parent
5513888457
commit
59f938b584
@@ -19,7 +19,7 @@ void SpeedControllerGroup::Set(double speed) {
|
||||
|
||||
double SpeedControllerGroup::Get() const {
|
||||
if (!m_speedControllers.empty()) {
|
||||
return m_speedControllers.front().get().Get();
|
||||
return m_speedControllers.front().get().Get() * (m_isInverted ? -1 : 1);
|
||||
}
|
||||
return 0.0;
|
||||
}
|
||||
|
||||
@@ -45,7 +45,7 @@ public class SpeedControllerGroup extends SendableBase implements SpeedControlle
|
||||
@Override
|
||||
public double get() {
|
||||
if (m_speedControllers.length > 0) {
|
||||
return m_speedControllers[0].get();
|
||||
return m_speedControllers[0].get() * (m_isInverted ? -1 : 1);
|
||||
}
|
||||
return 0.0;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user