ardupilot/libraries/AC_PID/AC_P.cpp
Gustavo Jose de Sousa bdf33e91e4 AC_PID: standardize inclusion of libaries headers
This commit changes the way libraries headers are included in source files:

 - If the header is in the same directory the source belongs to, so the
 notation '#include ""' is used with the path relative to the directory
 containing the source.

 - If the header is outside the directory containing the source, then we use
 the notation '#include <>' with the path relative to libraries folder.

Some of the advantages of such approach:

 - Only one search path for libraries headers.

 - OSs like Windows may have a better lookup time.
2015-08-19 20:42:10 +09:00

31 lines
623 B
C++

// -*- tab-width: 4; Mode: C++; c-basic-offset: 4; indent-tabs-mode: nil -*-
/// @file AC_P.cpp
/// @brief Generic P algorithm
#include <AP_Math/AP_Math.h>
#include "AC_P.h"
const AP_Param::GroupInfo AC_P::var_info[] PROGMEM = {
// @Param: P
// @DisplayName: PI Proportional Gain
// @Description: P Gain which produces an output value that is proportional to the current error value
AP_GROUPINFO("P", 0, AC_P, _kp, 0),
AP_GROUPEND
};
float AC_P::get_p(float error) const
{
return (float)error * _kp;
}
void AC_P::load_gains()
{
_kp.load();
}
void AC_P::save_gains()
{
_kp.save();
}