13 #include <gtest/gtest.h> 38 <<
"pRVT : " << poseRVT << endl
39 <<
"newPoseRVT : " << newPoseRVT_1 << endl;
47 <<
"pRVT : " << poseRVT << endl
48 <<
"newPoseRVT : " << newPoseRVT_2 << endl;
64 for (
size_t i=0;i<4;i++)
65 for (
size_t j=0;j<4;j++)
66 EXPECT_NEAR(HM(i,j), i==j ? 1.0 : 0.0, 1e-8 )
67 <<
"Failed for (i,j)=" << i <<
"," << j << endl
68 <<
"Matrix is: " << endl << HM << endl
69 <<
"case was: " << label << endl;
73 void test_compose(
double x1,
double y1,
double z1,
double yaw1,
double pitch1,
double roll1,
74 double x2,
double y2,
double z2,
double yaw2,
double pitch2,
double roll2)
98 p1.getHomogeneousMatrix(M1);
99 p2.getHomogeneousMatrix(M2);
105 EXPECT_NEAR(0, (p1_c_p2_i_p2.
getAsVectorVal()-p2.getAsVectorVal()).array().abs().sum(), 1e-5)
106 <<
"p1 : " << p1 << endl
107 <<
"p2 : " << p2 << endl
108 <<
"p1_c_p2_i_p2: " << p1_c_p2_i_p2 << endl;
110 EXPECT_NEAR(0, (p2_c_p1_i_p2.
getAsVectorVal()-p1.getAsVectorVal()).array().abs().sum(), 1e-5)
111 <<
"p1 : " << p1 << endl
112 <<
"p2 : " << p2 << endl
114 <<
"p1_i_p2 : " << p1_i_p2 << endl
115 <<
"p1_i_p2 matrix: " << endl << p1_i_p2.getHomogeneousMatrixVal() << endl
116 <<
"p2_c_p1_i_p2: " << p2_c_p1_i_p2 << endl;
119 <<
"p3 : " << p3 << endl
120 <<
"p1_c_p2 : " << p1_c_p2 << endl;
129 test_default_values(
p,
"Default");
141 EXPECT_NEAR(
p.m_coords[0],1, 1e-7);
142 EXPECT_NEAR(
p.m_coords[1],2, 1e-7);
143 EXPECT_NEAR(
p.m_coords[2],3, 1e-7);
144 EXPECT_NEAR(
p.m_rotvec[0],0.2, 1e-7);
145 EXPECT_NEAR(
p.m_rotvec[1],0.3, 1e-7);
146 EXPECT_NEAR(
p.m_rotvec[2],0.4, 1e-7);
Classes for serialization, sockets, ini-file manipulation, streams, list of properties-values, timewatch, extensions to STL.
mrpt::math::CVectorDouble getAsVectorVal() const
Return the pose or point as a 1xN vector with all the components (see derived classes for each implem...
void setFromXYZAndAngles(const double x, const double y, const double z, const double yaw=0, const double pitch=0, const double roll=0)
void test_compose(double x1, double y1, double z1, double yaw1, double pitch1, double roll1, double x2, double y2, double z2, double yaw2, double pitch2, double roll2)
void test_default_values(const CPose3DRotVec &p, const std::string &label)
A numeric matrix of compile-time fixed size.
This base provides a set of functions for maths stuff.
#define MRPT_UNUSED_PARAM(a)
Can be used to avoid "not used parameters" warnings from the compiler.
A class used to store a 3D pose as a translation (x,y,z) and a quaternion (qr,qx,qy,qz).
GLsizei const GLchar ** string
Classes for 2D/3D geometry representation, both of single values and probability density distribution...
This is the global namespace for all Mobile Robot Programming Toolkit (MRPT) libraries.
TEST_F(Pose3DRotVecTests, DefaultValues)
A class used to store a 3D pose (a 3D translation + a rotation in 3D).
mrpt::math::CMatrixDouble44 getHomogeneousMatrixVal() const
A 3D pose, with a 3D translation and a rotation in 3D parameterized in rotation-vector form (equivale...