Skip to content

Commit

Permalink
- only use takeoff strategy when in auto mode
Browse files Browse the repository at this point in the history
- after jumped takeoff set previous vel setpoint such
that thrust setpoint is continuous
  • Loading branch information
Roman authored and AndreasAntener committed Jan 27, 2016
1 parent f2af8a5 commit f35e333
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 @@ -1377,7 +1377,7 @@ MulticopterPositionControl::task_main()
// into an integral part and into a P part
thrust_int(2) = _takeoff_thrust_sp - _params.vel_p(2) * fabsf(_vel(2));
thrust_int(2) = -math::constrain(thrust_int(2), _params.thr_min, _params.thr_max);
_vel_sp_prev(2) = _vel(2);
_vel_sp_prev(2) = -_params.tko_speed;
_takeoff_jumped = true;
reset_int_z = false;
}
Expand Down Expand Up @@ -1472,7 +1472,7 @@ MulticopterPositionControl::task_main()
math::Vector<3> thrust_sp = vel_err.emult(_params.vel_p) + _vel_err_d.emult(_params.vel_d) + thrust_int;

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

0 comments on commit f35e333

Please sign in to comment.