#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);
bool getOptions(int argc, const char **argv);
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)
{
try {
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::endl;
std::cout <<
"n" <<std::endl << n.
t() << std::endl;
}
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::endl;
std::cout <<
"n" <<std::endl << n.
t() << std::endl;
}
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::endl;
std::cout <<
"n" <<std::endl << n.
t() << std::endl;
H.buildFrom(R,T,p1) ;
std::cout << "H" << std::endl << H << std::endl ;
}
return 0;
}
std::cout << "Catch an exception: " << e << std::endl;
return 1;
}
}