diff --git a/include/kalman/SquareRootExtendedKalmanFilter.hpp b/include/kalman/SquareRootExtendedKalmanFilter.hpp index 2f876af..a05df2a 100644 --- a/include/kalman/SquareRootExtendedKalmanFilter.hpp +++ b/include/kalman/SquareRootExtendedKalmanFilter.hpp @@ -208,7 +208,7 @@ namespace Kalman { template bool computePredictedCovarianceSquareRoot( const Jacobian& A, const CovarianceSquareRoot& S, const Jacobian& B, const CovarianceSquareRoot& R, - CovarianceSquareRoot& S_pred) + CovarianceSquareRoot& S_pred) const { // Compute QR decomposition of (transposed) augmented matrix Matrix tmp; @@ -251,7 +251,7 @@ namespace Kalman { template bool computeKalmanGain( const Jacobian& H, const CovarianceSquareRoot& S_y, - KalmanGain& K) + KalmanGain& K) const { // Solve using backsubstitution // AX=B with B = HSS^T and X = K^T and A = S_yS_y^T diff --git a/include/kalman/SquareRootUnscentedKalmanFilter.hpp b/include/kalman/SquareRootUnscentedKalmanFilter.hpp index f236267..7b61d04 100644 --- a/include/kalman/SquareRootUnscentedKalmanFilter.hpp +++ b/include/kalman/SquareRootUnscentedKalmanFilter.hpp @@ -221,7 +221,7 @@ namespace Kalman { */ template bool computeCovarianceSquareRootFromSigmaPoints(const Type& mean, const SigmaPoints& sigmaPoints, - const CovarianceSquareRoot& noiseCov, CovarianceSquareRoot& cov) + const CovarianceSquareRoot& noiseCov, CovarianceSquareRoot& cov) const { // Compute QR decomposition of (transposed) augmented matrix Matrix tmp; @@ -272,7 +272,7 @@ namespace Kalman { bool computeKalmanGain( const Measurement& y, const SigmaPoints& sigmaMeasurementPoints, const CovarianceSquareRoot& S_y, - KalmanGain& K) + KalmanGain& K) const { // Note: The intermediate eval() is needed here (for now) due to a bug in Eigen that occurs // when Measurement::RowsAtCompileTime == 1 AND State::RowsAtCompileTime >= 8 diff --git a/include/kalman/UnscentedKalmanFilter.hpp b/include/kalman/UnscentedKalmanFilter.hpp index cd13a34..39612dd 100644 --- a/include/kalman/UnscentedKalmanFilter.hpp +++ b/include/kalman/UnscentedKalmanFilter.hpp @@ -218,7 +218,7 @@ namespace Kalman { */ template bool computeCovarianceFromSigmaPoints( const Type& mean, const SigmaPoints& sigmaPoints, - const Covariance& noiseCov, Covariance& cov) + const Covariance& noiseCov, Covariance& cov) const { decltype(sigmaPoints) W = this->sigmaWeights_c.transpose().template replicate(); decltype(sigmaPoints) tmp = (sigmaPoints.colwise() - mean); @@ -241,7 +241,7 @@ namespace Kalman { bool computeKalmanGain( const Measurement& y, const SigmaPoints& sigmaMeasurementPoints, const Covariance& P_yy, - KalmanGain& K) + KalmanGain& K) const { // Note: The intermediate eval() is needed here (for now) due to a bug in Eigen that occurs // when Measurement::RowsAtCompileTime == 1 AND State::RowsAtCompileTime >= 8 diff --git a/include/kalman/UnscentedKalmanFilterBase.hpp b/include/kalman/UnscentedKalmanFilterBase.hpp index 25e7fb2..51c65c6 100644 --- a/include/kalman/UnscentedKalmanFilterBase.hpp +++ b/include/kalman/UnscentedKalmanFilterBase.hpp @@ -137,7 +137,8 @@ namespace Kalman { * @return The predicted measurement */ template class CovarianceBase> - Measurement computeMeasurementPrediction(const MeasurementModelType& m, SigmaPoints& sigmaMeasurementPoints) + Measurement computeMeasurementPrediction(const MeasurementModelType& m, + SigmaPoints& sigmaMeasurementPoints) const { // Predict measurements for each sigma point computeSigmaPointMeasurements(m, sigmaMeasurementPoints); @@ -204,7 +205,8 @@ namespace Kalman { * @param [out] sigmaMeasurementPoints The struct of expected sigma measurements to be computed */ template class CovarianceBase> - void computeSigmaPointMeasurements(const MeasurementModelType& m, SigmaPoints& sigmaMeasurementPoints) + void computeSigmaPointMeasurements(const MeasurementModelType& m, + SigmaPoints& sigmaMeasurementPoints) const { for( int i = 0; i < SigmaPointCount; ++i ) { @@ -221,7 +223,7 @@ namespace Kalman { * @return The prediction */ template - Type computePredictionFromSigmaPoints(const SigmaPoints& sigmaPoints) + Type computePredictionFromSigmaPoints(const SigmaPoints& sigmaPoints) const { // Use efficient matrix x vector computation return sigmaPoints * sigmaWeights_m;