mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-27 01:53:35 +08:00
FlightTask: add distance to bottom
This commit is contained in:
committed by
Lorenz Meier
parent
1759e181dc
commit
73b4f452cc
@@ -59,6 +59,12 @@ bool FlightTask::_evaluateVehicleLocalPosition()
|
|||||||
_position = matrix::Vector3f(&_sub_vehicle_local_position->get().x);
|
_position = matrix::Vector3f(&_sub_vehicle_local_position->get().x);
|
||||||
_velocity = matrix::Vector3f(&_sub_vehicle_local_position->get().vx);
|
_velocity = matrix::Vector3f(&_sub_vehicle_local_position->get().vx);
|
||||||
_yaw = _sub_vehicle_local_position->get().yaw;
|
_yaw = _sub_vehicle_local_position->get().yaw;
|
||||||
|
_dist_to_bottom = NAN;
|
||||||
|
|
||||||
|
if (_sub_vehicle_local_position->get().dist_bottom_valid) {
|
||||||
|
_dist_to_bottom = _sub_vehicle_local_position->get().dist_bottom;
|
||||||
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@@ -126,6 +126,7 @@ protected:
|
|||||||
matrix::Vector3f _thrust_setpoint;
|
matrix::Vector3f _thrust_setpoint;
|
||||||
float _yaw_setpoint;
|
float _yaw_setpoint;
|
||||||
float _yawspeed_setpoint;
|
float _yawspeed_setpoint;
|
||||||
|
float _dist_to_bottom;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get the output data
|
* Get the output data
|
||||||
|
|||||||
Reference in New Issue
Block a user