[examples] Make DriveDistanceOffboard example work in sim (#3199)

Adds some basic functionality to the ExampleMotorController so that
controller inputs show up in LiveWindow widgets in simulation.
This commit is contained in:
Prateek Machiraju
2021-03-04 02:38:13 -05:00
committed by GitHub
parent f3f86b8e78
commit 6812302ff9
2 changed files with 11 additions and 4 deletions

View File

@@ -18,6 +18,8 @@ public class ExampleSmartMotorController implements SpeedController {
kMovementWitchcraft
}
double m_value;
/**
* Creates a new ExampleSmartMotorController.
*
@@ -73,11 +75,13 @@ public class ExampleSmartMotorController implements SpeedController {
public void resetEncoder() {}
@Override
public void set(double speed) {}
public void set(double speed) {
m_value = speed;
}
@Override
public double get() {
return 0;
return m_value;
}
@Override