Plane: Use sq() rather than powf() in soaring.cpp.
This commit is contained in:
parent
b2d63c5049
commit
aa776b06a4
@ -74,7 +74,7 @@ void Plane::update_soaring() {
|
||||
|
||||
// Check distance to home against MAX_RADIUS.
|
||||
if (g2.soaring_controller.max_radius >= 0 &&
|
||||
powf(position.x,2)+powf(position.y,2) > powf(g2.soaring_controller.max_radius,2) &&
|
||||
sq(position.x)+sq(position.y) > sq(g2.soaring_controller.max_radius) &&
|
||||
previous_mode->mode_number()!=Mode::Number::AUTO) {
|
||||
// Some other loiter status, and outside of maximum soaring radius, and previous mode wasn't AUTO
|
||||
gcs().send_text(MAV_SEVERITY_INFO, "Soaring: Outside SOAR_MAX_RADIUS, RTL");
|
||||
|
Loading…
Reference in New Issue
Block a user