AP_ExternalAHRS: honour AP_COMPASS_EXTERNALAHRS_ENABLED

This commit is contained in:
Peter Barker 2023-02-20 12:05:20 +11:00 committed by Andrew Tridgell
parent 2c93b7809c
commit c47a698edd
2 changed files with 6 additions and 0 deletions

View File

@ -262,12 +262,14 @@ void AP_ExternalAHRS_LORD::post_imu() const
AP::ins().handle_external(ins);
}
#if AP_COMPASS_EXTERNALAHRS_ENABLED
{
AP_ExternalAHRS::mag_data_message_t mag {
field: imu_data.mag
};
AP::compass().handle_external(mag);
}
#endif
#if AP_BARO_EXTERNALAHRS_ENABLED
{

View File

@ -486,6 +486,7 @@ void AP_ExternalAHRS_VectorNav::process_packet1(const uint8_t *b)
}
#endif
#if AP_COMPASS_EXTERNALAHRS_ENABLED
{
AP_ExternalAHRS::mag_data_message_t mag;
mag.field = Vector3f{pkt1.mag[0], pkt1.mag[1], pkt1.mag[2]};
@ -493,6 +494,7 @@ void AP_ExternalAHRS_VectorNav::process_packet1(const uint8_t *b)
AP::compass().handle_external(mag);
}
#endif
{
AP_ExternalAHRS::ins_data_message_t ins;
@ -617,6 +619,7 @@ void AP_ExternalAHRS_VectorNav::process_packet_VN_100(const uint8_t *b)
}
#endif
#if AP_COMPASS_EXTERNALAHRS_ENABLED
{
AP_ExternalAHRS::mag_data_message_t mag;
if (use_uncomp) {
@ -628,6 +631,7 @@ void AP_ExternalAHRS_VectorNav::process_packet_VN_100(const uint8_t *b)
AP::compass().handle_external(mag);
}
#endif
{
AP_ExternalAHRS::ins_data_message_t ins;