Cheetah Software  1.0
test_filters.cpp File Reference

Test filter functions. More...

#include "Dynamics/spatial.h"
#include "Math/FirstOrderIIRFilter.h"
#include "Math/orientation_tools.h"
#include "cppTypes.h"
#include "gmock/gmock.h"
#include "gtest/gtest.h"
+ Include dependency graph for test_filters.cpp:

Go to the source code of this file.

Functions

 TEST (Filters, firstOrderIIR)
 

Detailed Description

Test filter functions.

Test the various filters

Definition in file test_filters.cpp.

Function Documentation

TEST ( Filters  ,
firstOrderIIR   
)

Test the firstOrderIIR filter with Eigen Vec3's

Definition at line 20 of file test_filters.cpp.

References almostEqual(), FirstOrderIIRFilter< T, T2 >::get(), and FirstOrderIIRFilter< T, T2 >::update().

20  {
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

+ Here is the call graph for this function: