Browse Source

mc_pos_control: smooth takeoff, fixed gradient of the velocity ramp by takeoff speed parameter

because we need a workaround for the broken auto takeoff logic which can start the vehicle with a loiter setpoint
in this case the very first moment is still a jump but then it gets taken over by the fix gradient ramp
this can basically be reverted after the auto takeoff logic is fixed
sbg
Matthias Grob 8 years ago
parent
commit
0c4719de3e
  1. 2
      src/modules/mc_pos_control/mc_pos_control_main.cpp

2
src/modules/mc_pos_control/mc_pos_control_main.cpp

@ -1736,7 +1736,7 @@ MulticopterPositionControl::calculate_velocity_setpoint(float dt) @@ -1736,7 +1736,7 @@ MulticopterPositionControl::calculate_velocity_setpoint(float dt)
if (_in_takeoff) {
_in_takeoff = _takeoff_vel_limit < -_vel_sp(2);
/* ramp vertical velocity limit up to takeoff speed */
_takeoff_vel_limit += -_vel_sp(2) * dt / _takeoff_ramp_time.get();
_takeoff_vel_limit += _params.tko_speed * dt / _takeoff_ramp_time.get();
/* limit vertical velocity to the current ramp value */
_vel_sp(2) = math::max(_vel_sp(2), -_takeoff_vel_limit);
}

Loading…
Cancel
Save