#include <visp/vpMath.h>
#include <visp/vpRotationMatrix.h>
#include <visp/vpHomography.h>
#include <visp/vpDebug.h>
#include <visp/vpThetaUVector.h>
#include <visp/vpParseArgv.h>
#include <stdlib.h>
#include <stdio.h>
#define GETOPTARGS "h"
void usage(const char *name, const char *badparam)
{
fprintf(stdout, "\n\
Tests transformation within various representations of rotation.\n\
\n\
SYNOPSIS\n\
%s [-h]\n", name);
fprintf(stdout, "\n\
OPTIONS: Default\n\
-h\n\
Print the help.\n");
if (badparam)
fprintf(stdout, "\nERROR: Bad parameter [%s]\n", badparam);
}
bool getOptions(int argc, const char **argv)
{
const char *optarg;
int c;
switch (c) {
case 'h': usage(argv[0], NULL); return false; break;
default:
usage(argv[0], optarg);
return false; break;
}
}
if ((c == 1) || (c == -1)) {
usage(argv[0], NULL);
std::cerr << "ERROR: " << std::endl;
std::cerr << " Bad argument " << optarg << std::endl << std::endl;
return false;
}
return true;
}
int
main(int argc, const char ** argv)
{
if (getOptions(argc, argv) == false) {
exit (-1);
}
{
std::cout << "Initialization " <<std::endl ;
std::cout << "From vpThetaUVector to vpRotationMatrix " << std::endl ;
std::cout << "M" <<std::endl <<M << std::endl ;
std::cout << "H" <<std::endl <<H << std::endl ;
H.computeDisplacement(R,T,n) ;
std::cout << "R" <<std::endl << R ;
std::cout <<
"T" <<std::endl << T.
t() ;
std::cout <<
"n" <<std::endl << n.
t() ;
}
std::cout <<"------------------------------------------------------" << std::endl ;
{
std::cout << "Initialization " <<std::endl ;
std::cout << "From vpThetaUVector to vpRotationMatrix " << std::endl ;
M[0][3] = 0.21 ;
M[1][3] = 0.31 ;
M[2][3] = 0.5 ;
std::cout << "M" <<std::endl <<M << std::endl ;
std::cout << "H" <<std::endl <<H << std::endl ;
H.computeDisplacement(R,T,n) ;
std::cout << "R" <<std::endl << R ;
std::cout <<
"T" <<std::endl << T.
t() ;
std::cout <<
"n" <<std::endl << n.
t() ;
}
std::cout <<"------------------------------------------------------" << std::endl ;
{
M[0][3] = 0.21 ;
M[1][3] =- 0.31 ;
M[2][3] = 0.5 ;
std::cout << "M" <<std::endl <<M << std::endl ;
std::cout << "H" <<std::endl <<H << std::endl ;
H.computeDisplacement(R,T,n) ;
std::cout << "R" <<std::endl << R ;
std::cout <<
"T" <<std::endl << T.
t() ;
std::cout <<
"n" <<std::endl << n.
t() ;
H.buildFrom(R,T,p1) ;
std::cout << "H" <<std::endl <<H << std::endl ;
}
}