AP_NavEKF3: pin P references in non-writing files to const

Change their define so they don't use the mutable original, only the
name through a const-cast pointer. There are no writes to the covariance
matrix in these files, so nothing else needs changing.
This commit is contained in:
Thomas Watson
2026-09-22 11:56:43 +10:00
committed by Andrew Tridgell
parent c114fb1254
commit 2125137117
6 changed files with 6 additions and 6 deletions
@@ -4,7 +4,7 @@
#include "AP_NavEKF3_core.h"
#include <AP_DAL/AP_DAL.h>
#define P (Pmut)
#define P (const_cast<const Matrix24 &>(Pmut))
/********************************************************
* RESET FUNCTIONS *
+1 -1
View File
@@ -12,7 +12,7 @@
#pragma GCC diagnostic ignored "-Wnarrowing"
#define P (Pmut)
#define P (const_cast<const Matrix24 &>(Pmut))
void NavEKF3_core::Log_Write_XKF1(uint64_t time_us) const
{
@@ -8,7 +8,7 @@
#include <AP_DAL/AP_DAL.h>
#include <AP_InternalError/AP_InternalError.h>
#define P (Pmut)
#define P (const_cast<const Matrix24 &>(Pmut))
#if AP_RANGEFINDER_ENABLED
/********************************************************
@@ -9,7 +9,7 @@
#include <GCS_MAVLink/GCS.h>
#include <AP_DAL/AP_DAL.h>
#define P (Pmut)
#define P (const_cast<const Matrix24 &>(Pmut))
/********************************************************
* RESET FUNCTIONS *
+1 -1
View File
@@ -5,7 +5,7 @@
#include <AP_DAL/AP_DAL.h>
#include <GCS_MAVLink/GCS.h>
#define P (Pmut)
#define P (const_cast<const Matrix24 &>(Pmut))
// Check basic filter health metrics and return a consolidated health status
bool NavEKF3_core::healthy(void) const
@@ -5,7 +5,7 @@
#include <AP_DAL/AP_DAL.h>
#define P (Pmut)
#define P (const_cast<const Matrix24 &>(Pmut))
// initialise state:
void NavEKF3_core::BeaconFusion::InitialiseVariables()