diff --git a/libraries/SITL/SIM_Gripper_EPM.cpp b/libraries/SITL/SIM_Gripper_EPM.cpp index 0f9872288a..e741141fc2 100644 --- a/libraries/SITL/SIM_Gripper_EPM.cpp +++ b/libraries/SITL/SIM_Gripper_EPM.cpp @@ -107,7 +107,7 @@ bool Gripper_EPM::should_report() return false; } - if (abs(reported_field_strength - field_strength) > 10.0) { + if (fabsf(reported_field_strength - field_strength) > 10.0) { return true; } diff --git a/libraries/SITL/SIM_Gripper_EPM.h b/libraries/SITL/SIM_Gripper_EPM.h index e019f9f53f..d8d030de90 100644 --- a/libraries/SITL/SIM_Gripper_EPM.h +++ b/libraries/SITL/SIM_Gripper_EPM.h @@ -48,8 +48,8 @@ private: bool servo_based = true; - double field_strength; // percentage - double reported_field_strength = -1; // unlikely + float field_strength; // percentage + float reported_field_strength = -1; // unlikely // I've a feeling these are probably a higher order than this: const float field_strength_slew_rate = 400; // (percentage of delta between field strength and 100)/second