62 bool direct = odom->
vertices()[0] == from;
73 SolverSLAM2DLinear::SolverSLAM2DLinear(
Solver* solver) :
87 return OptimizationAlgorithm::Fail;
101 typedef Eigen::Matrix<double, 1, 1, Eigen::ColMajor> ScalarMatrix;
105 blockIndeces[i] = i+1;
113 ScalarMatrix* m = H.block(poseIdx, poseIdx,
true);
123 assert(e &&
"Active edges contain non-odometry edge");
132 if (ind1 == -1 || ind2 == -1) {
133 if (ind1 == -1) fixedSet.insert(from);
134 if (ind2 == -1) fixedSet.insert(to);
138 bool transposedBlock = ind1 > ind2;
139 if (transposedBlock){
140 std::swap(ind1, ind2);
143 ScalarMatrix* m = H.block(ind1, ind2,
true);
148 assert(fixedSet.size() == 1);
172 bool fromNotFixed = !(from->
fixed());
173 bool toNotFixed = !(to->
fixed());
175 if (fromNotFixed || toNotFixed) {
176 double omega_r = - omega * error;
196 SystemSolver linearSystemSolver;
197 linearSystemSolver.
init();
198 bool ok = linearSystemSolver.solve(H, x.data(), b.data());
#define __PRETTY_FUNCTION__
some general case utility functions
2D edge between two Vertex2
static void computeTree(AdjacencyMap &amap)
std::set< Vertex * > VertexSet
virtual double perform(HyperGraph::Vertex *v, HyperGraph::Vertex *vParent, HyperGraph::Edge *e)
const EdgeContainer & activeEdges() const
the edges active in the current optimization
int hessianIndex() const
temporary index of this node in the parameter vector obtained from linearization
2D pose Vertex, (x,y,theta)
const VertexIDMap & vertices() const
Implementation of the Gauss Newton Algorithm.
Vertex * vertex(int id)
returns the vertex number id appropriately casted
static void visitAdjacencyMap(AdjacencyMap &amap, TreeAction *action, bool useDistance=false)
const VertexContainer & vertices() const
const Eigen::Rotation2Dd & rotation() const
rotational component
void shortestPaths(HyperGraph::Vertex *v, HyperDijkstra::CostFunction *cost, double maxDistance=std::numeric_limits< double >::max(), double comparisonConditioner=1e-3, bool directed=false, double maxEdgeCost=std::numeric_limits< double >::max())
linear solver which uses CSparse
ThetaTreeAction(double *theta)
virtual ~SolverSLAM2DLinear()
Generic interface for a sparse solver operating on a graph which solves one iteration of the lineariz...
SparseOptimizer * _optimizer
the optimizer the solver is working on
const VertexContainer & indexMapping() const
the index mapping of the vertices
double normalize_theta(double theta)
void setEstimate(const EstimateType &et)
set the estimate for the vertex also calls updateCache()
A general case Vertex for optimization.
compute the initial guess of theta while travelling along the MST
abstract Vertex, your types must derive from that one
Eigen::Matrix< double, Eigen::Dynamic, 1, Eigen::ColMajor > VectorXD
EIGEN_STRONG_INLINE const InformationType & information() const
information matrix of the constraint
virtual OptimizationAlgorithm::SolverResult solve(int iteration, bool online=false)
AdjacencyMap & adjacencyMap()
virtual SolverResult solve(int iteration, bool online=false)
bool fixed() const
true => this node is fixed during the optimization
a scoped pointer for an array, i.e., array will be deleted on leaving the scope
Sparse matrix which uses blocks.
EIGEN_STRONG_INLINE const Measurement & measurement() const
accessor functions for the measurement represented by the edge