bitrl & cuberl Documentation
Simulation engine for reinforcement learning agents
Loading...
Searching...
No Matches
chrono_ultrasound_backend.h
Go to the documentation of this file.
1#ifndef CHRONO_ULTRASOUND_BACKEND_H
2#define CHRONO_ULTRASOUND_BACKEND_H
3
4#include "bitrl/bitrl_config.h"
5
6#ifdef BITRL_CHRONO
7
9
10#include "chrono/physics/ChSystem.h"
11#include "chrono/physics/ChBody.h"
12
13#include <memory>
14#include <string>
15
16namespace bitrl
17{
18namespace sensors::backends
19{
20
26class CHRONO_UltrasonicBackend final: public RangeSensorBackendBase
27{
28public:
29
33 static const std::string BACKEND_TYPE;
34
38 CHRONO_UltrasonicBackend(chrono::ChSystem& sys_ptr,
39 std::shared_ptr<chrono::ChBody> body);
40
45 std::vector<real_t> read_values();
46
64 void load_from_json(const std::string& filename);
65
70 void set_position(const chrono::ChVector3d& pos){position_ = pos;}
71
75 const chrono::ChVector3d& position() const{return position_;}
76
77
78private:
79
83 chrono::ChSystem* sys_ptr_;
84
88 std::shared_ptr<chrono::ChBody> body_;
89
93 chrono::ChVector3d position_;
94
95};
96}
97}
98
99#endif
100#endif //CHRONO_ULTRASOUND_BACKEND_H
Definition bitrl_consts.h:14