From 7d9484e7a6add3d5ab51800e46bd2a6ddc2b3708 Mon Sep 17 00:00:00 2001 From: Jacob Dahl Date: Sun, 15 Mar 2026 12:05:00 -0800 Subject: [PATCH] refactor(flight_mode_manager): pass follow_target_s by const reference --- .../follow_target_estimator/TargetEstimator.cpp | 2 +- .../follow_target_estimator/TargetEstimator.hpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/modules/flight_mode_manager/tasks/AutoFollowTarget/follow_target_estimator/TargetEstimator.cpp b/src/modules/flight_mode_manager/tasks/AutoFollowTarget/follow_target_estimator/TargetEstimator.cpp index 1c3e0f0011..f3765a7ca6 100644 --- a/src/modules/flight_mode_manager/tasks/AutoFollowTarget/follow_target_estimator/TargetEstimator.cpp +++ b/src/modules/flight_mode_manager/tasks/AutoFollowTarget/follow_target_estimator/TargetEstimator.cpp @@ -225,7 +225,7 @@ bool TargetEstimator::measurement_can_be_fused(const Vector3f ¤t_measureme // return measurement_valid; } -void TargetEstimator::measurement_update(follow_target_s follow_target) +void TargetEstimator::measurement_update(const follow_target_s &follow_target) { _fusion_count++; // Decompose follow_target message into the individual measurements for position and velocity diff --git a/src/modules/flight_mode_manager/tasks/AutoFollowTarget/follow_target_estimator/TargetEstimator.hpp b/src/modules/flight_mode_manager/tasks/AutoFollowTarget/follow_target_estimator/TargetEstimator.hpp index 4dc22e455a..7886c21977 100644 --- a/src/modules/flight_mode_manager/tasks/AutoFollowTarget/follow_target_estimator/TargetEstimator.hpp +++ b/src/modules/flight_mode_manager/tasks/AutoFollowTarget/follow_target_estimator/TargetEstimator.hpp @@ -157,7 +157,7 @@ protected: * * @param follow_target GPS data last received from target */ - void measurement_update(follow_target_s follow_target); + void measurement_update(const follow_target_s &follow_target); /** * Perform prediction step based on simple position-velocity-acceleration model of a point mass