gyro calibration: remove unused scale parameters

This commit is contained in:
Beat Küng
2019-11-29 11:28:17 -05:00
committed by Daniel Agar
parent 4ca5770f36
commit 5ff83ef740
15 changed files with 16 additions and 244 deletions
+2 -30
View File
@@ -217,14 +217,7 @@ int do_gyro_calibration(orb_advert_t *mavlink_log_pub)
worker_data.mavlink_log_pub = mavlink_log_pub;
struct gyro_calibration_s gyro_scale_zero;
gyro_scale_zero.x_offset = 0.0f;
gyro_scale_zero.x_scale = 1.0f;
gyro_scale_zero.y_offset = 0.0f;
gyro_scale_zero.y_scale = 1.0f;
gyro_scale_zero.z_offset = 0.0f;
gyro_scale_zero.z_scale = 1.0f;
gyro_calibration_s gyro_scale_zero{};
int device_prio_max = 0;
int32_t device_id_primary = 0;
@@ -245,7 +238,7 @@ int do_gyro_calibration(orb_advert_t *mavlink_log_pub)
return PX4_ERROR;
}
// Reset all offsets to 0 and scales to 1
// Reset all offsets to 0
(void)memcpy(&worker_data.gyro_scale[s], &gyro_scale_zero, sizeof(gyro_scale_zero));
#ifdef __PX4_NUTTX
sprintf(str, "%s%u", GYRO_BASE_DEVICE_PATH, s);
@@ -284,27 +277,6 @@ int do_gyro_calibration(orb_advert_t *mavlink_log_pub)
PX4_ERR("unable to reset %s", str);
}
(void)sprintf(str, "CAL_GYRO%u_XSCALE", s);
res = param_set_no_notification(param_find(str), &gyro_scale_zero.x_scale);
if (res != PX4_OK) {
PX4_ERR("unable to reset %s", str);
}
(void)sprintf(str, "CAL_GYRO%u_YSCALE", s);
res = param_set_no_notification(param_find(str), &gyro_scale_zero.y_scale);
if (res != PX4_OK) {
PX4_ERR("unable to reset %s", str);
}
(void)sprintf(str, "CAL_GYRO%u_ZSCALE", s);
res = param_set_no_notification(param_find(str), &gyro_scale_zero.z_scale);
if (res != PX4_OK) {
PX4_ERR("unable to reset %s", str);
}
param_notify_changes();
#endif
@@ -60,15 +60,11 @@ void TemperatureCalibrationGyro::reset_calibration()
{
/* reset all driver level calibrations */
float offset = 0.0f;
float scale = 1.0f;
for (unsigned s = 0; s < 3; s++) {
set_parameter("CAL_GYRO%u_XOFF", s, &offset);
set_parameter("CAL_GYRO%u_YOFF", s, &offset);
set_parameter("CAL_GYRO%u_ZOFF", s, &offset);
set_parameter("CAL_GYRO%u_XSCALE", s, &scale);
set_parameter("CAL_GYRO%u_YSCALE", s, &scale);
set_parameter("CAL_GYRO%u_ZSCALE", s, &scale);
}
}
-23
View File
@@ -72,26 +72,3 @@ PARAM_DEFINE_FLOAT(CAL_GYRO0_YOFF, 0.0f);
*/
PARAM_DEFINE_FLOAT(CAL_GYRO0_ZOFF, 0.0f);
/**
* Gyro X-axis scaling factor
*
* @category system
* @group Sensor Calibration
*/
PARAM_DEFINE_FLOAT(CAL_GYRO0_XSCALE, 1.0f);
/**
* Gyro Y-axis scaling factor
*
* @category system
* @group Sensor Calibration
*/
PARAM_DEFINE_FLOAT(CAL_GYRO0_YSCALE, 1.0f);
/**
* Gyro Z-axis scaling factor
*
* @category system
* @group Sensor Calibration
*/
PARAM_DEFINE_FLOAT(CAL_GYRO0_ZSCALE, 1.0f);
-23
View File
@@ -72,26 +72,3 @@ PARAM_DEFINE_FLOAT(CAL_GYRO1_YOFF, 0.0f);
*/
PARAM_DEFINE_FLOAT(CAL_GYRO1_ZOFF, 0.0f);
/**
* Gyro X-axis scaling factor
*
* @category system
* @group Sensor Calibration
*/
PARAM_DEFINE_FLOAT(CAL_GYRO1_XSCALE, 1.0f);
/**
* Gyro Y-axis scaling factor
*
* @category system
* @group Sensor Calibration
*/
PARAM_DEFINE_FLOAT(CAL_GYRO1_YSCALE, 1.0f);
/**
* Gyro Z-axis scaling factor
*
* @category system
* @group Sensor Calibration
*/
PARAM_DEFINE_FLOAT(CAL_GYRO1_ZSCALE, 1.0f);
-23
View File
@@ -72,26 +72,3 @@ PARAM_DEFINE_FLOAT(CAL_GYRO2_YOFF, 0.0f);
*/
PARAM_DEFINE_FLOAT(CAL_GYRO2_ZOFF, 0.0f);
/**
* Gyro X-axis scaling factor
*
* @category system
* @group Sensor Calibration
*/
PARAM_DEFINE_FLOAT(CAL_GYRO2_XSCALE, 1.0f);
/**
* Gyro Y-axis scaling factor
*
* @category system
* @group Sensor Calibration
*/
PARAM_DEFINE_FLOAT(CAL_GYRO2_YSCALE, 1.0f);
/**
* Gyro Z-axis scaling factor
*
* @category system
* @group Sensor Calibration
*/
PARAM_DEFINE_FLOAT(CAL_GYRO2_ZSCALE, 1.0f);
@@ -265,18 +265,6 @@ void VotedSensorsUpdate::parametersUpdate()
failed = failed || (OK != param_get(param_find(str), &gscale.z_offset));
(void)sprintf(str, "CAL_GYRO%u_XSCALE", i);
failed = failed || (OK != param_get(param_find(str), &gscale.x_scale));
(void)sprintf(str, "CAL_GYRO%u_YSCALE", i);
failed = failed || (OK != param_get(param_find(str), &gscale.y_scale));
(void)sprintf(str, "CAL_GYRO%u_ZSCALE", i);
failed = failed || (OK != param_get(param_find(str), &gscale.z_scale));
if (failed) {
PX4_ERR(CAL_ERROR_APPLY_CAL_MSG, "gyro", i);