mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-19 00:41:43 +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
@@ -68,9 +68,9 @@ class ExampleSmartMotorController : public frc::SpeedController {
|
||||
*/
|
||||
void ResetEncoder() {}
|
||||
|
||||
void Set(double speed) override {}
|
||||
void Set(double speed) override { m_value = speed; }
|
||||
|
||||
double Get() const override { return 0; }
|
||||
double Get() const override { return m_value; }
|
||||
|
||||
void SetInverted(bool isInverted) override {}
|
||||
|
||||
@@ -81,4 +81,7 @@ class ExampleSmartMotorController : public frc::SpeedController {
|
||||
void StopMotor() override {}
|
||||
|
||||
void PIDWrite(double output) override {}
|
||||
|
||||
private:
|
||||
double m_value = 0.0;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user