g2o
Loading...
Searching...
No Matches
g2o::ThetaTreeAction Class Reference

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

Inheritance diagram for g2o::ThetaTreeAction:
Collaboration diagram for g2o::ThetaTreeAction:

Public Member Functions

 ThetaTreeAction (VectorX &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

VectorX & _thetaGuess

Detailed Description

compute the initial guess of theta while traveling along the MST

Definition at line 48 of file solver_slam2d_linear.cpp.

Constructor & Destructor Documentation

◆ ThetaTreeAction()

g2o::ThetaTreeAction::ThetaTreeAction ( VectorX & theta)
inlineexplicit

Definition at line 50 of file solver_slam2d_linear.cpp.

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

References _thetaGuess.

Member Function Documentation

◆ perform()

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

Reimplemented from g2o::HyperDijkstra::TreeAction.

Definition at line 52 of file solver_slam2d_linear.cpp.

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

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

Member Data Documentation

◆ _thetaGuess

VectorX& g2o::ThetaTreeAction::_thetaGuess
protected

Definition at line 72 of file solver_slam2d_linear.cpp.

Referenced by perform(), and ThetaTreeAction().


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