mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-05-18 05:07:35 +08:00
Random style fixes in the code
This commit is contained in:
committed by
Mathieu Bresciani
parent
5d6a72e383
commit
aa96fa6d9e
@@ -367,6 +367,7 @@ void EstimatorInterface::setOpticalFlowData(const flowSample& flow)
|
|||||||
// when there are other aiding sources available
|
// when there are other aiding sources available
|
||||||
const float flow_rate_magnitude = flow.flow_xy_rad.norm() / delta_time;
|
const float flow_rate_magnitude = flow.flow_xy_rad.norm() / delta_time;
|
||||||
flow_magnitude_good = (flow_rate_magnitude <= _flow_max_rate);
|
flow_magnitude_good = (flow_rate_magnitude <= _flow_max_rate);
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
// protect against overflow caused by division with very small delta_time
|
// protect against overflow caused by division with very small delta_time
|
||||||
delta_time = delta_time_min;
|
delta_time = delta_time_min;
|
||||||
|
|||||||
@@ -45,6 +45,7 @@ bool ImuDownSampler::update(const imuSample &imu_sample_new) {
|
|||||||
return true;
|
return true;
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -179,7 +179,7 @@ void Ekf::fuseFlowForTerrain()
|
|||||||
// calculate optical LOS rates using optical flow rates that have had the body angular rate contribution removed
|
// calculate optical LOS rates using optical flow rates that have had the body angular rate contribution removed
|
||||||
// correct for gyro bias errors in the data used to do the motion compensation
|
// correct for gyro bias errors in the data used to do the motion compensation
|
||||||
// Note the sign convention used: A positive LOS rate is a RH rotation of the scene about that axis.
|
// Note the sign convention used: A positive LOS rate is a RH rotation of the scene about that axis.
|
||||||
const Vector2f opt_flow_rate = Vector2f{_flow_compensated_XY_rad} / _flow_sample_delayed.dt + Vector2f{_flow_gyro_bias};
|
const Vector2f opt_flow_rate = Vector2f(_flow_compensated_XY_rad) / _flow_sample_delayed.dt + Vector2f(_flow_gyro_bias);
|
||||||
|
|
||||||
// get latest estimated orientation
|
// get latest estimated orientation
|
||||||
const float q0 = _state.quat_nominal(0);
|
const float q0 = _state.quat_nominal(0);
|
||||||
|
|||||||
@@ -130,6 +130,7 @@ bool Ekf::fuseVerticalPosition(const Vector3f &innov, const Vector2f &innov_gate
|
|||||||
fuseVelPosHeight(innov(2), innov_var(2), 5);
|
fuseVelPosHeight(innov(2), innov_var(2), 5);
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
_innov_check_fail_status.flags.reject_ver_pos = true;
|
_innov_check_fail_status.flags.reject_ver_pos = true;
|
||||||
return false;
|
return false;
|
||||||
|
|||||||
Reference in New Issue
Block a user