bitsim
Model, simulate, estimate and control robots in C++
Loading...
Searching...
No Matches
chrono_infrared_backend.h
Go to the documentation of this file.
1#ifndef BITSIM_SENSORS_BACKENDS_CHRONO_INFRARED_BACKEND_H
2#define BITSIM_SENSORS_BACKENDS_CHRONO_INFRARED_BACKEND_H
3
4#include "bitsim/bitsim_config.h"
5
6#ifdef BITSIM_CHRONO
7
9
10#include <chrono/physics/ChBody.h>
11
12#include <functional>
13#include <memory>
14#include <string>
15#include <vector>
16
17namespace bitsim
18{
19namespace sensors::backends
20{
21
33{
34 public:
38 using Floor = std::function<real_t(real_t x, real_t y)>;
39
40 static const std::string BACKEND_TYPE;
41
47
48 CHRONO_InfraredBackend(std::shared_ptr<chrono::ChBody> body, Floor floor);
49
53 void set_floor(Floor floor) { floor_ = std::move(floor); }
54
55 bool has_floor() const noexcept { return static_cast<bool>(floor_); }
56
62 std::vector<real_t> read_values() override;
63
64 private:
65 Floor floor_;
66};
67
68} // namespace sensors::backends
69} // namespace bitsim
70
71#endif
72#endif // BITSIM_SENSORS_BACKENDS_CHRONO_INFRARED_BACKEND_H
void set_floor(Floor floor)
Set the floor the elements look at.
Definition chrono_infrared_backend.h:53
bool has_floor() const noexcept
Definition chrono_infrared_backend.h:55
std::function< real_t(real_t x, real_t y)> Floor
The reflectance of the floor at a point of the world, in [0, 1].
Definition chrono_infrared_backend.h:38
static const std::string BACKEND_TYPE
Definition chrono_infrared_backend.h:40
std::vector< real_t > read_values() override
Read the floor under each element.
Definition chrono_infrared_backend.cpp:25
CHRONO_InfraredBackend()
Constructor. Attach a body with set_chrono_body() and a floor with set_floor() before reading.
Definition chrono_infrared_backend.cpp:17
InfraredBackendBase(const std::string &backend_type)
Definition infrared_backend_base.h:108
Definition camera_backend_base.h:19
Definition dc_motor_backend_base.h:9
double real_t
real_t
Definition bitsim_types.h:20