Skip to content

Commit f35e333

Browse files
RomanAndreasAntener
authored andcommitted
- only use takeoff strategy when in auto mode
- after jumped takeoff set previous vel setpoint such that thrust setpoint is continuous
1 parent f2af8a5 commit f35e333

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/modules/mc_pos_control/mc_pos_control_main.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1377,7 +1377,7 @@ MulticopterPositionControl::task_main()
13771377
// into an integral part and into a P part
13781378
thrust_int(2) = _takeoff_thrust_sp - _params.vel_p(2) * fabsf(_vel(2));
13791379
thrust_int(2) = -math::constrain(thrust_int(2), _params.thr_min, _params.thr_max);
1380-
_vel_sp_prev(2) = _vel(2);
1380+
_vel_sp_prev(2) = -_params.tko_speed;
13811381
_takeoff_jumped = true;
13821382
reset_int_z = false;
13831383
}
@@ -1472,7 +1472,7 @@ MulticopterPositionControl::task_main()
14721472
math::Vector<3> thrust_sp = vel_err.emult(_params.vel_p) + _vel_err_d.emult(_params.vel_d) + thrust_int;
14731473

14741474
if (_pos_sp_triplet.current.type == position_setpoint_s::SETPOINT_TYPE_TAKEOFF
1475-
&& !_takeoff_jumped) {
1475+
&& !_takeoff_jumped && !_control_mode.flag_control_manual_enabled) {
14761476
// for jumped takeoffs use special thrust setpoint calculated above
14771477
thrust_sp.zero();
14781478
thrust_sp(2) = -_takeoff_thrust_sp;

0 commit comments

Comments
 (0)