diff --git a/src/modules/fw_pos_control_l1/FixedwingPositionControl.cpp b/src/modules/fw_pos_control_l1/FixedwingPositionControl.cpp index 6c5763bab478a215295696269b006d9ba70fcf27..6b1709ae46ebeb3d806c12c3b1d129a0639b39c3 100644 --- a/src/modules/fw_pos_control_l1/FixedwingPositionControl.cpp +++ b/src/modules/fw_pos_control_l1/FixedwingPositionControl.cpp @@ -783,6 +783,11 @@ FixedwingPositionControl::update_desired_altitude(float dt) bool FixedwingPositionControl::in_takeoff_situation() { + // a VTOL does not need special takeoff handling + if (_vehicle_status.is_vtol) { + return false; + } + // in air for < 10s const hrt_abstime delta_takeoff = 10_s; @@ -797,9 +802,6 @@ FixedwingPositionControl::do_takeoff_help(float *hold_altitude, float *pitch_lim if (in_takeoff_situation()) { *hold_altitude = _takeoff_ground_alt + _parameters.climbout_diff; *pitch_limit_min = radians(10.0f); - - } else { - *pitch_limit_min = _parameters.pitch_limit_min; } } @@ -1041,10 +1043,10 @@ FixedwingPositionControl::control_position(const Vector2f &curr_pos, const Vecto /* update desired altitude based on user pitch stick input */ bool climbout_requested = update_desired_altitude(dt); - /* if we assume that user is taking off then help by demanding altitude setpoint well above ground - * and set limit to pitch angle to prevent stearing into ground - */ - float pitch_limit_min{0.0f}; + // if we assume that user is taking off then help by demanding altitude setpoint well above ground + // and set limit to pitch angle to prevent steering into ground + // this will only affect planes and not VTOL + float pitch_limit_min = _parameters.pitch_limit_min; do_takeoff_help(&_hold_alt, &pitch_limit_min); /* throttle limiting */ @@ -1143,10 +1145,10 @@ FixedwingPositionControl::control_position(const Vector2f &curr_pos, const Vecto /* update desired altitude based on user pitch stick input */ bool climbout_requested = update_desired_altitude(dt); - /* if we assume that user is taking off then help by demanding altitude setpoint well above ground - * and set limit to pitch angle to prevent stearing into ground - */ - float pitch_limit_min{0.0f}; + // if we assume that user is taking off then help by demanding altitude setpoint well above ground + // and set limit to pitch angle to prevent steering into ground + // this will only affect planes and not VTOL + float pitch_limit_min = _parameters.pitch_limit_min; do_takeoff_help(&_hold_alt, &pitch_limit_min); /* throttle limiting */