mirror of https://github.com/ArduPilot/ardupilot
PID: stop libraries including AP_Logger.h in .h files
AP_Logger.h is a nexus of includes; while this is being improved over time, there's no reason for the library headers to include AP_Logger.h as the logger itself is access by singleton and the structures are in LogStructure.h This necessitated moving The PID_Info structure out of AP_Logger's namespace. This cleans up a pretty nasty bit - that structure is definitely not simply used for logging, but also used to pass pid information around to controllers! There are a lot of patches in here because AP_Logger.h, acting as a nexus, was providing transitive header file inclusion in many (some unlikely!) places.
This commit is contained in:
parent
c829b109bf
commit
a10ed0e87f
|
@ -4,7 +4,7 @@
|
||||||
|
|
||||||
#include <AP_Common/AP_Common.h>
|
#include <AP_Common/AP_Common.h>
|
||||||
#include <AP_Param/AP_Param.h>
|
#include <AP_Param/AP_Param.h>
|
||||||
#include <AP_Logger/AP_Logger.h>
|
#include <AC_PID/AC_PID.h> // for AP_PIDInfo
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <cmath>
|
#include <cmath>
|
||||||
|
|
||||||
|
@ -98,7 +98,7 @@ public:
|
||||||
|
|
||||||
static const struct AP_Param::GroupInfo var_info[];
|
static const struct AP_Param::GroupInfo var_info[];
|
||||||
|
|
||||||
const AP_Logger::PID_Info& get_pid_info(void) const { return _pid_info; }
|
const AP_PIDInfo& get_pid_info(void) const { return _pid_info; }
|
||||||
|
|
||||||
private:
|
private:
|
||||||
AP_Float _kp;
|
AP_Float _kp;
|
||||||
|
@ -113,7 +113,7 @@ private:
|
||||||
|
|
||||||
float _get_pid(float error, uint16_t dt, float scaler);
|
float _get_pid(float error, uint16_t dt, float scaler);
|
||||||
|
|
||||||
AP_Logger::PID_Info _pid_info {};
|
AP_PIDInfo _pid_info {};
|
||||||
|
|
||||||
/// Low pass filter cut frequency for derivative calculation.
|
/// Low pass filter cut frequency for derivative calculation.
|
||||||
///
|
///
|
||||||
|
|
Loading…
Reference in New Issue