Sub: Simplify return logic

Signed-off-by: Patrick José Pereira <patrickelectric@gmail.com>
This commit is contained in:
Patrick José Pereira 2018-06-11 10:58:36 -03:00 committed by Francisco Ferreira
parent 87c09f98cc
commit cbef5db174

View File

@ -789,11 +789,7 @@ bool Sub::verify_yaw()
}
// check if we are within 2 degrees of the target heading
if (labs(wrap_180_cd(ahrs.yaw_sensor-yaw_look_at_heading)) <= 200) {
return true;
} else {
return false;
}
return (labsf(wrap_180_cd(ahrs.yaw_sensor-yaw_look_at_heading)) <= 200);
}
/********************************************************************************/