mirror of
https://github.com/PX4/PX4-Autopilot.git
synced 2026-11-28 19:21:03 +08:00
fix(fw_lat_lon_control): use tailsitter fixed-wing heading (#28656)
Use the fixed-wing-frame yaw already computed from vehicle attitude for
the no-wind heading and track quality check. Use the same adapted yaw
when capturing the no-position backtransition heading.
Assisted-by: Codex:gpt-5
Signed-off-by: Kirill <exxxim@gmail.com>
Co-authored-by: Kirill <exxxim@gmail.com>
(cherry picked from commit 3599328bae)
This commit is contained in:
1 parent
759b04f1ee
commit
fca3df865a
2 files changed
+2
-2
No files matched your search
@@ -754,7 +754,7 @@ float FwLateralLongitudinalControl::getGuidanceQualityFactor(const vehicle_local
|
||||
0.f, 1.f));
|
||||
|
||||
// Check that the angle between heading and track is not off too much. if it is greater than 90° we will be pushed back from the wind and the npfg will propably give a roll command in the wrong direction.
|
||||
const Vector2f heading_vector(matrix::Dcm2f(local_pos.heading)*Vector2f({1.f, 0.f}));
|
||||
const Vector2f heading_vector(matrix::Dcm2f(_yaw)*Vector2f({1.f, 0.f}));
|
||||
const Vector2f ground_vel_norm(ground_vel.normalized());
|
||||
const float flying_forward_factor(math::constrain((heading_vector.dot(ground_vel_norm) -
|
||||
COS_HEADING_TRACK_ANGLE_PUSHED_BACK) / ((COS_HEADING_TRACK_ANGLE_NOT_PUSHED_BACK -
|
||||
|
||||
@@ -1989,7 +1989,7 @@ float FixedWingModeManager::rollAngleToLateralAccel(float roll_body) const
|
||||
void FixedWingModeManager::control_backtransition_heading_hold()
|
||||
{
|
||||
if (!PX4_ISFINITE(_backtrans_heading)) {
|
||||
_backtrans_heading = _local_pos.heading;
|
||||
_backtrans_heading = _yaw;
|
||||
}
|
||||
|
||||
fixed_wing_lateral_setpoint_s fw_lateral_ctrl_sp{empty_lateral_control_setpoint};
|
||||
|
||||
Reference in new issue
Block a user