Use backwards compatible manual_control_setpoint instead of manual_control_input

This commit is contained in:
Matthias Grob
2021-11-09 16:05:25 +01:00
parent 423aadcc4f
commit fabf865411
30 changed files with 252 additions and 208 deletions
@@ -51,11 +51,11 @@ bool Sticks::checkAndSetStickInputs()
if (_manual_control_setpoint_sub.update(&manual_control_setpoint)) {
// Linear scale
_positions(0) = manual_control_setpoint.chosen_input.x; // NED x, pitch [-1,1]
_positions(1) = manual_control_setpoint.chosen_input.y; // NED y, roll [-1,1]
_positions(2) = -(math::constrain(manual_control_setpoint.chosen_input.z, 0.0f,
_positions(0) = manual_control_setpoint.x; // NED x, pitch [-1,1]
_positions(1) = manual_control_setpoint.y; // NED y, roll [-1,1]
_positions(2) = -(math::constrain(manual_control_setpoint.z, 0.0f,
1.0f) - 0.5f) * 2.f; // NED z, thrust resacaled from [0,1] to [-1,1]
_positions(3) = manual_control_setpoint.chosen_input.r; // yaw [-1,1]
_positions(3) = manual_control_setpoint.r; // yaw [-1,1]
// Exponential scale
_positions_expo(0) = math::expo_deadzone(_positions(0), _param_mpc_xy_man_expo.get(), _param_mpc_hold_dz.get());