mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-04-14 10:07:39 +08:00
mission_base: if FW and takeoff do not enter climb before mission start
For FW takeoffs we need to keep the course straight towards the first waypoint, and not climb in loiter patterns first. Signed-off-by: Silvan Fuhrer <silvan@auterion.com>
This commit is contained in:
parent
169ff6ccb0
commit
abfd00aeb9
@ -1213,7 +1213,11 @@ void MissionBase::checkClimbRequired(int32_t mission_item_index)
|
||||
const bool success = _dataman_cache.loadWait(dataman_id, next_mission_item_index, reinterpret_cast<uint8_t *>(&mission),
|
||||
sizeof(mission), MAX_DATAMAN_LOAD_WAIT);
|
||||
|
||||
if (success) {
|
||||
const bool is_fw_and_takeoff = mission.nav_cmd == NAV_CMD_TAKEOFF
|
||||
&& _vehicle_status_sub.get().vehicle_type == vehicle_status_s::VEHICLE_TYPE_FIXED_WING;
|
||||
|
||||
// for FW when on a Takeoff item do not require climb before mission, as we need to keep course to takeoff item straight
|
||||
if (success && !is_fw_and_takeoff) {
|
||||
const float altitude_amsl_next_position_item = MissionBlock::get_absolute_altitude_for_item(mission);
|
||||
const float error_below_setpoint = altitude_amsl_next_position_item -
|
||||
_navigator->get_global_position()->alt;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user