Common
common packages for kyubic
 
Loading...
Searching...
No Matches
p_pid_controller.hpp
Go to the documentation of this file.
1
10#ifndef _P_PID_CONTROLLER_HPP
11#define _P_PID_CONTROLLER_HPP
12
13#include <array>
14#include <map>
15#include <memory>
17
22namespace controller
23{
24
29{
30private:
31 std::shared_ptr<pid_controller::VelocityP_PID> pid_x_, pid_y_, pid_z_, pid_roll_, pid_yaw_;
32
33 // Define unique name(axes)
34 std::array<std::string, 5> name = {"x", "y", "z", "roll", "yaw"};
35 std::map<std::string, pid_controller::VelocityP_PIDParameter> pid_params;
36 double roll_sf;
37
42 bool _load_gain_from_yaml(const std::string & yaml_path);
43
44public:
45 explicit P_PIDController(const std::string & yaml_path);
46
47 double pid_x_update(double current_slave, double current_master, double target_master);
48 double pid_y_update(double current_slave, double current_master, double target_master);
49 double pid_z_update(double current_slave, double current_master, double target_master);
50 double pid_roll_update(double current_slave, double current_master, double target);
51 double pid_yaw_update(double current_slave, double current_master, double target);
52
53 void set_z_offset(double force);
54 void set_roll_offset(double roll_deg);
55
56 void pid_x_reset();
57 void pid_y_reset();
58 void pid_z_reset();
59 void pid_roll_reset();
60 void pid_yaw_reset();
61 void pid_all_reset();
62
63 std::array<double, 5> update(std::array<std::array<double, 3>, 5> data);
64};
65
66} // namespace controller
67
68#endif
P-PID Controller class.
Definition: p_pid_controller.hpp:29
void pid_y_reset()
Definition: p_pid_controller.cpp:138
double pid_yaw_update(double current_slave, double current_master, double target)
Definition: p_pid_controller.cpp:112
void pid_x_reset()
Definition: p_pid_controller.cpp:137
void set_z_offset(double force)
Definition: p_pid_controller.cpp:130
void pid_roll_reset()
Definition: p_pid_controller.cpp:140
double pid_x_update(double current_slave, double current_master, double target_master)
Definition: p_pid_controller.cpp:88
double pid_roll_update(double current_slave, double current_master, double target)
Definition: p_pid_controller.cpp:106
void pid_z_reset()
Definition: p_pid_controller.cpp:139
std::array< double, 5 > update(std::array< std::array< double, 3 >, 5 > data)
Definition: p_pid_controller.cpp:118
void set_roll_offset(double roll_deg)
Definition: p_pid_controller.cpp:132
double pid_z_update(double current_slave, double current_master, double target_master)
Definition: p_pid_controller.cpp:100
void pid_yaw_reset()
Definition: p_pid_controller.cpp:141
void pid_all_reset()
Definition: p_pid_controller.cpp:142
double pid_y_update(double current_slave, double current_master, double target_master)
Definition: p_pid_controller.cpp:94
For controller.
P-PID Controller library.