1#ifndef BITSIM_SENSORS_IMU_SENSOR_H
2#define BITSIM_SENSORS_IMU_SENSOR_H
40 static std::shared_ptr<IMUSensor>
create(
const std::string &backend_type,
41 const std::string &name);
43 explicit IMUSensor(std::shared_ptr<backends::IMUBackendBase> backend,
58 std::string
sensor_units()
const override {
return backend_->sensor_units(); }
60 std::shared_ptr<backends::SensorBackendBase>
backend_ptr()
const override {
return backend_; }
62 std::shared_ptr<backends::IMUBackendBase>
imu_backend() const noexcept {
return backend_; }
75 std::shared_ptr<backends::IMUBackendBase> backend_;
The basic types of bitsim. Code outside this file names Eigen's matrix and vector types only through ...
std::array< real_t, 3 > angular_velocity() const
Definition imu_sensor.cpp:55
const std::vector< real_t > & read_values() override
Read the backend, if the sensor is enabled.
Definition imu_sensor.cpp:33
void init() override
Enable the sensor, reading zeros until the first read.
Definition imu_sensor.cpp:27
std::string sensor_units() const override
Definition imu_sensor.h:58
std::array< real_t, 3 > acceleration() const
Definition imu_sensor.cpp:50
static std::shared_ptr< IMUSensor > create(const std::string &backend_type, const std::string &name)
A sensor with a new backend of the given type, see backends::IMUBackendBase::create.
Definition imu_sensor.cpp:12
std::shared_ptr< backends::IMUBackendBase > imu_backend() const noexcept
Definition imu_sensor.h:62
std::string backend_type_str() const override
Definition imu_sensor.h:56
IMUSensor(std::shared_ptr< backends::IMUBackendBase > backend, const std::string &name=consts::INVALID_STR)
Definition imu_sensor.cpp:18
std::shared_ptr< backends::SensorBackendBase > backend_ptr() const override
Definition imu_sensor.h:60
static const std::string SENSOR_TYPE
Definition imu_sensor.h:34
SensorBase(const std::string &sensor_type, const std::string &sensor_name=bitsim::consts::INVALID_STR)
Definition sensor_base.h:134
const std::string INVALID_STR
Invalid string.
Definition bitsim_consts.h:21
Definition infrared_line_follower.h:9
Definition dc_motor_backend_base.h:9