Skip to content

fix(flight_mode_manager): initialize smoothing with current acceleration#27652

Open
AkaiEurus wants to merge 1 commit into
PX4:mainfrom
AkaiEurus:fix-flight-task-accel-fallback
Open

fix(flight_mode_manager): initialize smoothing with current acceleration#27652
AkaiEurus wants to merge 1 commit into
PX4:mainfrom
AkaiEurus:fix-flight-task-accel-fallback

Conversation

@AkaiEurus

@AkaiEurus AkaiEurus commented Jun 12, 2026

Copy link
Copy Markdown
Contributor

Solved Problem

#26254 introduced _acceleration and updated FlightTaskAuto, but other flight tasks still fell back to zero acceleration.

Solution

Use _acceleration as the fallback in Orbit, ManualAltitudeSmoothVel, and ManualAcceleration.

Changelog Entry

Bugfix: Align flight task acceleration fallback with #26254

Test Coverage

Validated in multicopter SITL with before/after ULogs. For each case I compared trajectory_setpoint.acceleration[*] with vehicle_local_position.ax/ay/az around the FlightTask switch point.

  1. ManualAltitudeSmoothVel::activate()
    • Set MPC_POS_MODE=4.
    • Took off to a stable hover, switched to STABILIZED, applied vertical stick input to create a non-zero vehicle_local_position.az, then switched to ALTCTL.

log before patch: https://logs.px4.io/plot_app?log=4a9e955e-e9a5-4942-a72a-18624371d7da

log after patch: https://logs.px4.io/plot_app?log=94daeb66-81ec-4616-828d-ea0f48fac17f

  1. ManualAcceleration::activate()
    • Set MPC_POS_MODE=4.
    • Took off to a stable hover, switched to STABILIZED, applied pitch/roll stick input to create non-zero vehicle_local_position.ax/ay, then switched to POSCTL while the vehicle was still accelerating horizontally.

log before patch: https://logs.px4.io/plot_app?log=3a5a6161-e2d5-4069-bb83-1aa30ce34d5d

log after patch: https://logs.px4.io/plot_app?log=096e588f-4e8a-4649-99ec-5e8bc799ffe8

  1. FlightTaskOrbit::activate()
    • Set MPC_POS_MODE=0.
    • Took off to a stable hover in POSCTL, applied a short horizontal stick input/vertical stick input, then sent MAV_CMD_DO_ORBIT.

horizontal input:

log before patch: https://logs.px4.io/plot_app?log=50deadae-9f72-4813-be58-a23dda815d76

log after patch: https://logs.px4.io/plot_app?log=9bb01426-a4e7-4684-a4cd-0cadc0b67e7c

vertical input:

log before patch: https://logs.px4.io/plot_app?log=fcd86b5c-1935-4c0a-abc5-df788f6773fc

log after patch: https://logs.px4.io/plot_app?log=7a6163e4-5f71-4cbe-8ad4-2c1444462f41

@github-actions github-actions Bot added kind:bug Something is broken or behaving incorrectly. scope:control Rate, attitude, position, allocation, or actuator control. labels Jun 12, 2026
@github-actions

Copy link
Copy Markdown
Contributor

🔎 FLASH Analysis

px4_fmu-v5x [Total VM Diff: 16 byte (0 %)]
    FILE SIZE        VM SIZE    
 --------------  -------------- 
  +0.0%     +16  +0.0%     +16    .text
     +35%     +38   +35%     +38    FlightTaskManualAcceleration::activate()
     +44%      +4   +44%      +4    g_nullstring
    +0.6%      +2  +0.6%      +2    matrix::SliceT<>::operator=()
    -7.4%      -8  -7.4%      -8    FlightTaskManualAltitudeSmoothVel::activate()
    -3.1%      -8  -3.1%      -8    FlightTaskOrbit::update()
    -0.0%     -12  -0.0%     -12    [section .text]
  +0.0%     +55  [ = ]       0    .debug_abbrev
  +0.0%    +349  [ = ]       0    .debug_info
  +0.0%    +140  [ = ]       0    .debug_line
    +300%      +3  [ = ]       0    [Unmapped]
    +0.0%    +137  [ = ]       0    [section .debug_line]
  +0.0%    +241  [ = ]       0    .debug_loclists
  +0.0%     +59  [ = ]       0    .debug_rnglists
    +100%      +1  [ = ]       0    [Unmapped]
    +0.0%     +58  [ = ]       0    [section .debug_rnglists]
  -0.2%     -16  [ = ]       0    [Unmapped]
  +0.0%    +844  +0.0%     +16    TOTAL

px4_fmu-v6x [Total VM Diff: 24 byte (0 %)]
    FILE SIZE        VM SIZE    
 --------------  -------------- 
  +0.0%     +24  +0.0%     +24    .text
     +35%     +38   +35%     +38    FlightTaskManualAcceleration::activate()
    +0.6%      +2  +0.6%      +2    matrix::SliceT<>::operator=()
    -7.4%      -8  -7.4%      -8    FlightTaskManualAltitudeSmoothVel::activate()
    -3.1%      -8  -3.1%      -8    FlightTaskOrbit::update()
  +0.0%     +55  [ = ]       0    .debug_abbrev
  +0.0%    +349  [ = ]       0    .debug_info
  +0.0%    +132  [ = ]       0    .debug_line
   -71.4%      -5  [ = ]       0    [Unmapped]
    +0.0%    +137  [ = ]       0    [section .debug_line]
  +0.0%    +241  [ = ]       0    .debug_loclists
  +0.0%     +59  [ = ]       0    .debug_rnglists
     +50%      +1  [ = ]       0    [Unmapped]
    +0.0%     +58  [ = ]       0    [section .debug_rnglists]
  -0.5%     -24  [ = ]       0    [Unmapped]
  +0.0%    +836  +0.0%     +24    TOTAL

Updated: 2026-06-12T10:22:29

@dakejahl dakejahl requested a review from MaEtUgR June 12, 2026 21:05
@dakejahl

Copy link
Copy Markdown
Contributor

Need flight logs for validation on these kinds of changes so we can see the before/after and verify it works as intended

@AkaiEurus

Copy link
Copy Markdown
Contributor Author

Need flight logs for validation on these kinds of changes so we can see the before/after and verify it works as intended

Updated the PR with before/after SITL logs covering the affected FlightTask transitions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

kind:bug Something is broken or behaving incorrectly. scope:control Rate, attitude, position, allocation, or actuator control.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants