14 #include <gtest/gtest.h> 43 <<
"pRVT : " << poseRVT << endl
44 <<
"newPoseRVT : " << newPoseRVT_1 << endl;
57 <<
"pRVT : " << poseRVT << endl
58 <<
"newPoseRVT : " << newPoseRVT_2 << endl;
73 for (
size_t i=0;i<4;i++)
74 for (
size_t j=0;j<4;j++)
75 EXPECT_NEAR(HM(i,j), i==j ? 1.0 : 0.0, 1e-8 )
76 <<
"Failed for (i,j)=" << i <<
"," << j << endl
77 <<
"Matrix is: " << endl << HM << endl
78 <<
"case was: " << label << endl;
83 double x1,
double y1,
double z1,
double yaw1,
double pitch1,
84 double roll1,
double x2,
double y2,
double z2,
double yaw2,
85 double pitch2,
double roll2)
109 p1.getHomogeneousMatrix(M1);
110 p2.getHomogeneousMatrix(M2);
122 <<
"p1 : " << p1 << endl
123 <<
"p2 : " << p2 << endl
124 <<
"p1_c_p2_i_p2: " << p1_c_p2_i_p2 << endl;
132 <<
"p1 : " << p1 << endl
133 <<
"p2 : " << p2 << endl
134 <<
"p2 matrix : " << endl
136 <<
"p1_i_p2 : " << p1_i_p2 << endl
137 <<
"p1_i_p2 matrix: " << endl
138 << p1_i_p2.getHomogeneousMatrixVal() << endl
139 <<
"p2_c_p1_i_p2: " << p2_c_p1_i_p2 << endl;
147 <<
"p3 : " << p3 << endl
148 <<
"p1_c_p2 : " << p1_c_p2 << endl;
157 test_default_values(
p,
"Default");
165 EXPECT_NEAR(
p.m_coords[0], 1, 1e-7);
166 EXPECT_NEAR(
p.m_coords[1], 2, 1e-7);
167 EXPECT_NEAR(
p.m_coords[2], 3, 1e-7);
168 EXPECT_NEAR(
p.m_rotvec[0], 0.2, 1e-7);
169 EXPECT_NEAR(
p.m_rotvec[1], 0.3, 1e-7);
170 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...