45 double euc_noise = 0.01;
59 vector<Vector3d> true_points;
60 for (
size_t i = 0; i < 1000; ++i) {
61 true_points.push_back(
69 for (
size_t i = 0; i < 2; ++i) {
75 Eigen::Isometry3d cam;
77 cam.translation() = t;
85 cerr << t.transpose() <<
" | " << q.coeffs().transpose() << endl;
97 for (
size_t i = 0; i < true_points.size(); ++i) {
106 pt0 = vp0->
estimate().inverse() * true_points[i];
107 pt1 = vp1->
estimate().inverse() * true_points[i];
156 Eigen::Isometry3d cam = vc->
estimate();
157 cam.translation() = Vector3d(0, 0, 0.2);
162 cout <<
"Initial chi2 = " << FIXED(optimizer.
chi2()) << endl;
168 cout << endl <<
"Second vertex should be near 0,0,1" << endl;
169 cout << dynamic_cast<VertexSE3*>(optimizer.
vertices().find(0)->second)
174 cout << dynamic_cast<VertexSE3*>(optimizer.
vertices().find(1)->second)
EIGEN_STRONG_INLINE const Measurement & measurement() const
accessor functions for the measurement represented by the edge
virtual void setMeasurement(const Measurement &m)
EIGEN_STRONG_INLINE const InformationType & information() const
information matrix of the constraint
const EstimateType & estimate() const
return the current estimate of the vertex
void setEstimate(const EstimateType &et)
set the estimate for the vertex also calls updateCache()
void setVertex(size_t i, Vertex *v)
const VertexIDMap & vertices() const
linear solver using dense cholesky decomposition
virtual void setId(int id)
void setFixed(bool fixed)
true => this node should be considered fixed during the optimization
Implementation of the Levenberg Algorithm.
static double gaussRand(double mean, double sigma)
static double uniformRand(double lowerBndr, double upperBndr)
void computeActiveErrors()
int optimize(int iterations, bool online=false)
void setVerbose(bool verbose)
virtual bool initializeOptimization(HyperGraph::EdgeSet &eset)
void setAlgorithm(OptimizationAlgorithm *algorithm)
3D pose Vertex, represented as an Isometry3
virtual bool addEdge(HyperGraph::Edge *e)
virtual bool addVertex(HyperGraph::Vertex *v, Data *userData)
double chi2() const
returns the chi2 of the current configuration