DifferentialDrive: Invert right motor in LiveWindow. (#867)

This commit is contained in:
Peter Johnson
2018-01-02 21:15:15 -06:00
committed by GitHub
parent ca36d1dce6
commit bb38ef5642
2 changed files with 6 additions and 3 deletions

View File

@@ -263,6 +263,6 @@ void DifferentialDrive::InitSendable(SendableBuilder& builder) {
[=]() { return m_leftMotor.Get(); },
[=](double value) { m_leftMotor.Set(value); });
builder.AddDoubleProperty("Right Motor Speed",
[=]() { return m_rightMotor.Get(); },
[=](double value) { m_rightMotor.Set(value); });
[=]() { return -m_rightMotor.Get(); },
[=](double value) { m_rightMotor.Set(-value); });
}

View File

@@ -361,6 +361,9 @@ public class DifferentialDrive extends RobotDriveBase {
public void initSendable(SendableBuilder builder) {
builder.setSmartDashboardType("DifferentialDrive");
builder.addDoubleProperty("Left Motor Speed", m_leftMotor::get, m_leftMotor::set);
builder.addDoubleProperty("Right Motor Speed", m_rightMotor::get, m_rightMotor::set);
builder.addDoubleProperty(
"Right Motor Speed",
() -> -m_rightMotor.get(),
x -> m_rightMotor.set(-x));
}
}