diff --git a/libraries/AP_InertialSensor/AP_InertialSensor_ExternalAHRS.cpp b/libraries/AP_InertialSensor/AP_InertialSensor_ExternalAHRS.cpp index 3f2a966f48..5493a1a5be 100644 --- a/libraries/AP_InertialSensor/AP_InertialSensor_ExternalAHRS.cpp +++ b/libraries/AP_InertialSensor/AP_InertialSensor_ExternalAHRS.cpp @@ -1,6 +1,7 @@ #include #include "AP_InertialSensor_ExternalAHRS.h" #include +#include #if HAL_EXTERNAL_AHRS_ENABLED @@ -55,5 +56,16 @@ void AP_InertialSensor_ExternalAHRS::accumulate() AP::externalAHRS().update(); } +// get a startup banner to output to the GCS +bool AP_InertialSensor_ExternalAHRS::get_output_banner(char* banner, uint8_t banner_len) +{ + const char* name = AP::externalAHRS().get_name(); + snprintf(banner, banner_len, "IMU%u: External: %s %0.0fHz", + gyro_instance, + (name != nullptr) ? name : "", + AP::externalAHRS().get_IMU_rate()); + return true; +} + #endif // HAL_EXTERNAL_AHRS_ENABLED diff --git a/libraries/AP_InertialSensor/AP_InertialSensor_ExternalAHRS.h b/libraries/AP_InertialSensor/AP_InertialSensor_ExternalAHRS.h index 626deded31..1af9e4c033 100644 --- a/libraries/AP_InertialSensor/AP_InertialSensor_ExternalAHRS.h +++ b/libraries/AP_InertialSensor/AP_InertialSensor_ExternalAHRS.h @@ -18,6 +18,7 @@ public: void accumulate() override; void handle_external(const AP_ExternalAHRS::ins_data_message_t &pkt) override; + bool get_output_banner(char* banner, uint8_t banner_len) override; private: uint8_t gyro_instance;