diff --git a/example/kalman_filter/kalman.h b/example/kalman_filter/kalman.h index 439dc3a4..48406382 100644 --- a/example/kalman_filter/kalman.h +++ b/example/kalman_filter/kalman.h @@ -22,6 +22,7 @@ #pragma once +#include #include #include #include @@ -74,6 +75,13 @@ public: uncertainty_type uncertainty; }; +#if UNITS_COMP_CLANG == 12 + +template +estimation(state, U) -> estimation; + +#endif + // kalman gain template constexpr units::dimensionless kalman_gain(Q estimate_uncertainty, Q measurement_uncertainty) diff --git a/example/kalman_filter/kalman_filter-example_5.cpp b/example/kalman_filter/kalman_filter-example_5.cpp index b818f19a..cd99ddd6 100644 --- a/example/kalman_filter/kalman_filter-example_5.cpp +++ b/example/kalman_filter/kalman_filter-example_5.cpp @@ -63,11 +63,11 @@ int main() print_header(initial); estimation next = predict(initial); - for(int index = 1; const auto& m : measurements) { + for(int index = 1; const auto& measured : measurements) { const auto& previous = next; const auto gain = kalman_gain(previous.uncertainty, measurement_uncertainty); - const estimation current = update(previous, m, gain); + const estimation current = update(previous, measured, gain); next = predict(current); - print(index++, gain, m, current, next); + print(index++, gain, measured, current, next); } }