1#ifndef BITSIM_ACTUATORS_BACKENDS_MQTT_DC_MOTOR_BACKEND_H
2#define BITSIM_ACTUATORS_BACKENDS_MQTT_DC_MOTOR_BACKEND_H
4#include "bitsim/bitsim_config.h"
82 std::shared_ptr<boards::DCMotorBoardBase>
board() const noexcept {
return board_; }
86 real_t predicted_angle_()
const;
88 std::shared_ptr<boards::DCMotorBoardBase> board_;
92 std::optional<real_t> zero_;
93 real_t reported_angle_{0.0};
94 real_t reported_speed_{0.0};
98 real_t estimate_rate_{0.0};
The basic types of bitsim. Code outside this file names Eigen's matrix and vector types only through ...
OutputType
Definition dc_motor_backend_base.h:41
@ ANGLE
Definition dc_motor_backend_base.h:43
DCMotorBackendBase(const std::string &backend_type)
Definition dc_motor_backend_base.h:104
void set_target_speed(real_t speed) override
Set the target speed of the output shaft [rad/s].
Definition mqtt_dc_motor_backend.cpp:37
void step(real_t dt) override
Advance the backend by dt. A model moves its own shaft.
Definition mqtt_dc_motor_backend.cpp:49
uint_t channel() const noexcept
Definition mqtt_dc_motor_backend.h:83
real_t angle() const override
Definition mqtt_dc_motor_backend.h:57
real_t encoder_angle() const override
Definition mqtt_dc_motor_backend.h:65
static const std::string BACKEND_TYPE
Definition mqtt_dc_motor_backend.h:39
real_t speed() const override
Definition mqtt_dc_motor_backend.h:59
bool is_ready() const override
Definition mqtt_dc_motor_backend.cpp:42
void step(real_t dt, const ShaftState &) override
Advance the backend by dt, with the shaft moved by a physics engine. Backends with OutputType::ANGLE ...
Definition mqtt_dc_motor_backend.h:55
real_t reported_speed() const noexcept
Definition mqtt_dc_motor_backend.h:80
std::shared_ptr< boards::DCMotorBoardBase > board() const noexcept
Definition mqtt_dc_motor_backend.h:82
OutputType output_type() const noexcept override
Definition mqtt_dc_motor_backend.h:49
MQTT_DCMotorBackend(std::shared_ptr< boards::DCMotorBoardBase > board, uint_t channel, real_t bandwidth=30.0)
Definition mqtt_dc_motor_backend.cpp:23
real_t reported_angle() const noexcept
Definition mqtt_dc_motor_backend.h:75
Definition dc_motor_backend_base.h:23
Definition dc_motor_backend_base.h:9
std::size_t uint_t
uint_t
Definition bitsim_types.h:40
double real_t
real_t
Definition bitsim_types.h:20
The state of the output shaft of a motor, as a simulator sees it.
Definition dc_motor_backend_base.h:17