mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-04-14 10:07:39 +08:00
MC stabilized: allow yaw control at 0 throttle if yaw-airmode is selected
This commit is contained in:
parent
24dc316973
commit
c665c34d2a
@ -269,7 +269,9 @@ private:
|
||||
(ParamFloat<px4::params::MPC_MANTHR_MIN>) _man_throttle_min, /**< minimum throttle for stabilized */
|
||||
(ParamFloat<px4::params::MPC_THR_MAX>) _throttle_max, /**< maximum throttle for stabilized */
|
||||
(ParamFloat<px4::params::MPC_THR_HOVER>) _throttle_hover, /**< throttle at which vehicle is at hover equilibrium */
|
||||
(ParamInt<px4::params::MPC_THR_CURVE>) _throttle_curve /**< throttle curve behavior */
|
||||
(ParamInt<px4::params::MPC_THR_CURVE>) _throttle_curve, /**< throttle curve behavior */
|
||||
|
||||
(ParamInt<px4::params::MC_AIRMODE>) _airmode
|
||||
)
|
||||
|
||||
matrix::Vector3f _attitude_p; /**< P gain for attitude control */
|
||||
|
||||
@ -438,7 +438,7 @@ MulticopterAttitudeControl::generate_attitude_setpoint(float dt, bool reset_yaw_
|
||||
if (reset_yaw_sp) {
|
||||
_man_yaw_sp = yaw;
|
||||
|
||||
} else if (_manual_control_sp.z > 0.05f) {
|
||||
} else if (_manual_control_sp.z > 0.05f || _airmode.get() == (int32_t)Mixer::Airmode::roll_pitch_yaw) {
|
||||
|
||||
const float yaw_rate = math::radians(_yaw_rate_scaling.get());
|
||||
attitude_setpoint.yaw_sp_move_rate = _manual_control_sp.r * yaw_rate;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user