27 #ifndef G2O_BASE_EDGE_H 28 #define G2O_BASE_EDGE_H 39 using namespace Eigen;
41 template <
int D,
typename E>
46 static const int Dimension = D;
58 virtual double chi2()
const 60 return _error.dot(information()*_error);
63 virtual const double*
errorData()
const {
return _error.data();}
64 virtual double*
errorData() {
return _error.data();}
65 const ErrorVector&
error()
const {
return _error;}
66 ErrorVector&
error() {
return _error;}
69 const InformationType&
information()
const {
return _information;}
71 void setInformation(
const InformationType& information) { _information = information;}
77 const Measurement&
measurement()
const {
return _measurement;}
80 virtual int rank()
const {
return _dimension;}
84 std::cerr <<
"inititialEstimate() is not implemented, please give implementation in your derived class" << std::endl;
98 InformationType result = rho[1] * _information;
105 EIGEN_MAKE_ALIGNED_OPERATOR_NEW
const Measurement & measurement() const
accessor functions for the measurement represented by the edge
std::set< Vertex * > VertexSet
virtual double chi2() const
computes the chi2 based on the cached error value, only valid after computeError has been called...
InformationType _information
const InformationType & information() const
information matrix of the constraint
virtual void setMeasurement(const Measurement &m)
virtual double * informationData()
InformationType & information()
virtual void initialEstimate(const OptimizableGraph::VertexSet &, OptimizableGraph::Vertex *)
const ErrorVector & error() const
Matrix< double, D, 1 > ErrorVector
A general case Vertex for optimization.
virtual const double * informationData() const
returns the memory of the information matrix, usable for example with a Eigen::Map<MatrixXd> ...
virtual const double * errorData() const
returns the error vector cached after calling the computeError;
InformationType robustInformation(const Eigen::Vector3d &rho)
virtual double * errorData()
Matrix< double, D, D > InformationType
void setInformation(const InformationType &information)