g2o
Loading...
Searching...
No Matches
Public Member Functions | Protected Attributes | List of all members
g2o::EstimatePropagatorCost Class Reference

cost for traversing along active edges in the optimizer More...

#include <estimate_propagator.h>

Inheritance diagram for g2o::EstimatePropagatorCost:
Inheritance graph
[legend]
Collaboration diagram for g2o::EstimatePropagatorCost:
Collaboration graph
[legend]

Public Member Functions

 EstimatePropagatorCost (SparseOptimizer *graph)
 
virtual double operator() (OptimizableGraph::Edge *edge, const OptimizableGraph::VertexSet &from, OptimizableGraph::Vertex *to_) const
 
virtual std::string_view name () const
 

Protected Attributes

SparseOptimizer_graph
 

Detailed Description

cost for traversing along active edges in the optimizer

You may derive an own one, if necessary. The default is to return initialEstimatePossible(from, to) for the edge.

Definition at line 47 of file estimate_propagator.h.

Constructor & Destructor Documentation

◆ EstimatePropagatorCost()

g2o::EstimatePropagatorCost::EstimatePropagatorCost ( SparseOptimizer graph)

Definition at line 234 of file estimate_propagator.cpp.

235 : _graph(graph) {}

Member Function Documentation

◆ name()

virtual std::string_view g2o::EstimatePropagatorCost::name ( ) const
inlinevirtual

Reimplemented in g2o::EstimatePropagatorCostOdometry.

Definition at line 53 of file estimate_propagator.h.

53{ return "spanning tree"; }

Referenced by g2o::SparseOptimizer::computeInitialGuess().

◆ operator()()

double g2o::EstimatePropagatorCost::operator() ( OptimizableGraph::Edge edge,
const OptimizableGraph::VertexSet from,
OptimizableGraph::Vertex to_ 
) const
virtual

Reimplemented in g2o::EstimatePropagatorCostOdometry.

Definition at line 237 of file estimate_propagator.cpp.

239 {
240 OptimizableGraph::Edge* e = dynamic_cast<OptimizableGraph::Edge*>(edge);
241 OptimizableGraph::Vertex* to = dynamic_cast<OptimizableGraph::Vertex*>(to_);
242 SparseOptimizer::EdgeContainer::const_iterator it = _graph->findActiveEdge(e);
243 if (it == _graph->activeEdges().end()) // it has to be an active edge
244 return std::numeric_limits<double>::max();
245 return e->initialEstimatePossible(from, to);
246}
const EdgeContainer & activeEdges() const
the edges active in the current optimization
EdgeContainer::const_iterator findActiveEdge(const OptimizableGraph::Edge *e) const

References _graph, g2o::SparseOptimizer::activeEdges(), g2o::SparseOptimizer::findActiveEdge(), and g2o::OptimizableGraph::Edge::initialEstimatePossible().

Member Data Documentation

◆ _graph

SparseOptimizer* g2o::EstimatePropagatorCost::_graph
protected

The documentation for this class was generated from the following files: