Browse Source

manual_control: update first, get diff after

Not sure why I had this the wrong way round.
master
Julian Oes 4 years ago committed by Matthias Grob
parent
commit
2a41ade223
  1. 10
      src/modules/manual_control/ManualControl.cpp

10
src/modules/manual_control/ManualControl.cpp

@ -144,6 +144,11 @@ void ManualControl::Run() @@ -144,6 +144,11 @@ void ManualControl::Run()
_previous_disarm_gesture = false;
}
_x_diff.update(_selector.setpoint().chosen_input.x, dt_s);
_y_diff.update(_selector.setpoint().chosen_input.y, dt_s);
_z_diff.update(_selector.setpoint().chosen_input.z, dt_s);
_r_diff.update(_selector.setpoint().chosen_input.r, dt_s);
// user wants override
const float minimum_stick_change = 0.01f * _param_com_rc_stick_ov.get();
@ -156,11 +161,6 @@ void ManualControl::Run() @@ -156,11 +161,6 @@ void ManualControl::Run()
_selector.setpoint().user_override = rpy_moved || throttle_moved;
_x_diff.update(_selector.setpoint().chosen_input.x, dt_s);
_y_diff.update(_selector.setpoint().chosen_input.y, dt_s);
_z_diff.update(_selector.setpoint().chosen_input.z, dt_s);
_r_diff.update(_selector.setpoint().chosen_input.r, dt_s);
if (switches_updated) {
// Only use switches if current source is RC as well.
if (_selector.setpoint().chosen_input.data_source == manual_control_input_s::SOURCE_RC) {

Loading…
Cancel
Save