SITL: Gripper_EPM compiler warning resolved by using float and fabsf

This commit is contained in:
Randy Mackay 2019-09-05 13:11:35 +09:00 committed by Andrew Tridgell
parent 1fd7618238
commit d4b047fc1f
2 changed files with 3 additions and 3 deletions

View File

@ -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;
}

View File

@ -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