From 85833c354d9749020210cbc0bd3578f548f694bf Mon Sep 17 00:00:00 2001 From: Kyle Isom Date: Tue, 6 Aug 2019 23:30:33 -0700 Subject: [PATCH] Add Madgwick type aliases. --- include/wrmath/filter.h | 8 ++++++++ include/wrmath/filter/madgwick.h | 7 +++++++ test/madgwick_test.cc | 8 ++++---- 3 files changed, 19 insertions(+), 4 deletions(-) create mode 100644 include/wrmath/filter.h diff --git a/include/wrmath/filter.h b/include/wrmath/filter.h new file mode 100644 index 0000000..cf0f4e4 --- /dev/null +++ b/include/wrmath/filter.h @@ -0,0 +1,8 @@ +#ifndef __WRMATH_FILTER_H +#define __WRMATH_FILTER_H + + +#include + + +#endif __WRMATH_FILTER_H diff --git a/include/wrmath/filter/madgwick.h b/include/wrmath/filter/madgwick.h index dac9c07..11fdff7 100644 --- a/include/wrmath/filter/madgwick.h +++ b/include/wrmath/filter/madgwick.h @@ -98,6 +98,13 @@ private: }; +/// Madgwickd is a shorthand alias for a Madgwick. +typedef Madgwick Madgwickd; + +/// Madgwickf is a shorthand alias for a Madgwick. +typedef Madgwick Madgwickf; + + } // namespace filter } // namespace wr diff --git a/test/madgwick_test.cc b/test/madgwick_test.cc index 44564de..45c9c5a 100644 --- a/test/madgwick_test.cc +++ b/test/madgwick_test.cc @@ -11,10 +11,10 @@ using namespace wr; TEST(MadgwickFilter, SimpleAngularOrientation) { - filter::Madgwick mf; - geom::Vector3d gyro {0.17453292519943295, 0.0, 0.0}; // 10° X rotation. - geom::Quaterniond frame20Deg {0.984808, 0.173648, 0, 0}; // 20° final orientation. - double delta = 0.00917; // assume 109 updates per second, as per the paper. + filter::Madgwickd mf; + geom::Vector3d gyro {0.17453292519943295, 0.0, 0.0}; // 10° X rotation. + geom::Quaterniond frame20Deg {0.984808, 0.173648, 0, 0}; // 20° final orientation. + double delta = 0.00917; // assume 109 updates per second, as per the paper. // The paper specifies a minimum of 109 IMU readings to stabilize; for // two seconds, that means 218 updates.