mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-21 01:01:43 +00:00
DifferentialDrive: Invert right motor in LiveWindow. (#867)
This commit is contained in:
@@ -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); });
|
||||
}
|
||||
|
||||
@@ -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));
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user