mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-03 08:48:53 +08:00
mc_att: remove dependency to heading_god_for_control
Absolute heading is not required in stabilized mode and a change in heading convergence is already handled by the StickYaw class using unaided_heading
This commit is contained in:
@@ -126,7 +126,6 @@ private:
|
||||
SlewRate<float> _hover_thrust_slew_rate{.5f};
|
||||
|
||||
float _yaw_setpoint_stabilized{0.f};
|
||||
bool _heading_good_for_control{true}; // initialized true to have heading lock when local position never published
|
||||
float _unaided_heading{NAN}; // initialized NAN to not distract heading lock when local position never published
|
||||
float _man_tilt_max{0.f}; /**< maximum tilt allowed for manual flight [rad] */
|
||||
|
||||
|
||||
@@ -141,7 +141,7 @@ MulticopterAttitudeControl::generate_attitude_setpoint(const Quatf &q, float dt)
|
||||
// Avoid accumulating absolute yaw error with arming stick gesture
|
||||
const bool arming_gesture = (_manual_control_setpoint.throttle < -.9f) && (_param_mc_airmode.get() != 2);
|
||||
|
||||
if (arming_gesture || !_heading_good_for_control) {
|
||||
if (arming_gesture) {
|
||||
_yaw_setpoint_stabilized = NAN;
|
||||
}
|
||||
|
||||
@@ -278,7 +278,6 @@ MulticopterAttitudeControl::Run()
|
||||
vehicle_local_position_s vehicle_local_position;
|
||||
|
||||
if (_vehicle_local_position_sub.copy(&vehicle_local_position)) {
|
||||
_heading_good_for_control = vehicle_local_position.heading_good_for_control;
|
||||
_unaided_heading = vehicle_local_position.unaided_heading;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user