Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FwPositionControl: don't do takeoff help for vtol #10048

Merged
merged 1 commit into from
Apr 30, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
24 changes: 13 additions & 11 deletions src/modules/fw_pos_control_l1/FixedwingPositionControl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand All @@ -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;
}
}

Expand Down Expand Up @@ -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 */
Expand Down Expand Up @@ -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 */
Expand Down