mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-19 15:13:33 +08:00
calibration_routines: use PX4_ISFINITE() instead of isnan()
This commit is contained in:
@@ -372,7 +372,7 @@ int run_lm_sphere_fit(const float x[], const float y[], const float z[], float &
|
|||||||
|
|
||||||
//--------------------Levenberg-Marquardt-part-ends-here--------------------------------//
|
//--------------------Levenberg-Marquardt-part-ends-here--------------------------------//
|
||||||
|
|
||||||
if (!isnan(fitness) && fitness < _fitness) {
|
if (PX4_ISFINITE(fitness) && fitness < _fitness) {
|
||||||
_fitness = fitness;
|
_fitness = fitness;
|
||||||
*sphere_radius = fit1_params[0];
|
*sphere_radius = fit1_params[0];
|
||||||
*offset_x = fit1_params[1];
|
*offset_x = fit1_params[1];
|
||||||
@@ -507,7 +507,7 @@ int run_lm_ellipsoid_fit(const float x[], const float y[], const float z[], floa
|
|||||||
}
|
}
|
||||||
|
|
||||||
//--------------------Levenberg-Marquardt-part-ends-here--------------------------------//
|
//--------------------Levenberg-Marquardt-part-ends-here--------------------------------//
|
||||||
if (!isnan(fitness) && fitness < _fitness) {
|
if (PX4_ISFINITE(fitness) && fitness < _fitness) {
|
||||||
_fitness = fitness;
|
_fitness = fitness;
|
||||||
*offset_x = fit1_params[0];
|
*offset_x = fit1_params[0];
|
||||||
*offset_y = fit1_params[1];
|
*offset_y = fit1_params[1];
|
||||||
|
|||||||
Reference in New Issue
Block a user