mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-15 18:23:34 +08:00
FlightTask: split _evalutateVehiclePosition into _evaluateVehicleLocalPosition
and _evaluateVehicleGlobalPosition
This commit is contained in:
committed by
Lorenz Meier
parent
913932ff9e
commit
b7f729e432
@@ -28,7 +28,7 @@ bool FlightTask::updateInitialize()
|
||||
_time = (_time_stamp_current - _time_stamp_activate) / 1e6f;
|
||||
_deltatime = math::min((_time_stamp_current - _time_stamp_last), _timeout) / 1e6f;
|
||||
_time_stamp_last = _time_stamp_current;
|
||||
return _evaluateVehiclePosition();
|
||||
return _evaluateVehicleLocalPosition();
|
||||
}
|
||||
|
||||
const vehicle_local_position_setpoint_s FlightTask::getPositionSetpoint()
|
||||
@@ -54,7 +54,7 @@ void FlightTask::_resetSetpoints()
|
||||
_yaw_setpoint = _yawspeed_setpoint = NAN;
|
||||
}
|
||||
|
||||
bool FlightTask::_evaluateVehiclePosition()
|
||||
bool FlightTask::_evaluateVehicleLocalPosition()
|
||||
{
|
||||
if ((_time_stamp_current - _sub_vehicle_local_position->get().timestamp) < _timeout) {
|
||||
_position = matrix::Vector3f(&_sub_vehicle_local_position->get().x);
|
||||
|
||||
@@ -139,5 +139,5 @@ protected:
|
||||
*/
|
||||
uORB::Subscription<vehicle_local_position_s> *_sub_vehicle_local_position{nullptr};
|
||||
|
||||
virtual bool _evaluateVehiclePosition();
|
||||
bool _evaluateVehicleLocalPosition();
|
||||
};
|
||||
|
||||
@@ -174,9 +174,9 @@ bool FlightTaskAuto::_isFinite(const position_setpoint_s sp)
|
||||
return (PX4_ISFINITE(sp.lat) && PX4_ISFINITE(sp.lon) && PX4_ISFINITE(sp.alt));
|
||||
}
|
||||
|
||||
bool FlightTaskAuto::_evaluateVehiclePosition()
|
||||
bool FlightTaskAuto::_evaluateVehicleGlobalPosition()
|
||||
{
|
||||
FlightTask::_evaluateVehiclePosition();
|
||||
FlightTask::_evaluateVehicleLocalPosition();
|
||||
|
||||
/* Check if reference has changed and update. */
|
||||
if (_sub_vehicle_local_position->get().ref_timestamp != _time_stamp_reference) {
|
||||
|
||||
@@ -91,5 +91,5 @@ private:
|
||||
bool _isFinite(const position_setpoint_s sp);
|
||||
void _updateReference();
|
||||
|
||||
bool _evaluateVehiclePosition() override; /**< Required for reference update */
|
||||
bool _evaluateVehicleGlobalPosition(); /**< Required for reference update */
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user