APM:Libraries
AC_P.cpp
Go to the documentation of this file.
1 
4 #include <AP_Math/AP_Math.h>
5 #include "AC_P.h"
6 
8  // @Param: P
9  // @DisplayName: PI Proportional Gain
10  // @Description: P Gain which produces an output value that is proportional to the current error value
11  AP_GROUPINFO("P", 0, AC_P, _kp, 0),
13 };
14 
15 float AC_P::get_p(float error) const
16 {
17  return (float)error * _kp;
18 }
19 
21 {
22  _kp.load();
23 }
24 
26 {
27  _kp.save();
28 }
void save_gains()
Definition: AC_P.cpp:25
#define AP_GROUPINFO(name, idx, clazz, element, def)
Definition: AP_Param.h:102
void load_gains()
Definition: AC_P.cpp:20
static const struct AP_Param::GroupInfo var_info[]
Definition: AC_P.h:62
Object managing one P controller.
Definition: AC_P.h:13
AP_Float _kp
Definition: AC_P.h:65
#define error(fmt, args ...)
float get_p(float error) const
Definition: AC_P.cpp:15
#define AP_GROUPEND
Definition: AP_Param.h:121