mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-22 01:03:35 +08:00
Use backwards compatible manual_control_setpoint instead of manual_control_input
This commit is contained in:
@@ -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());
|
||||
|
||||
Reference in New Issue
Block a user