mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-17 10:53:34 +08:00
MC stabilized: allow yaw control at 0 throttle if yaw-airmode is selected
This commit is contained in:
@@ -269,7 +269,9 @@ private:
|
|||||||
(ParamFloat<px4::params::MPC_MANTHR_MIN>) _man_throttle_min, /**< minimum throttle for stabilized */
|
(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_MAX>) _throttle_max, /**< maximum throttle for stabilized */
|
||||||
(ParamFloat<px4::params::MPC_THR_HOVER>) _throttle_hover, /**< throttle at which vehicle is at hover equilibrium */
|
(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 */
|
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) {
|
if (reset_yaw_sp) {
|
||||||
_man_yaw_sp = yaw;
|
_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());
|
const float yaw_rate = math::radians(_yaw_rate_scaling.get());
|
||||||
attitude_setpoint.yaw_sp_move_rate = _manual_control_sp.r * yaw_rate;
|
attitude_setpoint.yaw_sp_move_rate = _manual_control_sp.r * yaw_rate;
|
||||||
|
|||||||
Reference in New Issue
Block a user