Skip to content

Conversation

mahima-yoga
Copy link
Contributor

Porting: #25283

* MulticopterPositionControl: Add timeout before triggering emergency setpoint on invalid TrajectorySetpoint

* Apply suggestions from code review

Co-authored-by: Jacob Dahl <37091262+dakejahl@users.noreply.github.com>

* Cleanup & address review comments

* Safegaurd against using old setpoint if states aren't valid anymore

---------

Co-authored-by: Jacob Dahl <37091262+dakejahl@users.noreply.github.com>
@mahima-yoga mahima-yoga requested a review from dakejahl July 30, 2025 15:30
Copy link

🔎 FLASH Analysis

px4_fmu-v5x [Total VM Diff: 144 byte (0.01 %)]
    FILE SIZE        VM SIZE    
--------------  -------------- 
+0.0%    +144  +0.0%    +144    .text
  +1.3%    +160  +1.3%    +160    ../../src/modules/mc_pos_control/MulticopterPositionControl.cpp
  -0.0%      -8  -0.0%      -8    ROMFS/nsh_romfsimg.c
  -0.0%      -8  -0.0%      -8    [section .text]
+0.0%     +56  [ = ]       0    .debug_abbrev
   +11%     +56  [ = ]       0    ../../src/lib/version/version.c
-0.0%      -8  [ = ]       0    .debug_aranges
  -5.0%      -8  [ = ]       0    ../../src/lib/version/version.c
+0.0%    +107  [ = ]       0    .debug_info
  -0.2%      -4  [ = ]       0    ../../src/lib/version/version.c
  +0.1%    +111  [ = ]       0    ../../src/modules/mc_pos_control/MulticopterPositionControl.cpp
+0.0%     +77  [ = ]       0    .debug_line
  -1.3%     -25  [ = ]       0    ../../src/lib/version/version.c
  +0.4%     +97  [ = ]       0    ../../src/modules/mc_pos_control/MulticopterPositionControl.cpp
  +0.4%      +5  [ = ]       0    task/task_cancelpt.c
+0.0%     +48  [ = ]       0    .debug_loc
  +0.1%     +48  [ = ]       0    ../../src/modules/mc_pos_control/MulticopterPositionControl.cpp
+0.0%     +66  [ = ]       0    .debug_ranges
  -2.6%      -8  [ = ]       0    ../../src/lib/version/version.c
  +0.5%     +72  [ = ]       0    ../../src/modules/mc_pos_control/MulticopterPositionControl.cpp
  +3.1%      +2  [ = ]       0    task/task_cancelpt.c
+0.0%      +6  [ = ]       0    .debug_str
  +0.0%      +6  [ = ]       0    ../../src/modules/mc_pos_control/MulticopterPositionControl.cpp
-0.0%     -16  [ = ]       0    .symtab
  -5.4%     -48  [ = ]       0    ../../src/lib/version/version.c
  +0.3%     +16  [ = ]       0    ../../src/modules/fw_pos_control/FixedwingPositionControl.cpp
  +0.0%     +16  [ = ]       0    [section .symtab]
-0.2%    -144  [ = ]       0    [Unmapped]
+0.0%    +336  +0.0%    +144    TOTAL

px4_fmu-v6x [Total VM Diff: 152 byte (0.01 %)]
    FILE SIZE        VM SIZE    
--------------  -------------- 
+0.0%    +152  +0.0%    +152    .text
  +1.3%    +160  +1.3%    +160    ../../src/modules/mc_pos_control/MulticopterPositionControl.cpp
  +0.2%      +3  +0.2%      +3    ../../src/systemcmds/ver/ver.cpp
  -0.0%      -4  -0.0%      -4    [section .text]
  -0.0%      -7  -0.0%      -7    ROMFS/nsh_romfsimg.c
+0.0%     +56  [ = ]       0    .debug_abbrev
   +11%     +56  [ = ]       0    ../../src/lib/version/version.c
-0.0%      -8  [ = ]       0    .debug_aranges
  -5.0%      -8  [ = ]       0    ../../src/lib/version/version.c
+0.0%    +107  [ = ]       0    .debug_info
  -0.2%      -4  [ = ]       0    ../../src/lib/version/version.c
  +0.1%    +111  [ = ]       0    ../../src/modules/mc_pos_control/MulticopterPositionControl.cpp
+0.0%     +69  [ = ]       0    .debug_line
  -1.3%     -25  [ = ]       0    ../../src/lib/version/version.c
  +0.4%     +97  [ = ]       0    ../../src/modules/mc_pos_control/MulticopterPositionControl.cpp
  -0.3%      -3  [ = ]       0    task/task_cancelpt.c
+0.0%     +48  [ = ]       0    .debug_loc
  +0.1%     +48  [ = ]       0    ../../src/modules/mc_pos_control/MulticopterPositionControl.cpp
+0.0%     +62  [ = ]       0    .debug_ranges
  -2.6%      -8  [ = ]       0    ../../src/lib/version/version.c
  +0.5%     +72  [ = ]       0    ../../src/modules/mc_pos_control/MulticopterPositionControl.cpp
  -3.0%      -2  [ = ]       0    task/task_cancelpt.c
+0.0%      +6  [ = ]       0    .debug_str
  +0.0%      +6  [ = ]       0    ../../src/modules/mc_pos_control/MulticopterPositionControl.cpp
-0.0%     -16  [ = ]       0    .symtab
  -7.0%     -64  [ = ]       0    ../../src/lib/version/version.c
  +0.3%     +16  [ = ]       0    ../../src/modules/fw_pos_control/FixedwingPositionControl.cpp
  +0.1%     +32  [ = ]       0    [section .symtab]
-0.2%    -152  [ = ]       0    [Unmapped]
+0.0%    +324  +0.0%    +152    TOTAL

Updated: 2025-07-30T15:36:20

Copy link
Contributor

@dakejahl dakejahl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you!

@dakejahl dakejahl changed the title [RELEASE 1.16] MC PositionControl: Add timeout for invalid TrajectorySetpoint (#25283) [BACKPORT 1.16] MC PositionControl: Add timeout for invalid TrajectorySetpoint (#25283) Jul 30, 2025
@dakejahl dakejahl merged commit 740521a into release/1.16 Jul 30, 2025
66 of 67 checks passed
@dakejahl dakejahl deleted the backport-add-timeout-mpc-1.16 branch July 30, 2025 18:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants