From d4b047fc1f326c917bee1c60e142c35719e9d27d Mon Sep 17 00:00:00 2001 From: Randy Mackay Date: Thu, 5 Sep 2019 13:11:35 +0900 Subject: [PATCH] SITL: Gripper_EPM compiler warning resolved by using float and fabsf --- libraries/SITL/SIM_Gripper_EPM.cpp | 2 +- libraries/SITL/SIM_Gripper_EPM.h | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) 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