mirror of
https://gitee.com/xiaohuolufeihua/bizhang_-obav.git
synced 2026-05-21 09:22:18 +00:00
FlightTask: use centralized _dist_to_ground computed in FlightTask instead of
recomputing it in AutoMapper, AutoMapper2 and AutoLine
This commit is contained in:
@@ -164,9 +164,9 @@ void FlightTask::_evaluateVehicleLocalPosition()
|
||||
|
||||
void FlightTask::_evaluateDistanceToGround()
|
||||
{
|
||||
_dist_to_ground = NAN;
|
||||
// Altitude above ground is by default just the negation of the current local position in D-direction.
|
||||
_dist_to_ground = -_position(2);
|
||||
|
||||
// if there is a valid distance to bottom or vertical distance to home
|
||||
if (PX4_ISFINITE(_dist_to_bottom)) {
|
||||
_dist_to_ground = _dist_to_bottom;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user