From 4ab3dd50c99f002b3fe6d89bc458ed36d5d4ae9b Mon Sep 17 00:00:00 2001 From: kamilritz Date: Tue, 7 Jan 2020 11:36:11 +0100 Subject: [PATCH] pass Vector by const reference --- EKF/ekf.h | 2 +- EKF/mag_fusion.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/EKF/ekf.h b/EKF/ekf.h index 4e2964e700..b77aa681f8 100644 --- a/EKF/ekf.h +++ b/EKF/ekf.h @@ -795,7 +795,7 @@ private: // calculate a synthetic value for the magnetometer Z component, given the 3D magnetomter // sensor measurement - float calculate_synthetic_mag_z_measurement(Vector3f mag_meas, Vector3f mag_earth_predicted); + float calculate_synthetic_mag_z_measurement(const Vector3f& mag_meas, const Vector3f& mag_earth_predicted); void stopGpsFusion(); diff --git a/EKF/mag_fusion.cpp b/EKF/mag_fusion.cpp index c6041793c4..744825acf6 100644 --- a/EKF/mag_fusion.cpp +++ b/EKF/mag_fusion.cpp @@ -997,7 +997,7 @@ void Ekf::limitDeclination() } } -float Ekf::calculate_synthetic_mag_z_measurement(Vector3f mag_meas, Vector3f mag_earth_predicted) +float Ekf::calculate_synthetic_mag_z_measurement(const Vector3f& mag_meas, const Vector3f& mag_earth_predicted) { // theoretical magnitude of the magnetometer Z component value given X and Y sensor measurement and our knowledge // of the earth magnetic field vector at the current location