mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-21 05:53:34 +08:00
manual_control: update first, get diff after
Not sure why I had this the wrong way round.
This commit is contained in:
committed by
Matthias Grob
parent
d0fea93d72
commit
2a41ade223
@@ -144,6 +144,11 @@ void ManualControl::Run()
|
|||||||
_previous_disarm_gesture = false;
|
_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
|
// user wants override
|
||||||
const float minimum_stick_change = 0.01f * _param_com_rc_stick_ov.get();
|
const float minimum_stick_change = 0.01f * _param_com_rc_stick_ov.get();
|
||||||
|
|
||||||
@@ -156,11 +161,6 @@ void ManualControl::Run()
|
|||||||
|
|
||||||
_selector.setpoint().user_override = rpy_moved || throttle_moved;
|
_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) {
|
if (switches_updated) {
|
||||||
// Only use switches if current source is RC as well.
|
// Only use switches if current source is RC as well.
|
||||||
if (_selector.setpoint().chosen_input.data_source == manual_control_input_s::SOURCE_RC) {
|
if (_selector.setpoint().chosen_input.data_source == manual_control_input_s::SOURCE_RC) {
|
||||||
|
|||||||
Reference in New Issue
Block a user