Browse Source

ArduPlane: 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.
apm_2208
Peter Barker 3 years ago committed by Peter Barker
parent
commit
fd4a00a654
  1. 4
      ArduPlane/GCS_Mavlink.cpp
  2. 2
      ArduPlane/GCS_Mavlink.h
  3. 1
      ArduPlane/quadplane.h

4
ArduPlane/GCS_Mavlink.cpp

@ -290,7 +290,7 @@ void GCS_MAVLINK_Plane::send_wind() const
} }
// sends a single pid info over the provided channel // sends a single pid info over the provided channel
void GCS_MAVLINK_Plane::send_pid_info(const AP_Logger::PID_Info *pid_info, void GCS_MAVLINK_Plane::send_pid_info(const AP_PIDInfo *pid_info,
const uint8_t axis, const float achieved) const uint8_t axis, const float achieved)
{ {
if (pid_info == nullptr) { if (pid_info == nullptr) {
@ -322,7 +322,7 @@ void GCS_MAVLINK_Plane::send_pid_tuning()
const Parameters &g = plane.g; const Parameters &g = plane.g;
const AP_Logger::PID_Info *pid_info; const AP_PIDInfo *pid_info;
if (g.gcs_pid_mask & TUNING_BITS_ROLL) { if (g.gcs_pid_mask & TUNING_BITS_ROLL) {
pid_info = &plane.rollController.get_pid_info(); pid_info = &plane.rollController.get_pid_info();
#if HAL_QUADPLANE_ENABLED #if HAL_QUADPLANE_ENABLED

2
ArduPlane/GCS_Mavlink.h

@ -41,7 +41,7 @@ protected:
private: private:
void send_pid_info(const AP_Logger::PID_Info *pid_info, const uint8_t axis, const float achieved); void send_pid_info(const AP_PIDInfo *pid_info, const uint8_t axis, const float achieved);
void handleMessage(const mavlink_message_t &msg) override; void handleMessage(const mavlink_message_t &msg) override;
bool handle_guided_request(AP_Mission::Mission_Command &cmd) override; bool handle_guided_request(AP_Mission::Mission_Command &cmd) override;

1
ArduPlane/quadplane.h

@ -18,6 +18,7 @@
#include <AC_WPNav/AC_Loiter.h> #include <AC_WPNav/AC_Loiter.h>
#include <AC_Fence/AC_Fence.h> #include <AC_Fence/AC_Fence.h>
#include <AC_Avoidance/AC_Avoid.h> #include <AC_Avoidance/AC_Avoid.h>
#include <AP_Logger/LogStructure.h>
#include <AP_Proximity/AP_Proximity.h> #include <AP_Proximity/AP_Proximity.h>
#include "qautotune.h" #include "qautotune.h"
#include "defines.h" #include "defines.h"

Loading…
Cancel
Save