Skip to content

Commit dd16037

Browse files
committed
AP_ExternalAHRS: Added enum for temperature calibration status to ins_data_message_t
1 parent 0925aeb commit dd16037

4 files changed

Lines changed: 18 additions & 14 deletions

File tree

libraries/AP_ExternalAHRS/AP_ExternalAHRS.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ void AP_ExternalAHRS::init(void)
138138
#endif // AP_EXTERNAL_AHRS_SBG_ENABLED
139139

140140
}
141-
141+
142142
GCS_SEND_TEXT(MAV_SEVERITY_INFO, "Unsupported ExternalAHRS type %u", unsigned(devtype));
143143
}
144144

libraries/AP_ExternalAHRS/AP_ExternalAHRS.h

Lines changed: 8 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 class 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 = TempCal::IsNotTempCalibrated;
165172
} ins_data_message_t;
166173

167174
typedef struct {

libraries/AP_ExternalAHRS/AP_ExternalAHRS_MicroStrain5.cpp

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -124,11 +124,10 @@ void AP_ExternalAHRS_MicroStrain5::post_imu() const
124124
}
125125

126126
{
127-
AP_ExternalAHRS::ins_data_message_t ins {
128-
accel: imu_data.accel,
129-
gyro: imu_data.gyro,
130-
temperature: -300
131-
};
127+
AP_ExternalAHRS::ins_data_message_t ins;
128+
ins.accel = imu_data.accel;
129+
ins.gyro = imu_data.gyro;
130+
ins.temperature= -300;
132131
AP::ins().handle_external(ins);
133132
}
134133

libraries/AP_ExternalAHRS/AP_ExternalAHRS_MicroStrain7.cpp

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -152,13 +152,11 @@ void AP_ExternalAHRS_MicroStrain7::post_imu() const
152152
}
153153

154154
{
155-
// *INDENT-OFF*
156-
AP_ExternalAHRS::ins_data_message_t ins {
157-
accel: imu_data.accel,
158-
gyro: imu_data.gyro,
159-
temperature: -300
160-
};
161-
// *INDENT-ON*
155+
AP_ExternalAHRS::ins_data_message_t ins;
156+
ins.accel = imu_data.accel;
157+
ins.gyro = imu_data.gyro;
158+
ins.temperature= -300;
159+
ins.TempCalibration = AP_ExternalAHRS::TempCal::IsTempCalibrated;
162160
AP::ins().handle_external(ins);
163161
}
164162

0 commit comments

Comments
 (0)