1#ifndef BITSIM_SENSORS_BACKENDS_INFRARED_BACKEND_BASE_H
2#define BITSIM_SENSORS_BACKENDS_INFRARED_BACKEND_BASE_H
4#include "bitsim/bitsim_config.h"
6#include "bitsim/extern/nlohmann/json/json.hpp"
16#include <unordered_map>
51 static std::shared_ptr<InfraredBackendBase>
create(
const std::string &backend_type);
57 const std::vector<Position> &
elements() const noexcept {
return elements_; }
73 std::string
sensor_units()
const override {
return "REFLECTANCE"; }
85 virtual void load(
const nlohmann::json &j);
98 add_visual_shape(
const std::unordered_map<std::string, std::any> &shape_properties)
override;
105 std::vector<Position> elements_;
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 infrared_backend_base.cpp:77
void set_elements(const std::vector< Position > &elements)
Set the positions of the elements on the body. One value is read per element.
Definition infrared_backend_base.cpp:43
static std::shared_ptr< InfraredBackendBase > create(const std::string &backend_type)
Create a backend by the name a robot file gives it.
Definition infrared_backend_base.cpp:19
std::string sensor_units() const override
Definition infrared_backend_base.h:73
uint_t n_elements() const noexcept
Definition infrared_backend_base.h:68
void add_visual_shape(const std::unordered_map< std::string, std::any > &shape_properties) override
Draw each element as a small box on the body. The properties are x_length, y_length,...
Definition infrared_backend_base.cpp:88
virtual void load(const nlohmann::json &j)
Read the settings of the sensor from its section of a robot or sensor file:
Definition infrared_backend_base.cpp:53
const std::vector< Position > & elements() const noexcept
Definition infrared_backend_base.h:57
std::array< real_t, 3 > Position
The position of an element on the robot's body [m].
Definition infrared_backend_base.h:42
InfraredBackendBase(const std::string &backend_type)
Definition infrared_backend_base.h:108
SensorBackendBase(const std::string &backend_type)
Constructor.
Definition sensor_backend_base.h:140
Definition camera_backend_base.h:19
Definition dc_motor_backend_base.h:9
std::size_t uint_t
uint_t
Definition bitsim_types.h:40