41 #include <visp/vpMomentObject.h>
42 #include <visp/vpMomentDatabase.h>
43 #include <visp/vpMomentCommon.h>
44 #include <visp/vpFeatureMomentCommon.h>
45 #include <visp/vpHomogeneousMatrix.h>
46 #include <visp/vpServo.h>
47 #include <visp/vpDebug.h>
48 #include <visp/vpPlane.h>
59 void planeToABC(
const vpPlane& pl,
double& A,
double& B,
double& C);
60 int test(
double x,
double y,
double z,
double alpha);
67 for(
double i=-0.2;i<0.2;i+=0.1){
68 for(
double j=-0.2;j<0.2;j+=0.1){
70 for(
double l=0.5;l<1.5;l+=0.1){
81 std::cout <<
"Catch an exception: " << e << std::endl;
86 int test(
double x,
double y,
double z,
double alpha){
97 initScene(cMo, cdMo, src, dst);
99 vpMatrix mat = execute(cMo, cdMo, src, dst);
101 if(fabs(mat[0][0]-(-1)) > std::numeric_limits<double>::epsilon()*1e10)
return -1;
102 if(fabs(mat[0][1]-(0)) > std::numeric_limits<double>::epsilon()*1e10)
return -1;
103 if(fabs(mat[0][2]-(0)) > std::numeric_limits<double>::epsilon()*1e10)
return -1;
105 if(fabs(mat[1][0]-(0)) > std::numeric_limits<double>::epsilon()*1e10)
return -1;
106 if(fabs(mat[1][1]-(-1)) > std::numeric_limits<double>::epsilon()*1e10)
return -1;
107 if(fabs(mat[1][2]-(0)) > std::numeric_limits<double>::epsilon()*1e10)
return -1;
109 if(fabs(mat[2][0]-(0)) > std::numeric_limits<double>::epsilon()*1e10)
return -1;
110 if(fabs(mat[2][1]-(0)) > std::numeric_limits<double>::epsilon()*1e10)
return -1;
111 if(fabs(mat[2][2]-(-1)) > std::numeric_limits<double>::epsilon()*1e10)
return -1;
112 if(fabs(mat[2][5]-(0)) > std::numeric_limits<double>::epsilon()*1e10)
return -1;
114 if(fabs(mat[3][0]-(0)) > std::numeric_limits<double>::epsilon()*1e10)
return -1;
115 if(fabs(mat[3][1]-(0)) > std::numeric_limits<double>::epsilon()*1e10)
return -1;
116 if(fabs(mat[3][2]-(0)) > std::numeric_limits<double>::epsilon()*1e10)
return -1;
117 if(fabs(mat[3][5]-(0)) > std::numeric_limits<double>::epsilon()*1e10)
return -1;
119 if(fabs(mat[4][0]-(0)) > std::numeric_limits<double>::epsilon()*1e10)
return -1;
120 if(fabs(mat[4][1]-(0)) > std::numeric_limits<double>::epsilon()*1e10)
return -1;
121 if(fabs(mat[4][2]-(0)) > std::numeric_limits<double>::epsilon()*1e10)
return -1;
122 if(fabs(mat[4][5]-(0)) > std::numeric_limits<double>::epsilon()*1e10)
return -1;
124 if(fabs(mat[5][0]-(0)) > std::numeric_limits<double>::epsilon()*1e10)
return -1;
125 if(fabs(mat[5][1]-(0)) > std::numeric_limits<double>::epsilon()*1e10)
return -1;
126 if(fabs(mat[5][2]-(0)) > std::numeric_limits<double>::epsilon()*1e10)
return -1;
127 if(fabs(mat[5][5]-(-1)) > std::numeric_limits<double>::epsilon()*1e10)
return -1;
135 std::vector<vpPoint> src_pts;
136 std::vector<vpPoint> dst_pts;
138 double x[5] = { 0.2, 0.2,-0.2,-0.2, 0.2 };
139 double y[5] = {-0.1, 0.1, 0.1,-0.1,-0.1 };
142 for (
int i = 0 ; i < nbpoints ; i++){
146 src_pts.push_back(p);
151 for (
int i = 0 ; i < nbpoints ; i++){
155 dst_pts.push_back(p);
170 double A;
double B;
double C;
171 double Ad;
double Bd;
double Cd;
178 planeToABC(pl,A,B,C);
182 planeToABC(pl,Ad,Bd,Cd);
220 void planeToABC(
const vpPlane& pl,
double& A,
double& B,
double& C)
Definition of the vpMatrix class.
The class provides a data structure for the homogeneous matrices as well as a set of operations on th...
void addFeature(vpBasicFeature &s, vpBasicFeature &s_star, const unsigned int select=vpBasicFeature::FEATURE_ALL)
This class allows to access common vpFeatureMoments in a pre-filled database.
error that can be emited by ViSP classes.
void setABCD(const double a, const double b, const double c, const double d)
Class for generic objects.
void track(const vpHomogeneousMatrix &cMo)
Class that defines what is a point.
vpMatrix computeInteractionMatrix()
vpColVector computeControlLaw()
vpFeatureMomentAlpha & getFeatureAlpha()
void updateAll(double A, double B, double C)
void changeFrame(const vpHomogeneousMatrix &cMo)
static std::vector< double > getMu3(vpMomentObject &object)
void extract(vpRotationMatrix &R) const
vpServoIteractionMatrixType
void fromVector(std::vector< vpPoint > &points)
static double getSurface(vpMomentObject &object)
void setInteractionMatrixType(const vpServoIteractionMatrixType &interactionMatrixType, const vpServoInversionType &interactionMatrixInversion=PSEUDO_INVERSE)
vpFeatureMomentCInvariant & getFeatureCInvariant()
static double rad(double deg)
void updateAll(vpMomentObject &object)
This class initializes and allows access to commonly used moments.
static double getAlpha(vpMomentObject &object)
vpFeatureMomentGravityCenterNormalized & getFeatureGravityNormalized()
void setType(vpObjectType input_type)
This class defines the container for a plane geometrical structure.
vpFeatureMomentAreaNormalized & getFeatureAn()
void setServo(const vpServoType &servo_type)
Class that consider the case of a translation vector.
void setWorldCoordinates(const double ox, const double oy, const double oz)
Set the point world coordinates. We mean here the coordinates of the point in the object frame...