Skip to content

Commit e6398cc

Browse files
committed
AP_ExternalAHRS: Added enum for temperature calibration status to ins_data_message_t
1 parent 6ed9105 commit e6398cc

2 files changed

Lines changed: 26 additions & 1 deletion

File tree

libraries/AP_ExternalAHRS/AP_ExternalAHRS.cpp

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -337,6 +337,23 @@ bool AP_ExternalAHRS::get_accel(Vector3f &accel)
337337
return true;
338338
}
339339

340+
bool AP_ExternalAHRS::get_TempCalibration(TempCal &TempCalibration)
341+
{
342+
if (!has_sensor(AvailableSensor::IMU)) {
343+
TempCalibration = DoesntProvideTemp;
344+
return false;
345+
}
346+
if (DevType(devtype) == DevType::MicroStrain7) {
347+
TempCalibration = IsTempCalibrated;
348+
return true;
349+
}
350+
else{
351+
TempCalibration = IsNotTempCalibrated;
352+
return true;
353+
}
354+
355+
}
356+
340357
// send an EKF_STATUS message to GCS
341358
void AP_ExternalAHRS::send_status_report(GCS_MAVLINK &link) const
342359
{

libraries/AP_ExternalAHRS/AP_ExternalAHRS.h

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

91+
enum TempCal {
92+
DoesntProvideTemp,
93+
IsNotTempCalibrated,
94+
IsTempCalibrated
95+
};
96+
97+
9198
struct state_t {
9299
HAL_Semaphore sem;
93100

@@ -102,7 +109,6 @@ class AP_ExternalAHRS {
102109
bool have_origin;
103110
bool have_location;
104111
bool have_velocity;
105-
106112
uint32_t last_location_update_us;
107113
} state;
108114

@@ -121,6 +127,7 @@ class AP_ExternalAHRS {
121127
void get_filter_status(nav_filter_status &status) const;
122128
bool get_gyro(Vector3f &gyro);
123129
bool get_accel(Vector3f &accel);
130+
bool get_TempCalibration(TempCal &TempCalibration);
124131
void send_status_report(class GCS_MAVLINK &link) const;
125132
bool get_variances(float &velVar, float &posVar, float &hgtVar, Vector3f &magVar, float &tasVar) const;
126133

@@ -162,6 +169,7 @@ class AP_ExternalAHRS {
162169
Vector3f accel;
163170
Vector3f gyro;
164171
float temperature;
172+
TempCal TempCalibration;
165173
} ins_data_message_t;
166174

167175
typedef struct {

0 commit comments

Comments
 (0)