Skip to content

Commit adb53b5

Browse files
committed
AP_ExternalAHRS: Added enum for temperature calibration status to ins_data_message_t
1 parent 27e3d57 commit adb53b5

File tree

2 files changed

+26
-1
lines changed

2 files changed

+26
-1
lines changed

libraries/AP_ExternalAHRS/AP_ExternalAHRS.cpp

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -330,6 +330,23 @@ bool AP_ExternalAHRS::get_accel(Vector3f &accel)
330330
return true;
331331
}
332332

333+
bool AP_ExternalAHRS::get_TempCalibration(TempCal &TempCalibration)
334+
{
335+
if (!has_sensor(AvailableSensor::IMU)) {
336+
TempCalibration = DoesntProvideTemp;
337+
return false;
338+
}
339+
if (DevType(devtype) == DevType::MicroStrain7) {
340+
TempCalibration = IsTempCalibrated;
341+
return true;
342+
}
343+
else{
344+
TempCalibration = IsNotTempCalibrated;
345+
return true;
346+
}
347+
348+
}
349+
333350
// send an EKF_STATUS message to GCS
334351
void AP_ExternalAHRS::send_status_report(GCS_MAVLINK &link) const
335352
{

libraries/AP_ExternalAHRS/AP_ExternalAHRS.h

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,13 @@ class AP_ExternalAHRS {
8686
// get serial port number, -1 for not enabled
8787
int8_t get_port(AvailableSensor sensor) const;
8888

89+
enum TempCal {
90+
DoesntProvideTemp,
91+
IsNotTempCalibrated,
92+
IsTempCalibrated
93+
};
94+
95+
8996
struct state_t {
9097
HAL_Semaphore sem;
9198

@@ -100,7 +107,6 @@ class AP_ExternalAHRS {
100107
bool have_origin;
101108
bool have_location;
102109
bool have_velocity;
103-
104110
uint32_t last_location_update_us;
105111
} state;
106112

@@ -119,6 +125,7 @@ class AP_ExternalAHRS {
119125
void get_filter_status(nav_filter_status &status) const;
120126
bool get_gyro(Vector3f &gyro);
121127
bool get_accel(Vector3f &accel);
128+
bool get_TempCalibration(TempCal &TempCalibration);
122129
void send_status_report(class GCS_MAVLINK &link) const;
123130
bool get_variances(float &velVar, float &posVar, float &hgtVar, Vector3f &magVar, float &tasVar) const;
124131

@@ -160,6 +167,7 @@ class AP_ExternalAHRS {
160167
Vector3f accel;
161168
Vector3f gyro;
162169
float temperature;
170+
TempCal TempCalibration;
163171
} ins_data_message_t;
164172

165173
typedef struct {

0 commit comments

Comments
 (0)