2 #include <gtest/gtest.h> 114 EXPECT_STREQ(e.
what(),
"Cannot compare MatrixNd's of different sizes!");
159 m2(2, 2) = 0.7000001;
170 m2(0, 0) = 0.70000001;
186 m2(2, 2) = 0.7000001;
197 m2(0, 0) = 0.70000001;
209 EXPECT_STREQ(e.
what(),
"Cannot compare MatrixNd's of different sizes!");
329 EXPECT_STREQ(e.
what(),
"Cannot compare vectors because they are not the same length!");
428 EXPECT_STREQ(e.
what(),
"Cannot compare vectors because they are not the same length!");
436 Math::VectorNd x_euler = Math::VectorNd::Zero(model->q_size + model->qdot_size);
437 Math::VectorNd x_rk4 = Math::VectorNd::Zero(model->q_size + model->qdot_size);
444 int main(
int argc,
char** argv)
446 ::testing::InitGoogleTest(&argc, argv);
447 return RUN_ALL_TESTS();
static bool checkVectorNdEpsilonClose(const RobotDynamics::Math::VectorNd &v1, const RobotDynamics::Math::VectorNd &v2, const double epsilon)
static bool checkVector4dEpsilonClose(const RobotDynamics::Math::Vector4d &v1, const RobotDynamics::Math::Vector4d &v2, const double epsilon)
static bool checkMatrix3dEq(const RobotDynamics::Math::Matrix3d &t1, const RobotDynamics::Math::Matrix3d &t2)
static bool checkVector3dEq(const RobotDynamics::Math::Vector3d &v1, const RobotDynamics::Math::Vector3d &v2)
virtual const char * what() const
int main(int argc, char **argv)
static bool checkMatrixNdEpsilonClose(const RobotDynamics::Math::MatrixNd &t1, const RobotDynamics::Math::MatrixNd &t2, const double epsilon)
void integrateRk4(Model &model, const Math::VectorNd &Q, const Math::VectorNd &QDot, Math::VectorNd &x, const Math::VectorNd &tau, double h, Math::SpatialForceV *f_ext=nullptr)
Using a Runge-Kutta 4th order algorithm, integrate the system dynamics one step.
static bool checkSpatialMatrixEpsilonClose(const RobotDynamics::Math::SpatialMatrix &t1, const RobotDynamics::Math::SpatialMatrix &t2, const double epsilon)
static bool checkSpatialVectorsEpsilonClose(const RobotDynamics::Math::SpatialVector &v1, const RobotDynamics::Math::SpatialVector &v2, const double epsilon)
static bool checkVector4dEq(const RobotDynamics::Math::Vector4d &v1, const RobotDynamics::Math::Vector4d &v2)
void integrateEuler(Model &model, const Math::VectorNd &Q, const Math::VectorNd &QDot, Math::VectorNd &x, const Math::VectorNd &tau, double h, Math::SpatialForceV *f_ext=nullptr)
Using simple Euler integration, integrate the system dynamics one step.
static bool checkSpatialVectorsEq(const RobotDynamics::Math::SpatialVector &v1, const RobotDynamics::Math::SpatialVector &v2)
static bool checkVector3dEpsilonClose(const RobotDynamics::Math::Vector3d &v1, const RobotDynamics::Math::Vector3d &v2, const double epsilon)
TEST_F(UnitTestUtilsTests, testCheckSpatialMatrixEpsilonClose)
static bool checkMatrixNdEq(const RobotDynamics::Math::MatrixNd &t1, const RobotDynamics::Math::MatrixNd &t2)
static bool checkVectorNdEq(const RobotDynamics::Math::VectorNd &v1, const RobotDynamics::Math::VectorNd &v2)
static bool checkMatrix3dEpsilonClose(const RobotDynamics::Math::Matrix3d &t1, const RobotDynamics::Math::Matrix3d &t2, const double epsilon)