From 8d0ceda3bbeee3e6dcbda8a123c70a9f5a008fe0 Mon Sep 17 00:00:00 2001 From: Francois Carouge Date: Sat, 23 Jul 2022 22:29:22 -0700 Subject: [PATCH] [msvc] fix compatibility --- include/fcarouge/internal/kalman.hpp | 23 ++++++++++------------- test/f.cpp | 5 +++-- test/h.cpp | 11 ++++++----- 3 files changed, 19 insertions(+), 20 deletions(-) diff --git a/include/fcarouge/internal/kalman.hpp b/include/fcarouge/internal/kalman.hpp index 7b0ee2f31..953dac76b 100644 --- a/include/fcarouge/internal/kalman.hpp +++ b/include/fcarouge/internal/kalman.hpp @@ -183,8 +183,9 @@ struct kalman inline constexpr void update(const UpdateTypes &...arguments, - const auto &...output_z) + const Outputs &...output_z) { const auto i{ identity.template operator()() }; @@ -207,9 +208,10 @@ struct kalman inline constexpr void operator()(const PredictionTypes &...prediction_arguments, - const UpdateTypes &...update_arguments, const auto &...output_z) + const UpdateTypes &...update_arguments, const Outputs &...output_z) { update(update_arguments..., output_z...); predict(prediction_arguments...); @@ -341,8 +343,9 @@ struct kalman inline constexpr void update(const UpdateTypes &...arguments, - const auto &...output_z) + const Outputs &...output_z) { const auto i{ identity.template operator()() }; @@ -363,8 +366,9 @@ struct kalman inline constexpr void predict(const PredictionTypes &...arguments, - const auto &...input_u) + const Inputs &...input_u) { u = input{ input_u... }; f = transition_state_f(x, arguments..., u); @@ -374,17 +378,10 @@ struct kalman inline constexpr void operator()(const PredictionTypes &...prediction_arguments, - const UpdateTypes &...update_arguments, const auto &...input_u, + const UpdateTypes &...update_arguments, const Inputs &...input_u, const auto &...output_z) { update(update_arguments..., output_z...); diff --git a/test/f.cpp b/test/f.cpp index 706c9180e..24e3bb737 100644 --- a/test/f.cpp +++ b/test/f.cpp @@ -111,6 +111,7 @@ namespace kalman k; const auto i5x5{ Eigen::Matrix::Identity() }; const auto z5x5{ Eigen::Matrix::Zero() }; + const Eigen::Matrix z3x1{ Eigen::Matrix::Zero() }; assert(k.f() == i5x5); @@ -152,7 +153,7 @@ namespace } }; k.f(f); assert(k.f() == z5x5); - k.predict(0, 0, 0.f, 0.); + k.predict(char(0), 0, 0.f, 0., z3x1); assert(k.f() == i5x5); } @@ -170,7 +171,7 @@ namespace } }; k.f(std::move(f)); assert(k.f() == i5x5); - k.predict(0, 0, 0.f, 0.); + k.predict(0, 0, 0.f, 0., z3x1); assert(k.f() == z5x5); } diff --git a/test/h.cpp b/test/h.cpp index f0ac7b63c..ef1989a0b 100644 --- a/test/h.cpp +++ b/test/h.cpp @@ -46,7 +46,7 @@ namespace { //! @test Verifies the observation transition matrix H management overloads for //! the default filter type. -[[maybe_unused]] auto h111{ [] { +[[maybe_unused]] auto h110{ [] { fcarouge::kalman k; using kalman = decltype(k); @@ -83,7 +83,7 @@ namespace } }; k.h(h); assert(k.h() == 5); - k.update(0.); + k.update(); assert(k.h() == 6); } @@ -94,7 +94,7 @@ namespace } }; k.h(std::move(h)); assert(k.h() == 6); - k.update(0.); + k.update(); assert(k.h() == 7); } @@ -111,6 +111,7 @@ namespace kalman k; const auto i4x5{ Eigen::Matrix::Identity() }; const auto z4x5{ Eigen::Matrix::Zero() }; + const Eigen::Matrix z4x1{ Eigen::Matrix::Zero() }; assert(k.h() == i4x5); @@ -150,7 +151,7 @@ namespace } }; k.h(h); assert(k.h() == z4x5); - k.update(0., 0.f, 0, 0); + k.update(0., 0.f, 0, char(0), z4x1); assert(k.h() == i4x5); } @@ -166,7 +167,7 @@ namespace } }; k.h(std::move(h)); assert(k.h() == i4x5); - k.update(0., 0.f, 0, 0); + k.update(0., 0.f, 0, char(0), z4x1); assert(k.h() == z4x5); }