Khangai Robot Play - Naive  01
THe naive play of the Khangai Robot
actuator.h
Go to the documentation of this file.
1 /*
2  * actuator.h
3  *
4  * Created : 1/2/2019
5  * Author : n-is
6  * email : 073bex422.nischal@pcampus.edu.np
7  */
8 
9 #ifndef _ACTUATOR_H_
10 #define _ACTUATOR_H_
11 
12 #include "wheel.h"
13 #include "vec3.h"
14 
15 class Actuator final
16 {
17 public:
18  Actuator(Actuator &&) = default;
19  Actuator(const Actuator &) = default;
20  Actuator &operator=(Actuator &&) = default;
21  Actuator &operator=(const Actuator &) = default;
22  ~Actuator() { }
23 
24  static Actuator& get_Instance();
25 
26  int init();
27  Vec3<float> actuate(Vec3<float> vel, Vec3<float> psis, uint32_t dt_millis, int8_t test = 0);
28  uint32_t stop(uint32_t dt_millis, float ramp_factor = 2.0, uint32_t max_time = 1000);
29  void clear();
30 
31  void profile(Vec3<float> vel, uint32_t dt_millis);
32  void check();
33 
34 private:
37 
38  Actuator() { }
39  void wheels_Init();
40  void pid_Init();
41  void set_AnglePID(PID *pid) { angle_pid_ = pid; }
42 };
43 
44 #endif // !_ACTUATOR_H_
Actuator & operator=(Actuator &&)=default
void set_AnglePID(PID *pid)
Definition: actuator.h:41
PID * angle_pid_
Definition: actuator.h:36
~Actuator()
Definition: actuator.h:22
Actuator()
Definition: actuator.h:38
int init()
Function that initializes all the required components for the robot's actuator(omni-base)
Definition: actuator.cpp:43
void profile(Vec3< float > vel, uint32_t dt_millis)
Definition: actuator.cpp:368
void clear()
Definition: actuator.cpp:244
Definition: wheel.h:51
static Actuator & get_Instance()
Definition: actuator.cpp:23
void check()
Definition: actuator.cpp:396
Vec3< float > actuate(Vec3< float > vel, Vec3< float > psis, uint32_t dt_millis, int8_t test=0)
Function that actuate the robot's base(omni-base)
Definition: actuator.cpp:88
uint32_t stop(uint32_t dt_millis, float ramp_factor=2.0, uint32_t max_time=1000)
Definition: actuator.cpp:189
Definition: pid.h:14
Wheel wheels_[4]
Definition: actuator.h:35
void pid_Init()
Function that initializes all the required components for the wheel's pid controller.
Definition: actuator.cpp:346
Definition: actuator.h:15
void wheels_Init()
Function that initializes all the required components for the wheels of the robot.
Definition: actuator.cpp:274