46#ifndef _vpFeatureMomentCommon_h_
47#define _vpFeatureMomentCommon_h_
48#include <visp3/visual_features/vpFeatureMomentAlpha.h>
49#include <visp3/visual_features/vpFeatureMomentArea.h>
50#include <visp3/visual_features/vpFeatureMomentAreaNormalized.h>
51#include <visp3/visual_features/vpFeatureMomentBasic.h>
52#include <visp3/visual_features/vpFeatureMomentCInvariant.h>
53#include <visp3/visual_features/vpFeatureMomentCentered.h>
54#include <visp3/visual_features/vpFeatureMomentCommon.h>
55#include <visp3/visual_features/vpFeatureMomentDatabase.h>
56#include <visp3/visual_features/vpFeatureMomentGravityCenter.h>
57#include <visp3/visual_features/vpFeatureMomentGravityCenterNormalized.h>
158 vpMomentCommon mdb_dst(vpMomentCommon::getSurface(dst),vpMomentCommon::getMu3(dst),vpMomentCommon::getAlpha(dst),1.);
159 //Init classic features
160 vpFeatureMomentCommon fmdb_dst(mdb_dst);
162 //update+compute moment primitives from object (for source)
163 mdb_src.updateAll(src);
164 //update+compute features (+interaction matrices) from plane
165 fmdb_src.updateAll(0.,0.,1.);
167 //update+compute moment primitives from object (for destination)
168 mdb_dst.updateAll(dst);
169 //update+compute features (+interaction matrices) from plane
170 fmdb_dst.updateAll(0.,0.,1.);
172 //define visual servoing task
174 task.setServo(vpServo::EYEINHAND_CAMERA);
175 task.setInteractionMatrixType(vpServo::CURRENT);
177 //Add all classic features to the task
178 //In this example, source and destination features are translated by 0.1
179 //will produce a movement of 0.1 on x-axis.
180 task.addFeature(fmdb_src.getFeatureGravityNormalized(),fmdb_dst.getFeatureGravityNormalized());
181 task.addFeature(fmdb_src.getFeatureAn(),fmdb_dst.getFeatureAn());
182 //the object is NOT symmetric
184 task.addFeature(fmdb_src.getFeatureCInvariant(),fmdb_dst.getFeatureCInvariant(),(1 << 3) | (1 << 5));
185 task.addFeature(fmdb_src.getFeatureAlpha(),fmdb_dst.getFeatureAlpha());
188 vpColVector v = task.computeControlLaw() ;
195This code produces the following output:
199Eye-in-hand configuration
200Control in the camera frame
201List of visual features : s
2020.0166667,-0.00833333,
206List of desired visual features : s*
212-1 0 -6.938893904e-18 0.007291666667 -1.06875 -0.008333333333
2130 -1 3.469446952e-18 1.0171875 -0.007291666667 -0.01666666667
2150 0 -4.585529113e-15 -0.2983860943 0.5832596643 -4.376751552e-16
2160 0 -3.58244462e-15 0.08633028234 -0.2484618767 3.63421192e-16
2174.353086256e-17 -1.339411156e-16 -0 -0.03019436997 -0.0168230563 -1
219-0.1 0 0 1.831867991e-15 -1.072059108e-15 0
220Gain : Zero= 1 Inf= 1 Deriv= 0
238 void updateAll(
double A,
double B,
double C);
Functionality computation for in-plane rotation moment feature : computes the interaction matrix asso...
Functionality computation for normalized surface moment feature. Computes the interaction matrix asso...
Surface moment feature. Computes the interaction matrix associated with vpMomentArea.
Functionality computation for basic moment feature. Computes the interaction matrix associated with v...
Functionality computation for 2D rotation/translation/scale non-symmetric invariant moment feature....
Functionality computation for centered moment feature. Computes the interaction matrix associated wit...
vpFeatureMomentCentered & getFeatureCentered()
vpFeatureMomentAreaNormalized & getFeatureAn()
vpFeatureMomentArea & getFeatureArea()
vpFeatureMomentCommon(vpMomentDatabase &moments, double A=0.0, double B=0.0, double C=1.0)
vpFeatureMomentGravityCenterNormalized & getFeatureGravityNormalized()
vpFeatureMomentBasic & getFeatureMomentBasic()
vpFeatureMomentAlpha & getFeatureAlpha()
vpFeatureMomentCInvariant & getFeatureCInvariant()
vpFeatureMomentGravityCenter & getFeatureGravityCenter()
virtual void updateAll(double A=0.0, double B=0.0, double C=1.0)
vpFeatureMomentDatabase()
Functionality computation for centered and normalized moment feature. Computes the interaction matrix...
Functionality computation for gravity center moment feature. Computes the interaction matrix associat...
This class allows to register all vpMoments so they can access each other according to their dependen...