ViSP
HelloWorld.cpp
1 #include <iostream>
2 #include <visp/vpMath.h>
3 #include <visp/vpRotationMatrix.h>
4 #include <visp/vpThetaUVector.h>
5 #include <limits>
6 
7 int main()
8 {
9  try {
10  vpThetaUVector tu;
11 
12  // Construct a rotation matrix from the theta U angles
13  vpRotationMatrix R(vpMath::rad(0.),vpMath::rad(180)+100*std::numeric_limits<double>::epsilon(),0.);
14 
15  // Extract the theta U angles from a rotation matrix
16  tu.buildFrom(R);
17 
18  // Since the rotation vector is 3 values column vector, the
19  // transpose operation produce a row vector.
20  vpRowVector tu_t = tu.t();
21 
22  // Print the transpose row vector
23  std::cout << tu_t << std::endl;
24  return 0;
25  }
26  catch(vpException e) {
27  std::cout << "Catch an exception: " << e << std::endl;
28  return 1;
29  }
30 }
Definition of the row vector class.
Definition: vpRowVector.h:73
vpRowVector t() const
error that can be emited by ViSP classes.
Definition: vpException.h:76
vpThetaUVector buildFrom(const vpHomogeneousMatrix &M)
The vpRotationMatrix considers the particular case of a rotation matrix.
static double rad(double deg)
Definition: vpMath.h:100
Class that consider the case of the parameterization for the rotation.