Skip to content

Commit

Permalink
mc_pos_control: takeoff speed to new param type
Browse files Browse the repository at this point in the history
  • Loading branch information
Dennis Mannhart committed Apr 11, 2018
1 parent 04017ea commit 170f6b2
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/modules/mc_pos_control/mc_pos_control_main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3095,7 +3095,7 @@ MulticopterPositionControl::task_main()
// Adjust for different takeoff cases.
// The minimum takeoff altitude needs to be at least 20cm above current position
if ((PX4_ISFINITE(setpoint.z) && setpoint.z < _pos(2) - 0.2f) ||
(PX4_ISFINITE(setpoint.vz) && setpoint.vz < math::min(-_params.tko_speed, -0.6f))) {
(PX4_ISFINITE(setpoint.vz) && setpoint.vz < math::min(-_tko_speed.get(), -0.6f))) {
// There is a position setpoint above current position or velocity setpoint larger than
// takeoff speed. Enable smooth takeoff.
_in_smooth_takeoff = true;
Expand All @@ -3116,7 +3116,7 @@ MulticopterPositionControl::task_main()

// If there is a valid position setpoint, then set the desired speed to the takeoff speed.
if (PX4_ISFINITE(setpoint.z)) {
desired_tko_speed = _params.tko_speed;
desired_tko_speed = _tko_speed.get();
}

// Ramp up takeoff speed.
Expand Down

0 comments on commit 170f6b2

Please sign in to comment.