/// @file AC_P.cpp1/// @brief Single-axis P controller with EEPROM-backed gain storage.23#include <AP_Math/AP_Math.h>4#include "AC_P.h"56const AP_Param::GroupInfo AC_P::var_info[] = {7// @Param: P8// @DisplayName: P Proportional Gain9// @Description: P Gain which produces an output value that is proportional to the current error value10AP_GROUPINFO_FLAGS_DEFAULT_POINTER("P", 0, AC_P, _kp, default_kp),11AP_GROUPEND12};1314float AC_P::get_p(float error) const15{16return (float)error * _kp;17}1819// Loads controller configuration from EEPROM, including gains and filter frequencies. (not used)20void AC_P::load_gains()21{22_kp.load();23}2425// Saves controller configuration from EEPROM. Used by autotune to save gains before tuning.26void AC_P::save_gains()27{28_kp.save();29}303132