From ae4e84e42929697ef3ef435e607dc194223422c1 Mon Sep 17 00:00:00 2001 From: Miguel Moreira Date: Wed, 18 Nov 2026 09:58:33 +0100 Subject: [PATCH] fix(mavlink): increase command sender list size from 3 to 5 The command sender keeps every outgoing command in a fixed-size list until it is acked and its 500 ms timeout has passed, or its retries run out. When the list is full, a new command overwrites the oldest entry. With 3 slots, the gimbal manager sequence of acquire control, set neutral, release control filled the list on its own. Neutral is sent with target component 0, so it goes out over MAVLink too. Any other command in that window, e.g. a camera command from a mission, overwrote a pending gimbal command and dropped its retries. Assisted-by: Claude:claude-opus-5-5 Signed-off-by: Miguel Moreira --- .../fmu-v6xrt/nuttx-config/scripts/itcm_functions_includes.ld | 2 +- .../fmu-v6xrt/nuttx-config/scripts/itcm_functions_includes.ld | 2 +- .../mr-navq95/nuttx-config/scripts/itcm_functions_includes.ld | 2 +- .../mr-tropic/nuttx-config/scripts/itcm_functions_includes.ld | 2 +- .../nuttx-config/scripts/itcm_functions_includes.ld | 2 +- .../fmu-v6xrt/nuttx-config/scripts/itcm_functions_includes.ld | 2 +- src/modules/mavlink/mavlink_command_sender.h | 2 +- 7 files changed, 7 insertions(+), 7 deletions(-) diff --git a/boards/agam/fmu-v6xrt/nuttx-config/scripts/itcm_functions_includes.ld b/boards/agam/fmu-v6xrt/nuttx-config/scripts/itcm_functions_includes.ld index c27d1b61d3d..7046c29e3ba 100644 --- a/boards/agam/fmu-v6xrt/nuttx-config/scripts/itcm_functions_includes.ld +++ b/boards/agam/fmu-v6xrt/nuttx-config/scripts/itcm_functions_includes.ld @@ -269,7 +269,7 @@ *(.text.nxsem_wait_irq) *(.text._ZN20MavlinkCommandSender4lockEv) *(.text._ZThn24_N16ControlAllocator3RunEv) -*(.text._ZN15TimestampedListIN20MavlinkCommandSender14command_item_sELi3EE8get_nextEv) +*(.text._ZN15TimestampedListIN20MavlinkCommandSender14command_item_sELi5EE8get_nextEv) *(.text._ZNK3Ekf21get_ekf_lpos_accuracyEPfS0_) *(.text._ZN17FlightModeManager17start_flight_taskEv) *(.text._ZN29MavlinkStreamLocalPositionNED8get_sizeEv) diff --git a/boards/ark/fmu-v6xrt/nuttx-config/scripts/itcm_functions_includes.ld b/boards/ark/fmu-v6xrt/nuttx-config/scripts/itcm_functions_includes.ld index e91e9cd1c65..826e99e8e11 100644 --- a/boards/ark/fmu-v6xrt/nuttx-config/scripts/itcm_functions_includes.ld +++ b/boards/ark/fmu-v6xrt/nuttx-config/scripts/itcm_functions_includes.ld @@ -261,7 +261,7 @@ *(.text.nxsem_wait_irq) *(.text._ZN20MavlinkCommandSender4lockEv) *(.text._ZThn24_N16ControlAllocator3RunEv) -*(.text._ZN15TimestampedListIN20MavlinkCommandSender14command_item_sELi3EE8get_nextEv) +*(.text._ZN15TimestampedListIN20MavlinkCommandSender14command_item_sELi5EE8get_nextEv) *(.text._ZNK3Ekf21get_ekf_lpos_accuracyEPfS0_) *(.text._ZN17FlightModeManager17start_flight_taskEv) *(.text._ZN29MavlinkStreamLocalPositionNED8get_sizeEv) diff --git a/boards/nxp/mr-navq95/nuttx-config/scripts/itcm_functions_includes.ld b/boards/nxp/mr-navq95/nuttx-config/scripts/itcm_functions_includes.ld index c74ddeb7eb8..770b19124d0 100644 --- a/boards/nxp/mr-navq95/nuttx-config/scripts/itcm_functions_includes.ld +++ b/boards/nxp/mr-navq95/nuttx-config/scripts/itcm_functions_includes.ld @@ -245,7 +245,7 @@ *(.text.nxsem_wait_irq) *(.text._ZN20MavlinkCommandSender4lockEv) *(.text._ZThn24_N16ControlAllocator3RunEv) -*(.text._ZN15TimestampedListIN20MavlinkCommandSender14command_item_sELi3EE8get_nextEv) +*(.text._ZN15TimestampedListIN20MavlinkCommandSender14command_item_sELi5EE8get_nextEv) *(.text._ZNK3Ekf21get_ekf_lpos_accuracyEPfS0_) *(.text._ZN17FlightModeManager17start_flight_taskEv) *(.text._ZN29MavlinkStreamLocalPositionNED8get_sizeEv) diff --git a/boards/nxp/mr-tropic/nuttx-config/scripts/itcm_functions_includes.ld b/boards/nxp/mr-tropic/nuttx-config/scripts/itcm_functions_includes.ld index 6f9141d6a96..b7b14f82ede 100644 --- a/boards/nxp/mr-tropic/nuttx-config/scripts/itcm_functions_includes.ld +++ b/boards/nxp/mr-tropic/nuttx-config/scripts/itcm_functions_includes.ld @@ -266,7 +266,7 @@ *(.text.nxsem_wait_irq) *(.text._ZN20MavlinkCommandSender4lockEv) *(.text._ZThn24_N16ControlAllocator3RunEv) -*(.text._ZN15TimestampedListIN20MavlinkCommandSender14command_item_sELi3EE8get_nextEv) +*(.text._ZN15TimestampedListIN20MavlinkCommandSender14command_item_sELi5EE8get_nextEv) *(.text._ZNK3Ekf21get_ekf_lpos_accuracyEPfS0_) *(.text._ZN17FlightModeManager17start_flight_taskEv) *(.text._ZN29MavlinkStreamLocalPositionNED8get_sizeEv) diff --git a/boards/nxp/tropic-community/nuttx-config/scripts/itcm_functions_includes.ld b/boards/nxp/tropic-community/nuttx-config/scripts/itcm_functions_includes.ld index 4aae975a259..7f32d4ef0b4 100644 --- a/boards/nxp/tropic-community/nuttx-config/scripts/itcm_functions_includes.ld +++ b/boards/nxp/tropic-community/nuttx-config/scripts/itcm_functions_includes.ld @@ -266,7 +266,7 @@ *(.text.nxsem_wait_irq) *(.text._ZN20MavlinkCommandSender4lockEv) *(.text._ZThn24_N16ControlAllocator3RunEv) -*(.text._ZN15TimestampedListIN20MavlinkCommandSender14command_item_sELi3EE8get_nextEv) +*(.text._ZN15TimestampedListIN20MavlinkCommandSender14command_item_sELi5EE8get_nextEv) *(.text._ZNK3Ekf21get_ekf_lpos_accuracyEPfS0_) *(.text._ZN17FlightModeManager17start_flight_taskEv) *(.text._ZN29MavlinkStreamLocalPositionNED8get_sizeEv) diff --git a/boards/px4/fmu-v6xrt/nuttx-config/scripts/itcm_functions_includes.ld b/boards/px4/fmu-v6xrt/nuttx-config/scripts/itcm_functions_includes.ld index cba31d50340..1c796173ed8 100644 --- a/boards/px4/fmu-v6xrt/nuttx-config/scripts/itcm_functions_includes.ld +++ b/boards/px4/fmu-v6xrt/nuttx-config/scripts/itcm_functions_includes.ld @@ -270,7 +270,7 @@ *(.text.nxsem_wait_irq) *(.text._ZN20MavlinkCommandSender4lockEv) *(.text._ZThn24_N16ControlAllocator3RunEv) -*(.text._ZN15TimestampedListIN20MavlinkCommandSender14command_item_sELi3EE8get_nextEv) +*(.text._ZN15TimestampedListIN20MavlinkCommandSender14command_item_sELi5EE8get_nextEv) *(.text._ZNK3Ekf21get_ekf_lpos_accuracyEPfS0_) *(.text._ZN17FlightModeManager17start_flight_taskEv) *(.text._ZN29MavlinkStreamLocalPositionNED8get_sizeEv) diff --git a/src/modules/mavlink/mavlink_command_sender.h b/src/modules/mavlink/mavlink_command_sender.h index 8d81e9f4660..f6d48309777 100644 --- a/src/modules/mavlink/mavlink_command_sender.h +++ b/src/modules/mavlink/mavlink_command_sender.h @@ -124,7 +124,7 @@ private: #endif }; - TimestampedList _commands{}; + TimestampedList _commands{}; px4::atomic _num_commands{0}; ///< number of commands in the list, written under the lock, read without it bool _debug_enabled = false;