48 #include <visp3/core/vpPoseVector.h>
50 bool test(
const std::string &s,
const vpArray2D<double> &A,
const std::vector<double> &bench)
52 static unsigned int cpt = 0;
53 std::cout <<
"** Test " << ++cpt << std::endl;
54 std::cout << s <<
"(" << A.
getRows() <<
"," << A.
getCols() <<
") =" << A << std::endl;
55 if(bench.size() != A.
size()) {
56 std::cout <<
"Test fails: bad size wrt bench" << std::endl;
59 for (
unsigned int i=0; i<A.
size(); i++) {
60 if (std::fabs(A.
data[i]-bench[i]) > std::fabs(A.
data[i])*std::numeric_limits<double>::epsilon()) {
61 std::cout <<
"Test fails: bad content" << std::endl;
72 std::vector<double> bench(6,0);
74 if (test(
"p", p, bench) ==
false)
76 p[0] = bench[0] = 0.1;
77 p[1] = bench[1] = 0.2;
78 p[2] = bench[2] = 0.3;
83 if (test(
"p", p, bench) ==
false)
87 if (test(
"p1", p1, bench) ==
false)
90 if (test(
"p2", p2, bench) ==
false)
93 if (test(
"p3", p3, bench) ==
false)
96 p4.
set(p[0], p[1], p[2], p[3], p[4], p[5]);
97 if (test(
"p4", p4, bench) ==
false)
103 if (test(
"p5", p5, bench) ==
false)
107 if (test(
"p6", p6, bench) ==
false)
112 if (test(
"p7", p7, bench) ==
false)
116 if (test(
"p8", p8, bench) ==
false)
121 if (test(
"p9", p9, bench) ==
false)
125 if (test(
"p10", p10, bench) ==
false)
128 std::cout <<
"All tests succeed" << std::endl;
Implementation of an homogeneous matrix and operations on such kind of matrices.
Type * data
Address of the first element of the data array.
unsigned int size() const
Return the number of elements of the 2D array.
unsigned int getCols() const
Return the number of columns of the 2D array.
Implementation of a rotation matrix and operations on such kind of matrices.
void set(const double tx, const double ty, const double tz, const double tux, const double tuy, const double tuz)
unsigned int getRows() const
Return the number of rows of the 2D array.
static double rad(double deg)
Implementation of a pose vector and operations on poses.
vpPoseVector buildFrom(const double tx, const double ty, const double tz, const double tux, const double tuy, const double tuz)
Class that consider the case of a translation vector.
Implementation of a rotation vector as axis-angle minimal representation.