Khangai Robot Play - Naive  01
THe naive play of the Khangai Robot
state_sensor.h
Go to the documentation of this file.
1 /*
2  * state_sensor.h
3  *
4  * Created : 1/2/2019
5  * Author : n-is
6  * email : 073bex422.nischal@pcampus.edu.np
7  */
8 
9 #ifndef _STATE_SENSOR_H_
10 #define _STATE_SENSOR_H_
11 
12 #include "vec3.h"
13 #include "position_sensor.h"
14 #include "bound_box.h"
15 
16 // SOme forward declarations
17 enum class Field;
18 struct State_Vars;
19 
20 class State_Sensor final
21 {
22 public:
23  State_Sensor(State_Sensor &&) = default;
24  State_Sensor(const State_Sensor &) = default;
25  State_Sensor &operator=(State_Sensor &&) = default;
26  State_Sensor &operator=(const State_Sensor &) = default;
28 
29  static State_Sensor& get_Instance();
30 
31  int init(uint32_t dt_millis);
32  Vec3<float> read_State(Vec3<float> base_state, const State_Vars *sv, uint32_t dt_millis);
33 
34 
37 
38  void change_Sensors(Field field_id);
39  uint8_t get_Bounds();
40 
42  void update_IMUOffsets(Vec3<float> offsets);
43 
44 private:
46 
48  uint8_t bounds_;
49 
52 
54  Vec3<float> read_Orientation(Vec3<float> base_state, uint32_t dt_millis);
56 };
57 
58 #endif // !_STATE_SENSOR_H_
State_Sensor()
Definition: state_sensor.h:53
void remove_PSensor(Sensor< float > *sen)
Definition: state_sensor.h:36
State_Sensor & operator=(State_Sensor &&)=default
uint8_t bounds_
Definition: state_sensor.h:48
Bound_Box * bound_box_
Definition: state_sensor.h:47
void add_PSensor(Sensor< float > *sen)
Definition: state_sensor.h:35
Vec3< float > read_State(Vec3< float > base_state, const State_Vars *sv, uint32_t dt_millis)
Function that provides the state of the robot.
Definition: state_sensor.cpp:121
static State_Sensor & get_Instance()
Definition: state_sensor.cpp:23
~State_Sensor()
Definition: state_sensor.h:27
Vec3< float > first_ori_
Definition: state_sensor.h:51
Vec3< float > read_Orientation(Vec3< float > base_state, uint32_t dt_millis)
Function that provides the orientation of the robot.
Definition: state_sensor.cpp:300
Field
Definition: robo_states.h:16
PositionSensor * p_sensor_
Definition: state_sensor.h:45
uint8_t get_Bounds()
Definition: state_sensor.cpp:502
void update_IMUOffsets(Vec3< float > offsets)
Definition: state_sensor.cpp:387
Definition: state_sensor.h:20
void update_Position(Vec3< float > pos)
Definition: state_sensor.h:41
Definition: robo_states.h:43
bool is_first_ori_
Definition: state_sensor.h:50
int init(uint32_t dt_millis)
Function that initializes all the required components for the robot's State Sensor(x,...
Definition: state_sensor.cpp:50
void update_State(Vec3< float > state)
Definition: position_sensor.cpp:158
Vec3< float > compensate_Bounds(Vec3< float > pos, Vec3< float > ori, const State_Vars *sv)
Definition: state_sensor.cpp:153
Definition: position_sensor.h:31
Definition: bound_box.h:106
void remove_Sensor(Sensor< float > *sen)
Definition: position_sensor.h:54
void change_Sensors(Field field_id)
Definition: state_sensor.cpp:392
void add_Sensor(Sensor< float > *sen)
Definition: position_sensor.h:45