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

cost for traversing only odometry edges. More...

#include <estimate_propagator.h>

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

Public Member Functions

 EstimatePropagatorCostOdometry (SparseOptimizer *graph)
 
double operator() (OptimizableGraph::Edge *edge, const OptimizableGraph::VertexSet &from_, OptimizableGraph::Vertex *to_) const override
 
std::string_view name () const override
 
- Public Member Functions inherited from g2o::EstimatePropagatorCost
 EstimatePropagatorCost (SparseOptimizer *graph)
 

Additional Inherited Members

- Protected Attributes inherited from g2o::EstimatePropagatorCost
SparseOptimizer_graph
 

Detailed Description

cost for traversing only odometry edges.

Initialize your graph along odometry edges. An odometry edge is assumed to connect vertices whose IDs only differs by one.

Definition at line 65 of file estimate_propagator.h.

Constructor & Destructor Documentation

◆ EstimatePropagatorCostOdometry()

g2o::EstimatePropagatorCostOdometry::EstimatePropagatorCostOdometry ( SparseOptimizer graph)

Definition at line 248 of file estimate_propagator.cpp.

250 : EstimatePropagatorCost(graph) {}
EstimatePropagatorCost(SparseOptimizer *graph)

Member Function Documentation

◆ name()

std::string_view g2o::EstimatePropagatorCostOdometry::name ( ) const
inlineoverridevirtual

Reimplemented from g2o::EstimatePropagatorCost.

Definition at line 72 of file estimate_propagator.h.

72{ return "odometry"; }

◆ operator()()

double g2o::EstimatePropagatorCostOdometry::operator() ( OptimizableGraph::Edge edge,
const OptimizableGraph::VertexSet from_,
OptimizableGraph::Vertex to_ 
) const
overridevirtual

Reimplemented from g2o::EstimatePropagatorCost.

Definition at line 252 of file estimate_propagator.cpp.

254 {
255 OptimizableGraph::Edge* e = dynamic_cast<OptimizableGraph::Edge*>(edge);
256 OptimizableGraph::Vertex* from =
257 dynamic_cast<OptimizableGraph::Vertex*>(*from_.begin());
258 OptimizableGraph::Vertex* to = dynamic_cast<OptimizableGraph::Vertex*>(to_);
259 if (std::abs(from->id() - to->id()) !=
260 1) // simple method to identify odometry edges in a pose graph
261 return std::numeric_limits<double>::max();
262 SparseOptimizer::EdgeContainer::const_iterator it = _graph->findActiveEdge(e);
263 if (it == _graph->activeEdges().end()) // it has to be an active edge
264 return std::numeric_limits<double>::max();
265 return e->initialEstimatePossible(from_, to);
266}
const EdgeContainer & activeEdges() const
the edges active in the current optimization
EdgeContainer::const_iterator findActiveEdge(const OptimizableGraph::Edge *e) const

References g2o::EstimatePropagatorCost::_graph, g2o::SparseOptimizer::activeEdges(), g2o::SparseOptimizer::findActiveEdge(), g2o::HyperGraph::Vertex::id(), and g2o::OptimizableGraph::Edge::initialEstimatePossible().


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