mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-07-05 05:00:34 +08:00
FlightTaskAuto: always update cruise speed
This commit is contained in:
committed by
Lorenz Meier
parent
3083de0979
commit
37bfd8e01a
@@ -93,6 +93,14 @@ bool FlightTaskAuto::_evaluateTriplets()
|
||||
return false;
|
||||
}
|
||||
|
||||
/* Always update cruise speed since that can change without waypoint changes */
|
||||
_mc_cruise_speed = _sub_triplet_setpoint->get().current.cruising_speed;
|
||||
|
||||
if (!PX4_ISFINITE(_mc_cruise_speed) || (_mc_cruise_speed < 0.0f)) {
|
||||
/* Use default */
|
||||
_mc_cruise_speed = _mc_cruise_default.get();
|
||||
}
|
||||
|
||||
/* Get target waypoint. */
|
||||
matrix::Vector3f target;
|
||||
map_projection_project(&_reference_position,
|
||||
@@ -133,13 +141,6 @@ bool FlightTaskAuto::_evaluateTriplets()
|
||||
|
||||
}
|
||||
|
||||
_mc_cruise_speed = _sub_triplet_setpoint->get().current.cruising_speed;
|
||||
|
||||
if (!PX4_ISFINITE(_mc_cruise_speed) || (_mc_cruise_speed < 0.0f)) {
|
||||
/* Use default */
|
||||
_mc_cruise_speed = _mc_cruise_default.get();
|
||||
}
|
||||
|
||||
_type = (WaypointType)_sub_triplet_setpoint->get().current.type;
|
||||
|
||||
_prev_prev_wp = _prev_wp; // previous -1 is set to previsou
|
||||
|
||||
Reference in New Issue
Block a user