Skip to content

Commit 1cb3852

Browse files
author
Ramazan Yalçın
committed
AP_ExternalAHRS: disable duplicate baro temp compensation for VectorNav, SBG and InertialLabs
1 parent 54e1593 commit 1cb3852

3 files changed

Lines changed: 6 additions & 3 deletions

File tree

libraries/AP_ExternalAHRS/AP_ExternalAHRS_InertialLabs.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -412,7 +412,8 @@ bool AP_ExternalAHRS_InertialLabs::check_uart()
412412
case MessageType::TEMPERATURE: {
413413
CHECK_SIZE(u.temperature);
414414
// assume same temperature for baro and airspeed
415-
baro_data.temperature = u.temperature*0.1; // degC
415+
// setting temp to 25 effectively disables barometer temperature calibrations - these are already performed by InertialLabs
416+
baro_data.temperature = 25;
416417
airspeed_data.temperature = u.temperature*0.1; // degC
417418
ins_data.temperature = u.temperature*0.1;
418419
break;

libraries/AP_ExternalAHRS/AP_ExternalAHRS_SBG.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -551,7 +551,8 @@ void AP_ExternalAHRS_SBG::handle_msg(const sbgMessage &msg)
551551

552552
if ((cached.sbg.airData.status & SBG_ECOM_AIR_DATA_TEMPERATURE_VALID) && (updated_baro || updated_airspeed)) {
553553
cached.sensors.airspeed_data.temperature = cached.sbg.airData.airTemperature;
554-
cached.sensors.baro_data.temperature = cached.sbg.airData.airTemperature;
554+
// setting temp to 25 effectively disables barometer temperature calibrations - these are already performed by SBG
555+
cached.sensors.baro_data.temperature = 25;
555556
}
556557
break;
557558

libraries/AP_ExternalAHRS/AP_ExternalAHRS_VectorNav.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -546,7 +546,8 @@ void AP_ExternalAHRS_VectorNav::process_imu_packet(const uint8_t *b)
546546
AP_ExternalAHRS::baro_data_message_t baro;
547547
baro.instance = 0;
548548
baro.pressure_pa = pkt.pressure * 1e3;
549-
baro.temperature = pkt.temp;
549+
// setting temp to 25 effectively disables barometer temperature calibrations - these are already performed by VectorNav
550+
baro.temperature = 25;
550551

551552
AP::baro().handle_external(baro);
552553
}

0 commit comments

Comments
 (0)