From dc58b0b9509e0c2b6ba4ecbb47f79cb430a15a37 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Sun, 17 Jan 2021 09:26:09 +1100 Subject: [PATCH] AP_InertialSensor: changes from review feedback thanks Sid! --- .../AP_InertialSensor/AP_InertialSensor.cpp | 24 +++++++++---------- .../AP_InertialSensor_tempcal.cpp | 13 +++++----- 2 files changed, 19 insertions(+), 18 deletions(-) diff --git a/libraries/AP_InertialSensor/AP_InertialSensor.cpp b/libraries/AP_InertialSensor/AP_InertialSensor.cpp index fae39e45cf..ba6c87949f 100644 --- a/libraries/AP_InertialSensor/AP_InertialSensor.cpp +++ b/libraries/AP_InertialSensor/AP_InertialSensor.cpp @@ -570,56 +570,56 @@ const AP_Param::GroupInfo AP_InertialSensor::var_info[] = { AP_SUBGROUPINFO(tcal[2], "TCAL3_", 45, AP_InertialSensor, AP_InertialSensor::TCal), #endif - // @Param: ACC_CALTEMP1 + // @Param: ACC1_CALTEMP // @DisplayName: Calibration temperature for 1st accelerometer // @Description: Temperature that the 1st accelerometer was calibrated at // @User: Advanced // @Units: degC // @Calibration: 1 - AP_GROUPINFO("ACC_CALTEMP1", 46, AP_InertialSensor, caltemp_accel[0], -100), + AP_GROUPINFO("ACC1_CALTEMP", 46, AP_InertialSensor, caltemp_accel[0], -100), - // @Param: GYR_CALTEMP1 + // @Param: GYR1_CALTEMP // @DisplayName: Calibration temperature for 1st gyroscope // @Description: Temperature that the 1st gyroscope was calibrated at // @User: Advanced // @Units: degC // @Calibration: 1 - AP_GROUPINFO("GYR_CALTEMP1", 47, AP_InertialSensor, caltemp_gyro[0], -100), + AP_GROUPINFO("GYR1_CALTEMP", 47, AP_InertialSensor, caltemp_gyro[0], -100), #if INS_MAX_INSTANCES > 1 - // @Param: ACC_CALTEMP2 + // @Param: ACC2_CALTEMP // @DisplayName: Calibration temperature for 2nd accelerometer // @Description: Temperature that the 2nd accelerometer was calibrated at // @User: Advanced // @Units: degC // @Calibration: 1 - AP_GROUPINFO("ACC_CALTEMP2", 48, AP_InertialSensor, caltemp_accel[1], -100), + AP_GROUPINFO("ACC2_CALTEMP", 48, AP_InertialSensor, caltemp_accel[1], -100), - // @Param: GYR_CALTEMP2 + // @Param: GYR2_CALTEMP // @DisplayName: Calibration temperature for 2nd gyroscope // @Description: Temperature that the 2nd gyroscope was calibrated at // @User: Advanced // @Units: degC // @Calibration: 1 - AP_GROUPINFO("GYR_CALTEMP2", 49, AP_InertialSensor, caltemp_gyro[1], -100), + AP_GROUPINFO("GYR2_CALTEMP", 49, AP_InertialSensor, caltemp_gyro[1], -100), #endif #if INS_MAX_INSTANCES > 2 - // @Param: ACC_CALTEMP3 + // @Param: ACC3_CALTEMP // @DisplayName: Calibration temperature for 3rd accelerometer // @Description: Temperature that the 3rd accelerometer was calibrated at // @User: Advanced // @Units: degC // @Calibration: 1 - AP_GROUPINFO("ACC_CALTEMP3", 50, AP_InertialSensor, caltemp_accel[2], -100), + AP_GROUPINFO("ACC3_CALTEMP", 50, AP_InertialSensor, caltemp_accel[2], -100), - // @Param: GYR_CALTEMP3 + // @Param: GYR3_CALTEMP // @DisplayName: Calibration temperature for 3rd gyroscope // @Description: Temperature that the 3rd gyroscope was calibrated at // @User: Advanced // @Units: degC // @Calibration: 1 - AP_GROUPINFO("GYR_CALTEMP3", 51, AP_InertialSensor, caltemp_gyro[2], -100), + AP_GROUPINFO("GYR3_CALTEMP", 51, AP_InertialSensor, caltemp_gyro[2], -100), #endif // @Param: TCAL_OPTIONS diff --git a/libraries/AP_InertialSensor/AP_InertialSensor_tempcal.cpp b/libraries/AP_InertialSensor/AP_InertialSensor_tempcal.cpp index b3cab406f3..246ed9ef13 100644 --- a/libraries/AP_InertialSensor/AP_InertialSensor_tempcal.cpp +++ b/libraries/AP_InertialSensor/AP_InertialSensor_tempcal.cpp @@ -286,16 +286,17 @@ void AP_InertialSensor::TCal::Learn::add_sample(const Vector3f &sample, float te const float tmid = 0.5 * (tcal.temp_max + start_temp); const float tdiff = T - tmid; - AP::logger().Write("TCLR", "TimeUS,I,Si,Temp,TDiff,X,Y,Z", - "s#------", - "F0000000", - "QBBfffff", + AP::logger().Write("TCLR", "TimeUS,I,SType,Temp,TDiff,X,Y,Z,NSamp", + "s#-------", + "F0000000-", + "QBBfffffI", AP_HAL::micros64(), instance(), si, T, tdiff, - st.sum.x, st.sum.y, st.sum.z); + st.sum.x, st.sum.y, st.sum.z, + st.sum_count); st.pfit[0].update(tdiff, st.sum.x); @@ -469,7 +470,7 @@ void AP_InertialSensor::get_persistent_params(ExpandingString &str) const str.printf("INS_ACC%sSCAL_X=%f\n", id, ascl.x); str.printf("INS_ACC%sSCAL_Y=%f\n", id, ascl.y); str.printf("INS_ACC%sSCAL_Z=%f\n", id, ascl.z); - str.printf("INS_ACC_CALTEMP%u=%.2f\n", imu, caltemp_accel[i].get()); + str.printf("INS_ACC%u_CALTEMP=%.2f\n", imu, caltemp_accel[i].get()); } } if (uint32_t(tcal_options.get()) & uint32_t(TCalOptions::PERSIST_TEMP_CAL)) {