65 cerr <<
"Projecting marginals" << endl;
66 std::vector<std::pair<int, int> > blockIndices;
81 cerr <<
"Vertex id:" << v->
id() << endl;
83 cerr <<
"increments block :" << v->
hessianIndex() <<
", "
92 std::vector<MySigmaPoint> spts;
98 std::vector<MySigmaPoint> tspts = spts;
100 for (
size_t j = 0; j < spts.size(); j++) {
107 v->
oplus(&(spts[j]._sample[0]));
109 tspts[j]._sample = mean;
118 cerr <<
"mean: " << endl;
119 cerr << mean << endl;
120 cerr <<
"oldMean: " << endl;
121 cerr << oldMean << endl;
122 cerr <<
"cov: " << endl;
123 cerr << cov2 << endl;
135 MatrixXd m = MatrixXd(6, 6);
136 for (
int i = 0; i < 6; i++) {
137 for (
int j = i; j < 6; j++) {
138 m(i, j) = m(j, i) = i * j + 1;
141 m += MatrixXd::Identity(6, 6);
146 std::vector<MySigmaPoint> spts;
148 for (
size_t i = 0; i < spts.size(); i++) {
149 cerr <<
"Point " << i <<
" " << endl
150 <<
"wi=" << spts[i]._wi <<
" wp=" << spts[i]._wp <<
" " << endl;
151 cerr << spts[i]._sample << endl;
155 MatrixXd recCov(6, 6);
159 cerr <<
"recMean" << endl;
160 cerr << recMean << endl;
162 cerr <<
"recCov" << endl;
163 cerr << recCov << endl;
int id() const
returns the id
A general case Vertex for optimization.
virtual void push()=0
backup the position of the vertex to a stack
virtual bool getMinimalEstimateData(double *estimate) const
virtual int minimalEstimateDimension() const
void oplus(const double *v)
Sparse matrix which uses blocks.
SparseMatrixBlock * block(int r, int c, bool alloc=false)
const VertexContainer & activeVertices() const
the vertices active in the current optimization
bool computeMarginals(SparseBlockMatrix< MatrixX > &spinv, const std::vector< std::pair< int, int > > &blockIndices)
void testMarginals(SparseOptimizer &optimizer)
void reconstructGaussian(SampleType &mean, CovarianceType &covariance, const std::vector< SigmaPoint< SampleType > > &sigmaPoints)
bool sampleUnscented(std::vector< SigmaPoint< SampleType > > &sigmaPoints, const SampleType &mean, const CovarianceType &covariance)
SigmaPoint< VectorXd > MySigmaPoint
utility functions for handling time related stuff