|
bitsim
Model, simulate, estimate and control robots in C++
|
Base class for the implementations of a DC motor. A backend takes a target speed for the output shaft and does whatever it takes to reach it: a model of the motor, or a real motor on a board. More...
#include <dc_motor_backend_base.h>

Public Types | |
| enum class | OutputType { TORQUE , ANGLE } |
Public Member Functions | |
| virtual | ~DCMotorBackendBase ()=default |
| virtual OutputType | output_type () const noexcept=0 |
| virtual void | set_target_speed (real_t speed)=0 |
| Set the target speed of the output shaft [rad/s]. | |
| virtual void | step (real_t dt)=0 |
| Advance the backend by dt. A model moves its own shaft. | |
| virtual void | step (real_t dt, const ShaftState &shaft)=0 |
| Advance the backend by dt, with the shaft moved by a physics engine. Backends with OutputType::ANGLE ignore the shaft. | |
| virtual real_t | angle () const =0 |
| virtual real_t | speed () const =0 |
| virtual real_t | encoder_angle () const |
| virtual real_t | torque () const |
| virtual bool | is_ready () const |
| const std::string & | backend_type_str () const noexcept |
Protected Member Functions | |
| DCMotorBackendBase (const std::string &backend_type) | |
Base class for the implementations of a DC motor. A backend takes a target speed for the output shaft and does whatever it takes to reach it: a model of the motor, or a real motor on a board.
The two kinds couple to a physics engine differently. A model computes the torque the motor produces, so the engine moves the shaft (OutputType::TORQUE). A real motor has already moved, so the engine has to follow its angle (OutputType::ANGLE).
|
strong |
|
virtualdefault |
|
inlineexplicitprotected |
|
pure virtual |
Implemented in bitsim::actuators::backends::MQTT_DCMotorBackend, and bitsim::actuators::backends::SIM_DCMotorBackend.
|
inlinenoexcept |
|
inlinevirtual |
Reimplemented in bitsim::actuators::backends::MQTT_DCMotorBackend, and bitsim::actuators::backends::SIM_DCMotorBackend.
|
inlinevirtual |
Reimplemented in bitsim::actuators::backends::MQTT_DCMotorBackend.
|
pure virtualnoexcept |
Implemented in bitsim::actuators::backends::MQTT_DCMotorBackend, and bitsim::actuators::backends::SIM_DCMotorBackend.
|
pure virtual |
Set the target speed of the output shaft [rad/s].
Implemented in bitsim::actuators::backends::MQTT_DCMotorBackend, and bitsim::actuators::backends::SIM_DCMotorBackend.
|
pure virtual |
Implemented in bitsim::actuators::backends::MQTT_DCMotorBackend, and bitsim::actuators::backends::SIM_DCMotorBackend.
|
pure virtual |
Advance the backend by dt. A model moves its own shaft.
Implemented in bitsim::actuators::backends::MQTT_DCMotorBackend, and bitsim::actuators::backends::SIM_DCMotorBackend.
|
pure virtual |
Advance the backend by dt, with the shaft moved by a physics engine. Backends with OutputType::ANGLE ignore the shaft.
Implemented in bitsim::actuators::backends::MQTT_DCMotorBackend, and bitsim::actuators::backends::SIM_DCMotorBackend.
|
inlinevirtual |
Reimplemented in bitsim::actuators::backends::SIM_DCMotorBackend.