mirror of
https://github.com/PX4/PX4-Autopilot.git
synced 2026-05-28 19:32:36 +08:00
ft altitude: use longerThan to save a sqrt operation
This commit is contained in:
@@ -352,7 +352,7 @@ void FlightTaskManualAltitude::_updateSetpoints()
|
|||||||
sp = _man_input_filter.getState();
|
sp = _man_input_filter.getState();
|
||||||
_rotateIntoHeadingFrame(sp);
|
_rotateIntoHeadingFrame(sp);
|
||||||
|
|
||||||
if (sp.length() > 1.0f) {
|
if (sp.longerThan(1.0f)) {
|
||||||
sp.normalize();
|
sp.normalize();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user