mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-07-12 19:30:35 +08:00
Use isAllFinite() in all places that check finiteness on entire vectors or matrices
This commit is contained in:
@@ -213,12 +213,12 @@ void OutputBase::_calculate_angle_output(const hrt_abstime &t)
|
||||
|
||||
float dt = math::constrain((t - _last_update) * 1.e-6f, 0.001f, 1.f);
|
||||
|
||||
const bool q_setpoint_valid = PX4_ISFINITE(_q_setpoint[0]) && PX4_ISFINITE(_q_setpoint[1])
|
||||
&& PX4_ISFINITE(_q_setpoint[2]) && PX4_ISFINITE(_q_setpoint[3]);
|
||||
const matrix::Quatf q_setpoint(_q_setpoint);
|
||||
const bool q_setpoint_valid = q_setpoint.isAllFinite();
|
||||
matrix::Eulerf euler_gimbal{};
|
||||
|
||||
if (q_setpoint_valid) {
|
||||
euler_gimbal = matrix::Quatf{_q_setpoint};
|
||||
euler_gimbal = q_setpoint;
|
||||
}
|
||||
|
||||
for (int i = 0; i < 3; ++i) {
|
||||
|
||||
Reference in New Issue
Block a user