g2o
Public Member Functions | Protected Attributes | List of all members
g2o::ThetaTreeAction Class Reference

compute the initial guess of theta while travelling along the MST More...

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

Public Member Functions

 ThetaTreeAction (double *theta)
 
virtual double perform (HyperGraph::Vertex *v, HyperGraph::Vertex *vParent, HyperGraph::Edge *e)
 
- Public Member Functions inherited from g2o::HyperDijkstra::TreeAction
virtual double perform (HyperGraph::Vertex *v, HyperGraph::Vertex *vParent, HyperGraph::Edge *e, double distance)
 

Protected Attributes

double * _thetaGuess
 

Detailed Description

compute the initial guess of theta while travelling along the MST

Definition at line 49 of file solver_slam2d_linear.cpp.

Constructor & Destructor Documentation

g2o::ThetaTreeAction::ThetaTreeAction ( double *  theta)
inline

Definition at line 52 of file solver_slam2d_linear.cpp.

52 : HyperDijkstra::TreeAction(), _thetaGuess(theta) {}

Member Function Documentation

virtual double g2o::ThetaTreeAction::perform ( HyperGraph::Vertex v,
HyperGraph::Vertex vParent,
HyperGraph::Edge e 
)
inlinevirtual

Reimplemented from g2o::HyperDijkstra::TreeAction.

Definition at line 53 of file solver_slam2d_linear.cpp.

References g2o::OptimizableGraph::Vertex::hessianIndex(), g2o::BaseEdge< D, E >::measurement(), g2o::SE2::rotation(), and g2o::HyperGraph::Edge::vertices().

54  {
55  if (! vParent)
56  return 0.;
57  EdgeSE2* odom = static_cast<EdgeSE2*>(e);
58  VertexSE2* from = static_cast<VertexSE2*>(vParent);
59  VertexSE2* to = static_cast<VertexSE2*>(v);
60  assert(to->hessianIndex() >= 0);
61  double fromTheta = from->hessianIndex() < 0 ? 0. : _thetaGuess[from->hessianIndex()];
62  bool direct = odom->vertices()[0] == from;
63  if (direct)
64  _thetaGuess[to->hessianIndex()] = fromTheta + odom->measurement().rotation().angle();
65  else
66  _thetaGuess[to->hessianIndex()] = fromTheta - odom->measurement().rotation().angle();
67  return 1.;
68  }

Member Data Documentation

double* g2o::ThetaTreeAction::_thetaGuess
protected

Definition at line 70 of file solver_slam2d_linear.cpp.


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