Browse Source

AP_Vehicle: added ExternalAHRS param tree and object

using EAHRS param prefix
c415-sdk
Andrew Tridgell 4 years ago committed by Peter Barker
parent
commit
66297bd061
  1. 11
      libraries/AP_Vehicle/AP_Vehicle.cpp
  2. 5
      libraries/AP_Vehicle/AP_Vehicle.h

11
libraries/AP_Vehicle/AP_Vehicle.cpp

@ -52,6 +52,12 @@ const AP_Param::GroupInfo AP_Vehicle::var_info[] = { @@ -52,6 +52,12 @@ const AP_Param::GroupInfo AP_Vehicle::var_info[] = {
AP_SUBGROUPINFO(generator, "GEN_", 7, AP_Vehicle, AP_Generator),
#endif
#if HAL_EXTERNAL_AHRS_ENABLED
// @Group: EAHRS
// @Path: ../AP_ExternalAHRS/AP_ExternalAHRS.cpp
AP_SUBGROUPINFO(externalAHRS, "EAHRS", 8, AP_Vehicle, AP_ExternalAHRS),
#endif
AP_GROUPEND
};
@ -115,6 +121,11 @@ void AP_Vehicle::setup() @@ -115,6 +121,11 @@ void AP_Vehicle::setup()
msp.init();
#endif
#if HAL_EXTERNAL_AHRS_ENABLED
// call externalAHRS init before init_ardupilot to allow for external sensors
externalAHRS.init();
#endif
// init_ardupilot is where the vehicle does most of its initialisation.
init_ardupilot();
gcs().send_text(MAV_SEVERITY_INFO, "ArduPilot Ready");

5
libraries/AP_Vehicle/AP_Vehicle.h

@ -44,6 +44,7 @@ @@ -44,6 +44,7 @@
#include <AP_RCTelemetry/AP_VideoTX.h>
#include <AP_MSP/AP_MSP.h>
#include <AP_Frsky_Telem/AP_Frsky_Parameters.h>
#include <AP_ExternalAHRS/AP_ExternalAHRS.h>
class AP_Vehicle : public AP_HAL::HAL::Callbacks {
@ -309,6 +310,10 @@ protected: @@ -309,6 +310,10 @@ protected:
AP_Generator generator;
#endif
#if HAL_EXTERNAL_AHRS_ENABLED
AP_ExternalAHRS externalAHRS;
#endif
static const struct AP_Param::GroupInfo var_info[];
static const struct AP_Scheduler::Task scheduler_tasks[];

Loading…
Cancel
Save