mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-20 00:51:42 +00:00
[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:
committed by
GitHub
parent
f3f86b8e78
commit
6812302ff9
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user