1#ifndef BITSIM_SENSORS_BACKENDS_IMU_BACKEND_BASE_H
2#define BITSIM_SENSORS_BACKENDS_IMU_BACKEND_BASE_H
4#include "bitsim/bitsim_config.h"
6#include "bitsim/extern/nlohmann/json/json.hpp"
15#include <unordered_map>
47 static std::shared_ptr<IMUBackendBase>
create(
const std::string &backend_type);
58 std::string
sensor_units()
const override {
return "M/S^2,RAD/S"; }
69 virtual void load(
const nlohmann::json &j);
82 add_visual_shape(
const std::unordered_map<std::string, std::any> &shape_properties)
override;
The basic types of bitsim. Code outside this file names Eigen's matrix and vector types only through ...
void load_from_json(const std::string &filename) override
Read the settings from a JSON file, see load().
Definition imu_backend_base.cpp:62
std::array< real_t, 3 > Position
Definition imu_backend_base.h:38
void add_visual_shape(const std::unordered_map< std::string, std::any > &shape_properties) override
Draw the IMU as a small box on the body. The properties are x_length, y_length, z_length (float_t) an...
Definition imu_backend_base.cpp:73
std::string sensor_units() const override
Definition imu_backend_base.h:58
const Position & position() const noexcept
Definition imu_backend_base.h:52
static std::shared_ptr< IMUBackendBase > create(const std::string &backend_type)
Create a backend by the name a robot file gives it.
Definition imu_backend_base.cpp:19
virtual void load(const nlohmann::json &j)
Read the settings of the IMU from its section of a robot or sensor file, all optional:
Definition imu_backend_base.cpp:43
IMUBackendBase(const std::string &backend_type)
Definition imu_backend_base.h:92
void set_position(const Position &position) noexcept
Definition imu_backend_base.h:53
SensorBackendBase(const std::string &backend_type)
Constructor.
Definition sensor_backend_base.h:140
void set_n_read_values(uint_t n) noexcept
Set how many values the implementation returns.
Definition sensor_backend_base.h:114
Definition camera_backend_base.h:19
Definition dc_motor_backend_base.h:9