mirror of
https://github.com/ArduPilot/ardupilot
synced 2025-01-03 06:28:27 -04:00
AP_InertialSensor: External: report name in output banner
This commit is contained in:
parent
ec1814da34
commit
2e465b4c18
@ -1,6 +1,7 @@
|
||||
#include <AP_HAL/AP_HAL.h>
|
||||
#include "AP_InertialSensor_ExternalAHRS.h"
|
||||
#include <AP_ExternalAHRS/AP_ExternalAHRS.h>
|
||||
#include <stdio.h>
|
||||
|
||||
#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
|
||||
|
||||
|
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user