![]() |
RaidZeroLib
Coroutine robot framework for VEX V5
|
A first-order motor model: speed approaches (voltage / 12 V) × free speed with a time constant. More...
#include <SimulationMotor.hpp>
Classes | |
| struct | Config |
Public Member Functions | |
| SimulationMotor () | |
| SimulationMotor (Config config) | |
| void | setVoltage (Voltage voltage) override |
| Commands a voltage, clamped to the motor's range. Positive drives the mechanism forward. | |
| bool | connected () const override |
| Voltage | appliedVoltage () const noexcept |
| The voltage actually applied (after clamping); zero while disconnected. | |
| void | setConnected (bool connected) |
| Simulates unplugging / replugging. A reconnected motor's encoder restarts from zero. | |
| Sensor< Angle > & | encoder () noexcept |
| Sensor< AngularVelocity > & | velocity () noexcept |
| Public Member Functions inherited from rz::Motor | |
| Motor ()=default | |
| Motor (const Motor &)=delete | |
| Motor & | operator= (const Motor &)=delete |
| Motor (Motor &&)=delete | |
| Motor & | operator= (Motor &&)=delete |
| virtual | ~Motor ()=default |
A first-order motor model: speed approaches (voltage / 12 V) × free speed with a time constant.
State advances lazily to the runtime's current time whenever it is read or the voltage changes, so it needs no loop. Voltage is held constant between changes, which makes the integration exact.
|
inline |
|
explicit |
|
inlinenodiscardnoexcept |
The voltage actually applied (after clamping); zero while disconnected.
|
inlinenodiscardoverridevirtual |
Implements rz::Motor.
| void rz::SimulationMotor::setConnected | ( | bool | connected | ) |
Simulates unplugging / replugging. A reconnected motor's encoder restarts from zero.
|
overridevirtual |
Commands a voltage, clamped to the motor's range. Positive drives the mechanism forward.
Implements rz::Motor.
|
inlinenodiscardnoexcept |