Cheetah Software  1.0
test_filters.cpp
Go to the documentation of this file.
1 
7 #include "Dynamics/spatial.h"
10 #include "cppTypes.h"
11 #include "gmock/gmock.h"
12 #include "gtest/gtest.h"
13 
14 using namespace ori;
15 using namespace spatial;
16 
20 TEST(Filters, firstOrderIIR) {
21  Vec3<double> x0(1, 2, 3);
22  FirstOrderIIRFilter<Vec3<double>, double> filt(0.2, x0);
23  Vec3<double> update(5, 5, 5);
24  filt.update(update);
25  Vec3<double> expected = x0 * 0.8 + 0.2 * update;
26  EXPECT_TRUE(almostEqual(expected, filt.get(), .0001));
27 }
typename Eigen::Matrix< T, 3, 1 > Vec3
Definition: cppTypes.h:26
bool almostEqual(const Eigen::MatrixBase< T > &a, const Eigen::MatrixBase< T > &b, T2 tol)
Definition: MathUtilities.h:23
A simple first order filter.
TEST(Filters, firstOrderIIR)
Utility functions for 3D rotations.
Utility functions for manipulating spatial quantities.