mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-27 12:53:34 +08:00
mc_att_control_main: remove unnecessary memset for _sensor_correction
This commit is contained in:
@@ -536,8 +536,7 @@ MulticopterAttitudeControl::MulticopterAttitudeControl() :
|
|||||||
_ts_opt_recovery = new TailsitterRecovery();
|
_ts_opt_recovery = new TailsitterRecovery();
|
||||||
}
|
}
|
||||||
|
|
||||||
/* initialize thermal corrections as we might not immediately get a topic update */
|
/* initialize thermal corrections as we might not immediately get a topic update (only non-zero values) */
|
||||||
memset(&_sensor_correction, 0, sizeof(_sensor_correction));
|
|
||||||
for (unsigned i = 0; i < 3; i++) {
|
for (unsigned i = 0; i < 3; i++) {
|
||||||
// used scale factors to unity
|
// used scale factors to unity
|
||||||
_sensor_correction.gyro_scale_0[i] = 1.0f;
|
_sensor_correction.gyro_scale_0[i] = 1.0f;
|
||||||
@@ -1007,6 +1006,7 @@ MulticopterAttitudeControl::control_attitude_rates(float dt)
|
|||||||
rates(0) = (_sensor_gyro.x - _sensor_correction.gyro_offset_2[0]) * _sensor_correction.gyro_scale_2[0];
|
rates(0) = (_sensor_gyro.x - _sensor_correction.gyro_offset_2[0]) * _sensor_correction.gyro_scale_2[0];
|
||||||
rates(1) = (_sensor_gyro.x - _sensor_correction.gyro_offset_2[1]) * _sensor_correction.gyro_scale_2[1];
|
rates(1) = (_sensor_gyro.x - _sensor_correction.gyro_offset_2[1]) * _sensor_correction.gyro_scale_2[1];
|
||||||
rates(2) = (_sensor_gyro.x - _sensor_correction.gyro_offset_2[2]) * _sensor_correction.gyro_scale_2[2];
|
rates(2) = (_sensor_gyro.x - _sensor_correction.gyro_offset_2[2]) * _sensor_correction.gyro_scale_2[2];
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
rates(0) = _sensor_gyro.x;
|
rates(0) = _sensor_gyro.x;
|
||||||
rates(1) = _sensor_gyro.y;
|
rates(1) = _sensor_gyro.y;
|
||||||
|
|||||||
Reference in New Issue
Block a user