Plane: use abs() instead of labs() for int16

This commit is contained in:
Tom Pittenger 2017-01-30 09:48:39 -08:00 committed by Tom Pittenger
parent 2326eee9a0
commit 9abb0bba7f

View File

@ -1031,7 +1031,7 @@ bool Plane::verify_loiter_heading(bool init)
return true;
}
if (get_distance(next_WP_loc, next_nav_cmd.content.location) < labs(aparm.loiter_radius)) {
if (get_distance(next_WP_loc, next_nav_cmd.content.location) < abs(aparm.loiter_radius)) {
/* Whenever next waypoint is within the loiter radius,
maintaining loiter would prevent us from ever pointing toward the next waypoint.
Hence break out of loiter immediately