g2o
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)
 
virtual double operator() (OptimizableGraph::Edge *edge, const OptimizableGraph::VertexSet &from_, OptimizableGraph::Vertex *to_) const
 
virtual const char * name () const
 
- 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 62 of file estimate_propagator.h.

Constructor & Destructor Documentation

g2o::EstimatePropagatorCostOdometry::EstimatePropagatorCostOdometry ( SparseOptimizer graph)

Definition at line 252 of file estimate_propagator.cpp.

252  :
254  {
255  }
EstimatePropagatorCost(SparseOptimizer *graph)
Protocol The SLAM executable accepts such as solving the and retrieving or vertices in the graph
Definition: protocol.txt:7

Member Function Documentation

virtual const char* g2o::EstimatePropagatorCostOdometry::name ( ) const
inlinevirtual

Reimplemented from g2o::EstimatePropagatorCost.

Definition at line 66 of file estimate_propagator.h.

66 { return "odometry";}
double g2o::EstimatePropagatorCostOdometry::operator() ( OptimizableGraph::Edge edge,
const OptimizableGraph::VertexSet from_,
OptimizableGraph::Vertex to_ 
) const
virtual

Reimplemented from g2o::EstimatePropagatorCost.

Definition at line 257 of file estimate_propagator.cpp.

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

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

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