|
bitsim
Model, simulate, estimate and control robots in C++
|
A DC motor with an encoder, run in speed control. The application sets the target speed of the output shaft and reads back its angle and speed. The backend decides what the motor is: More...
#include <dc_motor.h>
Public Types | |
| using | OutputType = backends::DCMotorBackendBase::OutputType |
Public Member Functions | |
| DCMotor (std::shared_ptr< backends::DCMotorBackendBase > backend, const std::string &name=consts::INVALID_STR) | |
| void | set_speed (real_t speed) |
| Set the target speed of the output shaft [rad/s]. It is clamped to the maximum speed. | |
| real_t | target_speed () const noexcept |
| void | set_max_speed (real_t max_speed) |
| Limit the target speed to [-max_speed, max_speed]. | |
| real_t | max_speed () const noexcept |
| void | step (real_t dt) |
| Advance the motor by dt. A model moves its own shaft. | |
| void | step (real_t dt, const ShaftState &shaft) |
| Advance the motor by dt, with the shaft moved by a physics engine. | |
| real_t | angle () const |
| real_t | speed () const |
| real_t | encoder_angle () const |
| real_t | torque () const |
| OutputType | output_type () const noexcept |
| bool | is_ready () const |
| const std::string & | name () const noexcept |
| const std::string & | backend_type_str () const noexcept |
| std::shared_ptr< backends::DCMotorBackendBase > | backend_ptr () const noexcept |
Static Public Member Functions | |
| static std::shared_ptr< DCMotor > | create_simulated (const backends::DCMotorParameters ¶meters=backends::DCMotorParameters(), const std::string &name=consts::INVALID_STR) |
| A motor with a SIM_DCMotorBackend. | |
A DC motor with an encoder, run in speed control. The application sets the target speed of the output shaft and reads back its angle and speed. The backend decides what the motor is:
Call step() once per simulation step.
| using bitsim::actuators::DCMotor::OutputType = backends::DCMotorBackendBase::OutputType |
|
explicit |
|
inline |
|
inlinenoexcept |
|
inlinenoexcept |
|
static |
A motor with a SIM_DCMotorBackend.
|
inline |
|
inline |
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
| void bitsim::actuators::DCMotor::set_max_speed | ( | real_t | max_speed | ) |
Limit the target speed to [-max_speed, max_speed].
| void bitsim::actuators::DCMotor::set_speed | ( | real_t | speed | ) |
Set the target speed of the output shaft [rad/s]. It is clamped to the maximum speed.
|
inline |
|
inline |
Advance the motor by dt. A model moves its own shaft.
|
inline |
Advance the motor by dt, with the shaft moved by a physics engine.
|
inlinenoexcept |
|
inline |