Skip to content

Commit ae7f14f

Browse files
committed
AP_ExternalAHRS: Added enum for temperature calibration status to ins_data_message_t
1 parent d8a9b26 commit ae7f14f

2 files changed

Lines changed: 16 additions & 2 deletions

File tree

libraries/AP_ExternalAHRS/AP_ExternalAHRS.cpp

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,35 +110,40 @@ void AP_ExternalAHRS::init(void)
110110
#if AP_EXTERNAL_AHRS_VECTORNAV_ENABLED
111111
case DevType::VecNav:
112112
backend = NEW_NOTHROW AP_ExternalAHRS_VectorNav(this, state);
113+
pkt.TempCalibration = IsNotTempCalibrated;
113114
return;
114115
#endif
115116

116117
#if AP_EXTERNAL_AHRS_MICROSTRAIN5_ENABLED
117118
case DevType::MicroStrain5:
118119
backend = NEW_NOTHROW AP_ExternalAHRS_MicroStrain5(this, state);
120+
pkt.TempCalibration = IsNotTempCalibrated;
119121
return;
120122
#endif
121123

122124
#if AP_EXTERNAL_AHRS_MICROSTRAIN7_ENABLED
123125
case DevType::MicroStrain7:
124126
backend = NEW_NOTHROW AP_ExternalAHRS_MicroStrain7(this, state);
127+
pkt.TempCalibration = IsTempCalibrated;
125128
return;
126129
#endif
127130

128131
#if AP_EXTERNAL_AHRS_INERTIALLABS_ENABLED
129132
case DevType::InertialLabs:
130133
backend = NEW_NOTHROW AP_ExternalAHRS_InertialLabs(this, state);
134+
pkt.TempCalibration = IsNotTempCalibrated;
131135
return;
132136
#endif
133137

134138
#if AP_EXTERNAL_AHRS_SBG_ENABLED
135139
case DevType::SBG:
136140
backend = NEW_NOTHROW AP_ExternalAHRS_SBG(this, state);
141+
pkt.TempCalibration = IsNotTempCalibrated;
137142
return;
138143
#endif // AP_EXTERNAL_AHRS_SBG_ENABLED
139144

140145
}
141-
146+
pkt.TempCalibration = DoesntProvideTemp;
142147
GCS_SEND_TEXT(MAV_SEVERITY_INFO, "Unsupported ExternalAHRS type %u", unsigned(devtype));
143148
}
144149

libraries/AP_ExternalAHRS/AP_ExternalAHRS.h

Lines changed: 10 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

@@ -162,6 +168,7 @@ class AP_ExternalAHRS {
162168
Vector3f accel;
163169
Vector3f gyro;
164170
float temperature;
171+
TempCal TempCalibration;
165172
} ins_data_message_t;
166173

167174
typedef struct {
@@ -206,6 +213,8 @@ class AP_ExternalAHRS {
206213

207214
// true when user has disabled the GNSS
208215
bool gnss_is_disabled;
216+
217+
ins_data_message_t pkt;
209218
};
210219

211220
namespace AP {

0 commit comments

Comments
 (0)