g2o
Loading...
Searching...
No Matches
Namespaces | Classes | Typedefs | Enumerations | Functions | Variables
g2o Namespace Reference

Namespaces

namespace  bal
 
namespace  ceres
 
namespace  cholmod
 
namespace  csparse
 
namespace  csparse_extension
 
namespace  internal
 
namespace  logging
 
namespace  opengl
 
namespace  tutorial
 
namespace  types_icp
 

Classes

class  AbstractHyperGraphElementCreator
 Abstract interface for allocating HyperGraphElement. More...
 
class  AbstractOptimizationAlgorithmCreator
 base for allocating an optimization algorithm More...
 
class  AbstractRobustKernelCreator
 Abstract interface for allocating a robust kernel. More...
 
struct  aligned_deleter
 
class  AutoDifferentiation
 Implementation of Automatic Differentiation for edges in g2o. More...
 
struct  BackBoneTreeAction
 
class  BaseBinaryEdge
 
class  BaseDynamicVertex
 
class  BaseEdge
 
class  BaseFixedSizedEdge
 
class  BaseProperty
 
class  BaseRobot
 
class  BaseSensor
 
class  BaseUnaryEdge
 
class  BaseVariableSizedEdge
 base class to represent an edge connecting an arbitrary number of nodes More...
 
class  BaseVertex
 Templatized BaseVertex. More...
 
class  BaseWorldObject
 
class  BinarySensor
 
class  BlockSolver
 Implementation of a solver operating on the blocks of the Hessian. More...
 
class  BlockSolverBase
 base for the block solvers with some basic function interfaces More...
 
struct  BlockSolverTraits
 traits to summarize the properties of the fixed size optimization problem More...
 
struct  BlockSolverTraits< Eigen::Dynamic, Eigen::Dynamic >
 traits to summarize the properties of the dynamic size optimization problem More...
 
class  Cache
 
class  CacheCamera
 
class  CacheContainer
 
class  CacheSE2Offset
 caching the offset related to a vertex More...
 
class  CacheSE3Offset
 caching the offset related to a vertex More...
 
class  CameraParameters
 
class  CholmodSolverCreator
 
class  ClosedFormCalibration
 Simultaneous calibration of the laser offset and the parameters of a differential drive. More...
 
struct  CmpPairFirst
 
struct  ColSort
 
class  CommandArgs
 Command line parsing of argc and argv. More...
 
class  CSparseSolverCreator
 
class  DataQueue
 a simple queue to store data and retrieve based on a timestamp More...
 
class  DenseSolverCreator
 
class  DlWrapper
 Loading libraries during run-time. More...
 
class  DrawAction
 draw actions More...
 
struct  dynamic_aligned_buffer
 
class  Edge_V_V_GICP
 
class  Edge_XYZ_VSC
 Point vertex, XYZ, is in types_sba. More...
 
struct  EdgeCreator
 
class  EdgeGICP
 
class  EdgeInverseSim3ProjectXYZ
 
struct  EdgeLabeler
 
class  EdgeLine2D
 
class  EdgeLine2DPointXY
 
class  EdgePlane
 
class  EdgePointXY
 
class  EdgePointXYZ
 
class  EdgeProjectP2MC
 
class  EdgeProjectP2SC
 
class  EdgeProjectPSI2UV
 
class  EdgeProjectXYZ2UV
 
class  EdgeProjectXYZ2UVU
 
class  EdgeSBACam
 3D edge between two SBAcam More...
 
class  EdgeSBAScale
 edge between two SBAcam that specifies the distance between them More...
 
class  EdgeSE2
 2D edge between two Vertex2 More...
 
class  EdgeSE2Line2D
 
class  EdgeSE2LotsOfXY
 
class  EdgeSE2OdomDifferentialCalib
 
class  EdgeSE2Offset
 Offset edge. More...
 
class  EdgeSE2PointXY
 
class  EdgeSE2PointXYBearing
 
class  EdgeSE2PointXYBearingWriteGnuplotAction
 
class  EdgeSE2PointXYCalib
 Landmark measurement that also calibrates an offset for the landmark measurement. More...
 
class  EdgeSE2PointXYOffset
 g2o edge from a track to a point node More...
 
class  EdgeSE2PointXYWriteGnuplotAction
 
class  EdgeSE2Prior
 Prior for a two D pose. More...
 
class  EdgeSE2PureCalib
 calibrate odometry and laser based on a set of measurements More...
 
class  EdgeSE2Segment2D
 
class  EdgeSE2Segment2DLine
 
class  EdgeSE2Segment2DPointLine
 
class  EdgeSE2SensorCalib
 scanmatch measurement that also calibrates an offset for the laser More...
 
class  EdgeSE2TwoPointsXY
 
class  EdgeSE2WriteGnuplotAction
 
class  EdgeSE2XYPrior
 Prior for a two D pose with constraints only in xy direction (like gps) More...
 
class  EdgeSE3
 Edge between two 3D pose vertices. More...
 
class  EdgeSE3Calib
 Landmark measurement that also calibrates an offset for the landmark measurement. More...
 
class  EdgeSE3Euler
 3D edge between two VertexSE3, uses the euler angle parameterization for the read/write functions only. More...
 
class  EdgeSE3Expmap
 6D edge between two Vertex6 More...
 
class  EdgeSE3Line3D
 
class  EdgeSE3LotsOfXYZ
 
class  EdgeSE3Offset
 Offset edge. More...
 
class  EdgeSE3PlaneSensorCalib
 plane measurement that also calibrates an offset for the sensor More...
 
class  EdgeSE3PointXYZ
 g2o edge from a track to a point node More...
 
class  EdgeSE3PointXYZDepth
 
class  EdgeSE3PointXYZDisparity
 edge from a track to a depth camera node using a disparity measurement More...
 
class  EdgeSE3Prior
 prior for an SE3 element More...
 
class  EdgeSE3ProjectXYZ
 
class  EdgeSE3ProjectXYZOnlyPose
 
class  EdgeSE3WriteGnuplotAction
 Output the pose-pose constraint to Gnuplot data file. More...
 
class  EdgeSE3XYZPrior
 Prior for a 3D pose with constraints only in xyz direction. More...
 
class  EdgeSim3
 7D edge between two Vertex7 More...
 
class  EdgeSim3ProjectXYZ
 
class  EdgeStereoSE3ProjectXYZ
 
class  EdgeStereoSE3ProjectXYZOnlyPose
 
struct  EdgeTypesCostFunction
 
class  EdgeXYPrior
 
class  EdgeXYZPrior
 prior for an XYZ vertex (VertexPointXYZ) More...
 
class  EigenSolverCreator
 
struct  EstimateAccessor
 
class  EstimateAccessorGet
 
class  EstimatePropagator
 propagation of an initial guess More...
 
class  EstimatePropagatorCost
 cost for traversing along active edges in the optimizer More...
 
class  EstimatePropagatorCostOdometry
 cost for traversing only odometry edges. More...
 
class  Factory
 create vertices and edges based on TAGs in, for example, a file More...
 
struct  ForceLinker
 
struct  G2OBatchStatistics
 statistics about the optimization More...
 
class  G2oQGLViewer
 OpenGL based viewer for the graph. More...
 
class  G2oSlamInterface
 
class  GaussianSampler
 
class  Gm2dlIO
 read / write gm2dl file into / out of a SparseOptimizer More...
 
class  GuiHyperGraphAction
 action which calls an GUI update after each iteration More...
 
struct  HyperDijkstra
 
class  HyperGraph
 
class  HyperGraphAction
 Abstract action that operates on an entire graph. More...
 
class  HyperGraphActionLibrary
 library of actions, indexed by the action name; More...
 
class  HyperGraphElementAction
 Abstract action that operates on a graph entity. More...
 
class  HyperGraphElementActionCollection
 collection of actions More...
 
class  HyperGraphElementCreator
 templatized creator class which creates graph elements More...
 
class  JacobianWorkspace
 provide memory workspace for computing the Jacobians More...
 
struct  LaserParameters
 parameters for a 2D range finder More...
 
struct  Line2D
 
class  Line3D
 
class  LinearSolver
 basic solver for Ax = b More...
 
class  LinearSolverCCS
 Solver with faster iterating structure for the linear matrix. More...
 
class  LinearSolverCholmod
 basic solver for Ax = b which has to reimplemented for different linear algebra libraries More...
 
class  LinearSolverCholmodOnline
 linear solver which allows to update the cholesky factor More...
 
class  LinearSolverCholmodOnlineInterface
 generic interface for the online solver More...
 
class  LinearSolverCSparse
 linear solver which uses CSparse More...
 
class  LinearSolverDense
 linear solver using dense cholesky decomposition More...
 
class  LinearSolverEigen
 linear solver which uses the sparse Cholesky solver from Eigen More...
 
class  LinearSolverPCG
 linear solver using PCG, pre-conditioner is block Jacobi More...
 
class  MarginalCovarianceCholesky
 computing the marginal covariance given a cholesky factor (lower triangle of the factor) More...
 
struct  MatrixElem
 
class  MatrixStructure
 representing the structure of a matrix in column compressed structure (only the upper triangular part of the matrix) More...
 
struct  MotionInformation
 
class  MotionMeasurement
 A 2D odometry measurement expressed as a transformation. More...
 
struct  OdomAndLaserMotion
 
class  OdomConvert
 convert between the different types of odometry measurements More...
 
class  OnlineEdgeSE2
 
class  OnlineEdgeSE3
 
class  OnlineVertexSE2
 
class  OnlineVertexSE3
 
class  OpenMPMutex
 
struct  OptimizableGraph
 
class  OptimizationAlgorithm
 Generic interface for a non-linear solver operating on a graph. More...
 
class  OptimizationAlgorithmDogleg
 Implementation of Powell's Dogleg Algorithm. More...
 
class  OptimizationAlgorithmFactory
 create solvers based on their short name More...
 
class  OptimizationAlgorithmGaussNewton
 Implementation of the Gauss Newton Algorithm. More...
 
class  OptimizationAlgorithmLevenberg
 Implementation of the Levenberg Algorithm. More...
 
struct  OptimizationAlgorithmProperty
 describe the properties of a solver More...
 
class  OptimizationAlgorithmWithHessian
 Base for solvers operating on the approximated Hessian, e.g., Gauss-Newton, Levenberg. More...
 
struct  OrthonormalLine3D
 
class  Parameter
 
class  ParameterCamera
 parameters for a camera More...
 
class  ParameterContainer
 map id to parameters More...
 
class  ParameterSE2Offset
 offset for an SE2 More...
 
class  ParameterSE3Offset
 offset for an SE3 More...
 
class  ParameterStereoCamera
 parameters for a camera More...
 
class  PCGSolverCreator
 
class  Plane3D
 
class  PointSensorParameters
 
class  Property
 
class  PropertyMap
 a collection of properties mapping from name to the property itself More...
 
class  RawLaser
 Raw laser measuerement. More...
 
class  RegisterActionProxy
 
class  RegisterOptimizationAlgorithmProxy
 
class  RegisterRobustKernelProxy
 
class  RegisterTypeProxy
 
class  Robot
 
class  RobotData
 data recorded by the robot More...
 
class  RobotLaser
 laser measurement obtained by a robot More...
 
class  RobustKernel
 base for all robust cost functions More...
 
class  RobustKernelCauchy
 Cauchy cost function. More...
 
class  RobustKernelCreator
 templatized creator class which creates graph elements More...
 
class  RobustKernelDCS
 Dynamic covariance scaling - DCS. More...
 
class  RobustKernelFactory
 create robust kernels based on their human readable name More...
 
class  RobustKernelFair
 Fair cost function. More...
 
class  RobustKernelGemanMcClure
 Geman-McClure cost function. More...
 
class  RobustKernelHuber
 Huber Cost Function. More...
 
class  RobustKernelPseudoHuber
 Pseudo Huber Cost Function. More...
 
class  RobustKernelSaturated
 Saturated cost function. More...
 
class  RobustKernelScaleDelta
 scale a robust kernel to another delta (window size) More...
 
class  RobustKernelTukey
 Tukey Cost Function. More...
 
class  RobustKernelWelsch
 Welsch cost function. More...
 
class  RunG2OViewer
 wrapper for running the g2o viewer More...
 
class  Sampler
 
class  SBACam
 
class  ScopedOpenMPMutex
 lock a mutex within a scope More...
 
class  ScopedTictoc
 Simplify calls to tictoc() for a whole scope. More...
 
class  ScopeTime
 Class to measure the time spent in a scope. More...
 
class  SE2
 represent SE2 More...
 
class  SE3Quat
 
class  SensorOdometry
 
class  SensorOdometry2D
 
class  SensorOdometry3D
 
class  SensorPointLine3D
 
class  SensorPointXY
 
class  SensorPointXYBearing
 
class  SensorPointXYOffset
 
class  SensorPointXYZ
 
class  SensorPointXYZDepth
 
class  SensorPointXYZDisparity
 
class  SensorPose2D
 
class  SensorPose3D
 
class  SensorPose3DOffset
 
class  SensorSE3Prior
 
class  SensorSegment2D
 
class  SensorSegment2DLine
 
class  SensorSegment2DPointLine
 
struct  SigmaPoint
 
struct  Sim3
 
class  SLAM2DLinearSolverCreator
 
class  Slam2DViewer
 
class  SleepThread
 helper for calling usleep on any system using Qt More...
 
class  Solver
 Generic interface for a sparse solver operating on a graph which solves one iteration of the linearized objective function. More...
 
class  SolverSLAM2DLinear
 Implementation of a linear approximation for 2D pose graph SLAM. More...
 
class  SparseBlockMatrix
 Sparse matrix which uses blocks. More...
 
class  SparseBlockMatrixCCS
 Sparse matrix which uses blocks. More...
 
class  SparseBlockMatrixDiagonal
 Sparse matrix which uses blocks on the diagonal. More...
 
class  SparseBlockMatrixHashMap
 Sparse matrix which uses blocks based on hash structures. More...
 
class  SparseOptimizer
 
class  SparseOptimizerIncremental
 
class  SparseOptimizerOnline
 
class  SparseOptimizerTerminateAction
 stop iterating based on the gain which is (oldChi - currentChi) / currentChi. More...
 
struct  Star
 
class  StructureOnlyCreator
 
class  StructureOnlySolver
 This is a solver for "structure-only" optimization". More...
 
class  ThetaTreeAction
 compute the initial guess of theta while traveling along the MST More...
 
struct  TicTocElement
 Internal structure of the tictoc profiling. More...
 
struct  TicTocInitializer
 helper for printing the struct at the end of the lifetime of the program More...
 
struct  TripletColSort
 
struct  TripletEntry
 
class  UnarySensor
 
struct  UniformCostFunction
 
class  VelocityMeasurement
 velocity measurement of a differential robot More...
 
class  VertexCam
 SBACam Vertex, (x,y,z,qw,qx,qy,qz) the parameterization for the increments constructed is a 6d vector (x,y,z,qx,qy,qz) (note that we leave out the w part of the quaternion. qw is assumed to be positive, otherwise there is an ambiguity in qx,qy,qz as a rotation. More...
 
class  VertexEllipse
 string ellipse to be attached to a vertex More...
 
class  VertexIntrinsics
 Vertex encoding the intrinsics of the camera fx, fy, cx, xy, baseline;. More...
 
class  VertexLine2D
 
class  VertexLine3D
 
class  VertexOdomDifferentialParams
 
class  VertexPlane
 
class  VertexPointXY
 
class  VertexPointXYWriteGnuplotAction
 
class  VertexPointXYZ
 Vertex for a tracked point in space. More...
 
class  VertexPointXYZWriteGnuplotAction
 
class  VertexSCam
 Stereo camera vertex, derived from SE3 class. Note that we use the actual pose of the vertex as its parameterization, rather than the transform from RW to camera coords. Uses static vars for camera params, so there is a single camera setup. More...
 
class  VertexSE2
 2D pose Vertex, (x,y,theta) More...
 
class  VertexSE2WriteGnuplotAction
 
class  VertexSE3
 3D pose Vertex, represented as an Isometry3 More...
 
class  VertexSE3Euler
 3D pose Vertex, (x,y,z,roll,pitch,yaw) the internal parameterization is the same as veretx_se3_quat. Only the read/write operations are rewritten to input/output euler angles. More...
 
class  VertexSE3Expmap
 SE3 Vertex parameterized internally with a transformation matrix and externally with its exponential map. More...
 
class  VertexSE3WriteGnuplotAction
 write the vertex to some Gnuplot data file More...
 
class  VertexSegment2D
 
class  VertexSegment2DWriteGnuplotAction
 
class  VertexSim3Expmap
 Sim3 Vertex, (x,y,z,qw,qx,qy,qz) the parameterization for the increments constructed is a 7d vector (x,y,z,qx,qy,qz) (note that we leave out the w part of the quaternion. More...
 
class  VertexTag
 string tag to be attached to a vertex More...
 
class  World
 
class  WorldObject
 
class  WriteGnuplotAction
 

Typedefs

typedef WorldObject< VertexSE2WorldObjectSE2
 
typedef WorldObject< VertexPointXYWorldObjectPointXY
 
typedef WorldObject< VertexSegment2DWorldObjectSegment2D
 
typedef Robot< WorldObjectSE2Robot2D
 
typedef WorldObject< VertexSE3WorldObjectSE3
 
typedef WorldObject< VertexPointXYZWorldObjectTrackXYZ
 
typedef WorldObject< VertexLine3DWorldObjectLine3D
 
typedef Robot< WorldObjectSE3Robot3D
 
template<int D, typename E >
using BaseMultiEdge = BaseVariableSizedEdge< D, E >
 
typedef std::vector< G2OBatchStatisticsBatchStatisticsContainer
 
template<int p, int l>
using BlockSolverPL = BlockSolver< BlockSolverTraits< p, l > >
 
using BlockSolverX = BlockSolverPL< Eigen::Dynamic, Eigen::Dynamic >
 
using BlockSolver_6_3 = BlockSolverPL< 6, 3 >
 
using BlockSolver_7_3 = BlockSolverPL< 7, 3 >
 
using BlockSolver_3_2 = BlockSolverPL< 3, 2 >
 
using number_t = double
 
using Vector2I = Eigen::Matrix< int, 2, 1, Eigen::ColMajor >
 
using Vector3I = Eigen::Matrix< int, 3, 1, Eigen::ColMajor >
 
using Vector4I = Eigen::Matrix< int, 4, 1, Eigen::ColMajor >
 
using VectorXI = Eigen::Matrix< int, Eigen::Dynamic, 1, Eigen::ColMajor >
 
using Vector2F = Eigen::Matrix< float, 2, 1, Eigen::ColMajor >
 
using Vector3F = Eigen::Matrix< float, 3, 1, Eigen::ColMajor >
 
using Vector4F = Eigen::Matrix< float, 4, 1, Eigen::ColMajor >
 
using VectorXF = Eigen::Matrix< float, Eigen::Dynamic, 1, Eigen::ColMajor >
 
template<int N, typename T = double>
using VectorN = Eigen::Matrix< T, N, 1, Eigen::ColMajor >
 
using Vector2 = VectorN< 2 >
 
using Vector3 = VectorN< 3 >
 
using Vector4 = VectorN< 4 >
 
using Vector6 = VectorN< 6 >
 
using Vector7 = VectorN< 7 >
 
using VectorX = VectorN< Eigen::Dynamic >
 
using Matrix2I = Eigen::Matrix< int, 2, 2, Eigen::ColMajor >
 
using Matrix3I = Eigen::Matrix< int, 3, 3, Eigen::ColMajor >
 
using Matrix4I = Eigen::Matrix< int, 4, 4, Eigen::ColMajor >
 
using MatrixXI = Eigen::Matrix< int, Eigen::Dynamic, Eigen::Dynamic, Eigen::ColMajor >
 
using Matrix2F = Eigen::Matrix< float, 2, 2, Eigen::ColMajor >
 
using Matrix3F = Eigen::Matrix< float, 3, 3, Eigen::ColMajor >
 
using Matrix4F = Eigen::Matrix< float, 4, 4, Eigen::ColMajor >
 
using MatrixXF = Eigen::Matrix< float, Eigen::Dynamic, Eigen::Dynamic, Eigen::ColMajor >
 
template<int N, typename T = double>
using MatrixN = Eigen::Matrix< T, N, N, Eigen::ColMajor >
 
using Matrix2 = MatrixN< 2 >
 
using Matrix3 = MatrixN< 3 >
 
using Matrix4 = MatrixN< 4 >
 
using MatrixX = MatrixN< Eigen::Dynamic >
 
using Isometry2 = Eigen::Transform< double, 2, Eigen::Isometry, Eigen::ColMajor >
 
using Isometry3 = Eigen::Transform< double, 3, Eigen::Isometry, Eigen::ColMajor >
 
using Affine2 = Eigen::Transform< double, 2, Eigen::Affine, Eigen::ColMajor >
 
using Affine3 = Eigen::Transform< double, 3, Eigen::Affine, Eigen::ColMajor >
 
using Rotation2D = Eigen::Rotation2D< double >
 
using Quaternion = Eigen::Quaternion< double >
 
using AngleAxis = Eigen::AngleAxis< double >
 
typedef std::vector< Parameter * > ParameterVector
 
typedef std::shared_ptr< RobustKernelRobustKernelPtr
 
typedef SparseBlockMatrix< MatrixXSparseBlockMatrixX
 
using MotionInformationVector = std::vector< MotionInformation >
 
typedef SigmaPoint< VectorXd > MySigmaPoint
 
typedef std::multimap< OptimizableGraph::Vertex *, Star * > VertexStarMultimap
 
typedef std::map< OptimizableGraph::Vertex *, Star * > VertexStarMap
 
typedef std::set< Star * > StarSet
 
typedef std::map< HyperGraph::Edge *, Star * > EdgeStarMap
 
typedef void(* ForceLinkFunction) (void)
 
typedef Property< int > IntProperty
 
typedef Property< bool > BoolProperty
 
typedef Property< float > FloatProperty
 
typedef Property< double > DoubleProperty
 
typedef Property< std::string > StringProperty
 
typedef std::map< std::string, TicTocElementTicTocMap
 
using seconds = std::chrono::duration< double >
 
typedef Eigen::Matrix< double, 6, 6 > Matrix6
 
typedef Eigen::Matrix< double, 6, 4 > Matrix6x4
 
typedef struct OrthonormalLine3D OrthonormalLine3D
 

Enumerations

enum  CommandArgumentType {
  CAT_DOUBLE , CAT_FLOAT , CAT_INT , CAT_STRING ,
  CAT_BOOL , CAT_VECTOR_INT , CAT_VECTOR_DOUBLE
}
 

Functions

void findArguments (const std::string &option, vector< string > &args, int argc, char **argv)
 
void loadStandardTypes (DlWrapper &dlTypesWrapper, int argc, char **argv)
 
void loadStandardSolver (DlWrapper &dlSolverWrapper, int argc, char **argv)
 
bool edgeAllVertsSameDim (OptimizableGraph::Edge *e, int dim)
 
bool saveGnuplot (const std::string &gnudump, const OptimizableGraph &optimizer)
 
bool saveGnuplot (const std::string &gnudump, const HyperGraph::VertexSet &vertices, const HyperGraph::EdgeSet &edges)
 
bool dumpEdges (std::ostream &os, const OptimizableGraph &optimizer)
 
int clipSegmentCircle (Eigen::Vector2d &p1, Eigen::Vector2d &p2, double r)
 
int clipSegmentLine (Eigen::Vector2d &p1, Eigen::Vector2d &p2, double a, double b, double c)
 
int clipSegmentFov (Eigen::Vector2d &p1, Eigen::Vector2d &p2, double min, double max)
 
Eigen::Vector2d computeLineParameters (const Eigen::Vector2d &p1, const Eigen::Vector2d &p2)
 
std::ostream & operator<< (std::ostream &os, const G2OBatchStatistics &st)
 
template<typename Type >
Type * allocate_aligned (size_t n)
 
template<typename Type >
Type * reallocate_aligned (Type *ptr, size_t newSize, size_t oldSize)
 
template<typename Type >
void free_aligned (Type *block)
 
bool operator< (const HyperDijkstra::AdjacencyMapEntry &a, const HyperDijkstra::AdjacencyMapEntry &b)
 
void applyAction (HyperGraph *graph, HyperGraphElementAction *action, HyperGraphElementAction::Parameters *params, const std::string &typeName)
 
template<typename T >
void release (T *obj)
 
template<class MatrixType >
std::ostream & operator<< (std::ostream &, const SparseBlockMatrix< MatrixType > &m)
 
void addOdometryCalibLinksDifferential (SparseOptimizer &optimizer, const DataQueue &odomData)
 
void allocateSolverForSclam (SparseOptimizer &optimizer, bool levenberg)
 
double activeVertexChi (const OptimizableGraph::Vertex *v)
 
void constructEdgeStarMap (EdgeStarMap &esmap, StarSet &stars, bool low)
 
size_t vertexEdgesInStar (HyperGraph::EdgeSet &eset, HyperGraph::Vertex *v, Star *s, EdgeStarMap &esmap)
 
void starsInVertex (StarSet &stars, HyperGraph::Vertex *v, EdgeStarMap &esmap)
 
void starsInEdge (StarSet &stars, HyperGraph::Edge *e, EdgeStarMap &esmap, HyperGraph::VertexSet &gauge)
 
void assignHierarchicalEdges (StarSet &stars, EdgeStarMap &esmap, EdgeLabeler *labeler, EdgeCreator *creator, SparseOptimizer *optimizer, int minNumEdges, int maxIterations)
 
void computeBorder (StarSet &stars, EdgeStarMap &hesmap)
 
void computeSimpleStars (StarSet &stars, SparseOptimizer *optimizer, EdgeLabeler *labeler, EdgeCreator *creator, OptimizableGraph::Vertex *gauge_, std::string edgeTag, std::string vertexTag, int level, int step, int backboneIterations, int starIterations, double rejectionThreshold, bool debug)
 
void findConnectedEdgesWithCostLimit (HyperGraph::EdgeSet &selected, HyperGraph::EdgeSet &border, HyperGraph::Edge *start, HyperDijkstra::CostFunction *cost, double maxEdgeCost, double comparisonConditioner)
 
static OptimizationAlgorithmcreateSolver (const std::string &solverName)
 
 G2O_USE_OPTIMIZATION_LIBRARY (cholmod)
 
 G2O_REGISTER_TYPE_GROUP (online)
 
 G2O_REGISTER_TYPE (ONLINE_EDGE_SE2, OnlineEdgeSE2)
 
 G2O_REGISTER_TYPE (ONLINE_VERTEX_SE2, OnlineVertexSE2)
 
 G2O_REGISTER_TYPE (ONLINE_VERTEX_SE3:QUAT, OnlineVertexSE3)
 
 G2O_REGISTER_TYPE (ONLINE_EDGE_SE3:QUAT, OnlineEdgeSE3)
 
static OptimizationAlgorithmcreateSolver (const std::string &fullSolverName)
 
 G2O_REGISTER_OPTIMIZATION_LIBRARY (cholmod)
 
 G2O_REGISTER_OPTIMIZATION_ALGORITHM (gn_var_cholmod, new CholmodSolverCreator(OptimizationAlgorithmProperty("gn_var_cholmod", "Gauss-Newton: Cholesky solver using CHOLMOD (variable blocksize)", "CHOLMOD", false, Eigen::Dynamic, Eigen::Dynamic)))
 
 G2O_REGISTER_OPTIMIZATION_ALGORITHM (gn_fix3_2_cholmod, new CholmodSolverCreator(OptimizationAlgorithmProperty("gn_fix3_2_cholmod", "Gauss-Newton: Cholesky solver using CHOLMOD (fixed blocksize)", "CHOLMOD", true, 3, 2)))
 
 G2O_REGISTER_OPTIMIZATION_ALGORITHM (gn_fix6_3_cholmod, new CholmodSolverCreator(OptimizationAlgorithmProperty("gn_fix6_3_cholmod", "Gauss-Newton: Cholesky solver using CHOLMOD (fixed blocksize)", "CHOLMOD", true, 6, 3)))
 
 G2O_REGISTER_OPTIMIZATION_ALGORITHM (gn_fix7_3_cholmod, new CholmodSolverCreator(OptimizationAlgorithmProperty("gn_fix7_3_cholmod", "Gauss-Newton: Cholesky solver using CHOLMOD (fixed blocksize)", "CHOLMOD", true, 7, 3)))
 
 G2O_REGISTER_OPTIMIZATION_ALGORITHM (lm_var_cholmod, new CholmodSolverCreator(OptimizationAlgorithmProperty("lm_var_cholmod", "Levenberg: Cholesky solver using CHOLMOD (variable blocksize)", "CHOLMOD", false, Eigen::Dynamic, Eigen::Dynamic)))
 
 G2O_REGISTER_OPTIMIZATION_ALGORITHM (lm_fix3_2_cholmod, new CholmodSolverCreator(OptimizationAlgorithmProperty("lm_fix3_2_cholmod", "Levenberg: Cholesky solver using CHOLMOD (fixed blocksize)", "CHOLMOD", true, 3, 2)))
 
 G2O_REGISTER_OPTIMIZATION_ALGORITHM (lm_fix6_3_cholmod, new CholmodSolverCreator(OptimizationAlgorithmProperty("lm_fix6_3_cholmod", "Levenberg: Cholesky solver using CHOLMOD (fixed blocksize)", "CHOLMOD", true, 6, 3)))
 
 G2O_REGISTER_OPTIMIZATION_ALGORITHM (lm_fix7_3_cholmod, new CholmodSolverCreator(OptimizationAlgorithmProperty("lm_fix7_3_cholmod", "Levenberg: Cholesky solver using CHOLMOD (fixed blocksize)", "CHOLMOD", true, 7, 3)))
 
 G2O_REGISTER_OPTIMIZATION_ALGORITHM (dl_var_cholmod, new CholmodSolverCreator(OptimizationAlgorithmProperty("dl_var_cholmod", "Dogleg: Cholesky solver using CHOLMOD (variable blocksize)", "CHOLMOD", false, Eigen::Dynamic, Eigen::Dynamic)))
 
static OptimizationAlgorithmcreateSolver (const std::string &fullSolverName)
 
 G2O_REGISTER_OPTIMIZATION_LIBRARY (csparse)
 
 G2O_REGISTER_OPTIMIZATION_ALGORITHM (gn_var_csparse, new CSparseSolverCreator(OptimizationAlgorithmProperty("gn_var_csparse", "Gauss-Newton: Cholesky solver using CSparse (variable blocksize)", "CSparse", false, Eigen::Dynamic, Eigen::Dynamic)))
 
 G2O_REGISTER_OPTIMIZATION_ALGORITHM (gn_fix3_2_csparse, new CSparseSolverCreator(OptimizationAlgorithmProperty("gn_fix3_2_csparse", "Gauss-Newton: Cholesky solver using CSparse (fixed blocksize)", "CSparse", true, 3, 2)))
 
 G2O_REGISTER_OPTIMIZATION_ALGORITHM (gn_fix6_3_csparse, new CSparseSolverCreator(OptimizationAlgorithmProperty("gn_fix6_3_csparse", "Gauss-Newton: Cholesky solver using CSparse (fixed blocksize)", "CSparse", true, 6, 3)))
 
 G2O_REGISTER_OPTIMIZATION_ALGORITHM (gn_fix7_3_csparse, new CSparseSolverCreator(OptimizationAlgorithmProperty("gn_fix7_3_csparse", "Gauss-Newton: Cholesky solver using CSparse (fixed blocksize)", "CSparse", true, 7, 3)))
 
 G2O_REGISTER_OPTIMIZATION_ALGORITHM (lm_var_csparse, new CSparseSolverCreator(OptimizationAlgorithmProperty("lm_var_csparse", "Levenberg: Cholesky solver using CSparse (variable blocksize)", "CSparse", false, Eigen::Dynamic, Eigen::Dynamic)))
 
 G2O_REGISTER_OPTIMIZATION_ALGORITHM (lm_fix3_2_csparse, new CSparseSolverCreator(OptimizationAlgorithmProperty("lm_fix3_2_csparse", "Levenberg: Cholesky solver using CSparse (fixed blocksize)", "CSparse", true, 3, 2)))
 
 G2O_REGISTER_OPTIMIZATION_ALGORITHM (lm_fix6_3_csparse, new CSparseSolverCreator(OptimizationAlgorithmProperty("lm_fix6_3_csparse", "Levenberg: Cholesky solver using CSparse (fixed blocksize)", "CSparse", true, 6, 3)))
 
 G2O_REGISTER_OPTIMIZATION_ALGORITHM (lm_fix7_3_csparse, new CSparseSolverCreator(OptimizationAlgorithmProperty("lm_fix7_3_csparse", "Levenberg: Cholesky solver using CSparse (fixed blocksize)", "CSparse", true, 7, 3)))
 
 G2O_REGISTER_OPTIMIZATION_ALGORITHM (dl_var_csparse, new CSparseSolverCreator(OptimizationAlgorithmProperty("dl_var_csparse", "Dogleg: Cholesky solver using CSparse (variable blocksize)", "CSparse", false, Eigen::Dynamic, Eigen::Dynamic)))
 
static OptimizationAlgorithmcreateSolver (const std::string &fullSolverName)
 
 G2O_REGISTER_OPTIMIZATION_LIBRARY (dense)
 
 G2O_REGISTER_OPTIMIZATION_ALGORITHM (gn_dense, new DenseSolverCreator(OptimizationAlgorithmProperty("gn_dense", "Gauss-Newton: Dense solver (variable blocksize)", "Dense", false, Eigen::Dynamic, Eigen::Dynamic)))
 
 G2O_REGISTER_OPTIMIZATION_ALGORITHM (gn_dense3_2, new DenseSolverCreator(OptimizationAlgorithmProperty("gn_dense3_2", "Gauss-Newton: Dense solver (fixed blocksize)", "Dense", true, 3, 2)))
 
 G2O_REGISTER_OPTIMIZATION_ALGORITHM (gn_dense6_3, new DenseSolverCreator(OptimizationAlgorithmProperty("gn_dense6_3", "Gauss-Newton: Dense solver (fixed blocksize)", "Dense", true, 6, 3)))
 
 G2O_REGISTER_OPTIMIZATION_ALGORITHM (gn_dense7_3, new DenseSolverCreator(OptimizationAlgorithmProperty("gn_dense7_3", "Gauss-Newton: Dense solver (fixed blocksize)", "Dense", true, 7, 3)))
 
 G2O_REGISTER_OPTIMIZATION_ALGORITHM (lm_dense, new DenseSolverCreator(OptimizationAlgorithmProperty("lm_dense", "Levenberg: Dense solver (variable blocksize)", "Dense", false, -1, -1)))
 
 G2O_REGISTER_OPTIMIZATION_ALGORITHM (lm_dense3_2, new DenseSolverCreator(OptimizationAlgorithmProperty("lm_dense3_2", "Levenberg: Dense solver (fixed blocksize)", "Dense", true, 3, 2)))
 
 G2O_REGISTER_OPTIMIZATION_ALGORITHM (lm_dense6_3, new DenseSolverCreator(OptimizationAlgorithmProperty("lm_dense6_3", "Levenberg: Dense solver (fixed blocksize)", "Dense", true, 6, 3)))
 
 G2O_REGISTER_OPTIMIZATION_ALGORITHM (lm_dense7_3, new DenseSolverCreator(OptimizationAlgorithmProperty("lm_dense7_3", "Levenberg: Dense solver (fixed blocksize)", "Dense", true, 7, 3)))
 
static OptimizationAlgorithmcreateSolver (const std::string &fullSolverName)
 
 G2O_REGISTER_OPTIMIZATION_LIBRARY (eigen)
 
 G2O_REGISTER_OPTIMIZATION_ALGORITHM (gn_var, new EigenSolverCreator(OptimizationAlgorithmProperty("gn_var", "Gauss-Newton: Cholesky solver using Eigen's Sparse Cholesky methods (variable blocksize)", "Eigen", false, Eigen::Dynamic, Eigen::Dynamic)))
 
 G2O_REGISTER_OPTIMIZATION_ALGORITHM (gn_fix3_2, new EigenSolverCreator(OptimizationAlgorithmProperty("gn_fix3_2", "Gauss-Newton: Cholesky solver using Eigen's Sparse Cholesky (fixed blocksize)", "Eigen", true, 3, 2)))
 
 G2O_REGISTER_OPTIMIZATION_ALGORITHM (gn_fix6_3, new EigenSolverCreator(OptimizationAlgorithmProperty("gn_fix6_3", "Gauss-Newton: Cholesky solver using Eigen's Sparse Cholesky (fixed blocksize)", "Eigen", true, 6, 3)))
 
 G2O_REGISTER_OPTIMIZATION_ALGORITHM (gn_fix7_3, new EigenSolverCreator(OptimizationAlgorithmProperty("gn_fix7_3", "Gauss-Newton: Cholesky solver using Eigen's Sparse Cholesky (fixed blocksize)", "Eigen", true, 7, 3)))
 
 G2O_REGISTER_OPTIMIZATION_ALGORITHM (lm_var, new EigenSolverCreator(OptimizationAlgorithmProperty("lm_var", "Levenberg: Cholesky solver using Eigen's Sparse Cholesky methods (variable blocksize)", "Eigen", false, Eigen::Dynamic, Eigen::Dynamic)))
 
 G2O_REGISTER_OPTIMIZATION_ALGORITHM (lm_fix3_2, new EigenSolverCreator(OptimizationAlgorithmProperty("lm_fix3_2", "Levenberg: Cholesky solver using Eigen's Sparse Cholesky (fixed blocksize)", "Eigen", true, 3, 2)))
 
 G2O_REGISTER_OPTIMIZATION_ALGORITHM (lm_fix6_3, new EigenSolverCreator(OptimizationAlgorithmProperty("lm_fix6_3", "Levenberg: Cholesky solver using Eigen's Sparse Cholesky (fixed blocksize)", "Eigen", true, 6, 3)))
 
 G2O_REGISTER_OPTIMIZATION_ALGORITHM (lm_fix7_3, new EigenSolverCreator(OptimizationAlgorithmProperty("lm_fix7_3", "Levenberg: Cholesky solver using Eigen's Sparse Cholesky (fixed blocksize)", "Eigen", true, 7, 3)))
 
 G2O_REGISTER_OPTIMIZATION_ALGORITHM (dl_var, new EigenSolverCreator(OptimizationAlgorithmProperty("dl_var", "Dogleg: Cholesky solver using Eigen's Sparse Cholesky methods (variable blocksize)", "Eigen", false, Eigen::Dynamic, Eigen::Dynamic)))
 
static OptimizationAlgorithmcreateSolver (const std::string &fullSolverName)
 
 G2O_REGISTER_OPTIMIZATION_LIBRARY (pcg)
 
 G2O_REGISTER_OPTIMIZATION_ALGORITHM (gn_pcg, new PCGSolverCreator(OptimizationAlgorithmProperty("gn_pcg", "Gauss-Newton: PCG solver using block-Jacobi pre-conditioner " "(variable blocksize)", "PCG", false, Eigen::Dynamic, Eigen::Dynamic)))
 
 G2O_REGISTER_OPTIMIZATION_ALGORITHM (gn_pcg3_2, new PCGSolverCreator(OptimizationAlgorithmProperty("gn_pcg3_2", "Gauss-Newton: PCG solver using block-Jacobi " "pre-conditioner (fixed blocksize)", "PCG", true, 3, 2)))
 
 G2O_REGISTER_OPTIMIZATION_ALGORITHM (gn_pcg6_3, new PCGSolverCreator(OptimizationAlgorithmProperty("gn_pcg6_3", "Gauss-Newton: PCG solver using block-Jacobi " "pre-conditioner (fixed blocksize)", "PCG", true, 6, 3)))
 
 G2O_REGISTER_OPTIMIZATION_ALGORITHM (gn_pcg7_3, new PCGSolverCreator(OptimizationAlgorithmProperty("gn_pcg7_3", "Gauss-Newton: PCG solver using block-Jacobi " "pre-conditioner (fixed blocksize)", "PCG", true, 7, 3)))
 
 G2O_REGISTER_OPTIMIZATION_ALGORITHM (lm_pcg, new PCGSolverCreator(OptimizationAlgorithmProperty("lm_pcg", "Levenberg: PCG solver using block-Jacobi pre-conditioner " "(variable blocksize)", "PCG", false, Eigen::Dynamic, Eigen::Dynamic)))
 
 G2O_REGISTER_OPTIMIZATION_ALGORITHM (lm_pcg3_2, new PCGSolverCreator(OptimizationAlgorithmProperty("lm_pcg3_2", "Levenberg: PCG solver using block-Jacobi pre-conditioner " "(fixed blocksize)", "PCG", true, 3, 2)))
 
 G2O_REGISTER_OPTIMIZATION_ALGORITHM (lm_pcg6_3, new PCGSolverCreator(OptimizationAlgorithmProperty("lm_pcg6_3", "Levenberg: PCG solver using block-Jacobi pre-conditioner " "(fixed blocksize)", "PCG", true, 6, 3)))
 
 G2O_REGISTER_OPTIMIZATION_ALGORITHM (lm_pcg7_3, new PCGSolverCreator(OptimizationAlgorithmProperty("lm_pcg7_3", "Levenberg: PCG solver using block-Jacobi pre-conditioner " "(fixed blocksize)", "PCG", true, 7, 3)))
 
static OptimizationAlgorithmcreateSolver (const std::string &fullSolverName)
 
 G2O_REGISTER_OPTIMIZATION_LIBRARY (slam2d_linear)
 
 G2O_REGISTER_OPTIMIZATION_ALGORITHM (2dlinear, new SLAM2DLinearSolverCreator(OptimizationAlgorithmProperty("2dlinear", "Solve Orientation + Gauss-Newton: Works only on 2D pose graphs!!", "Eigen", false, 3, 3)))
 
static OptimizationAlgorithmcreateSolver (const std::string &fullSolverName)
 
 G2O_REGISTER_OPTIMIZATION_LIBRARY (structure_only)
 
 G2O_REGISTER_OPTIMIZATION_ALGORITHM (structure_only_2, new StructureOnlyCreator(OptimizationAlgorithmProperty("structure_only_2", "Optimize the landmark poses (2D)", "Eigen", true, 3, 2)))
 
 G2O_REGISTER_OPTIMIZATION_ALGORITHM (structure_only_3, new StructureOnlyCreator(OptimizationAlgorithmProperty("structure_only_3", "Optimize the landmark poses (3D)", "Eigen", true, 6, 3)))
 
std::string getFileExtension (const std::string &filename)
 
std::string getPureFilename (const std::string &filename)
 
std::string getBasename (const std::string &filename)
 
std::string getDirname (const std::string &filename)
 
std::string changeFileExtension (const std::string &filename, const std::string &newExt, bool stripDot)
 
bool fileExists (const char *filename)
 
std::vector< std::string > getFilesByPattern (const char *pattern)
 
constexpr double cst (long double v)
 
constexpr double const_pi ()
 
template<typename T >
square (T x)
 
template<typename T >
hypot (T x, T y)
 
template<typename T >
hypot_sqr (T x, T y)
 
double deg2rad (double degree)
 
double rad2deg (double rad)
 
double normalize_theta (double theta)
 
double inverse_theta (double th)
 
double average_angle (double theta1, double theta2)
 
template<typename T >
int sign (T x)
 
template<typename T >
clamp (T l, T x, T u)
 
template<typename T >
wrap (T l, T x, T u)
 
bool arrayHasNaN (const double *array, int size, int *nanIndex=0)
 
static std::normal_distribution< double > _univariateSampler (0., 1.)
 
double sampleUniform (double min, double max, std::mt19937 *generator)
 
double sampleGaussian (std::mt19937 *generator)
 
static bool writeTripletEntries (const std::string &filename, int rows, int cols, const std::vector< TripletEntry > &triplets)
 
bool writeVector (const string &filename, const double *v, int n)
 
bool writeCCSMatrix (const string &filename, int rows, int cols, const int *Ap, const int *Ai, const double *Ax, bool upperTriangleSymmetric)
 
bool writeTripletMatrix (const std::string &filename, int nz, int rows, int cols, const int *Ai, const int *Aj, const double *Ax, bool upperTriangleSymmetric)
 
G2O_STUFF_API bool writeVector (const std::string &filename, const double *v, int n)
 
G2O_STUFF_API bool writeCCSMatrix (const std::string &filename, int rows, int cols, const int *p, const int *i, const double *v, bool upperTriangleSymmetric=true)
 
std::string trim (const std::string &s)
 
std::string trimLeft (const std::string &s)
 
std::string trimRight (const std::string &s)
 
std::string strToLower (const std::string &s)
 
std::string strToUpper (const std::string &s)
 
std::string formatString (const char *fmt,...)
 
int strPrintf (std::string &str, const char *fmt,...)
 
std::string strExpandFilename (const std::string &filename)
 
std::vector< std::string > strSplit (const std::string &str, const std::string &delimiters)
 
bool strStartsWith (const std::string &s, const std::string &start)
 
bool strEndsWith (const std::string &s, const std::string &end)
 
int readLine (std::istream &is, std::stringstream &currentLine)
 
void skipLine (std::istream &is)
 
template<typename OutputIterator >
OutputIterator readInts (const char *str, OutputIterator out)
 
template<typename OutputIterator >
OutputIterator readFloats (const char *str, OutputIterator out)
 
template<typename T >
bool convertString (const std::string &s, T &x, bool failIfLeftoverChars=true)
 
template<typename T >
stringToType (const std::string &s, bool failIfLeftoverChars=true)
 
double tictoc (const char *algorithmPart)
 Profile the timing of certain parts of your algorithm.
 
double get_monotonic_time ()
 
double get_time ()
 
template<typename F , typename T , std::size_t... I>
void tuple_apply_i_ (F &&f, T &t, int i, std::index_sequence< I... >)
 
template<typename F , typename T >
void tuple_apply_i (F &&f, T &t, int i)
 
template<class SampleType , class CovarianceType >
bool sampleUnscented (std::vector< SigmaPoint< SampleType > > &sigmaPoints, const SampleType &mean, const CovarianceType &covariance)
 
template<class SampleType , class CovarianceType >
void reconstructGaussian (SampleType &mean, CovarianceType &covariance, const std::vector< SigmaPoint< SampleType > > &sigmaPoints)
 
 G2O_REGISTER_TYPE_GROUP (data)
 
 G2O_REGISTER_TYPE (VERTEX_TAG, VertexTag)
 
 G2O_REGISTER_TYPE (ROBOTLASER1, RobotLaser)
 
 G2O_REGISTER_TYPE (VERTEX_ELLIPSE, VertexEllipse)
 
 G2O_REGISTER_TYPE_GROUP (icp)
 
 G2O_REGISTER_TYPE (EDGE_V_V_GICP, Edge_V_V_GICP)
 
 G2O_ATTRIBUTE_CONSTRUCTOR (init_icp_types)
 
std::ostream & operator<< (std::ostream &out_str, const SBACam &cam)
 
 G2O_REGISTER_TYPE_GROUP (sba)
 
 G2O_REGISTER_TYPE (VERTEX_CAM, VertexCam)
 
 G2O_REGISTER_TYPE (VERTEX_INTRINSICS, VertexIntrinsics)
 
 G2O_REGISTER_TYPE (EDGE_PROJECT_P2MC, EdgeProjectP2MC)
 
 G2O_REGISTER_TYPE (EDGE_PROJECT_P2SC, EdgeProjectP2SC)
 
 G2O_REGISTER_TYPE (EDGE_CAM, EdgeSBACam)
 
 G2O_REGISTER_TYPE (EDGE_SCALE, EdgeSBAScale)
 
 G2O_REGISTER_TYPE_GROUP (expmap)
 
 G2O_REGISTER_TYPE (VERTEX_SE3:EXPMAP, VertexSE3Expmap)
 
 G2O_REGISTER_TYPE (EDGE_SE3:EXPMAP, EdgeSE3Expmap)
 
 G2O_REGISTER_TYPE (EDGE_PROJECT_XYZ2UV:EXPMAP, EdgeProjectXYZ2UV)
 
 G2O_REGISTER_TYPE (EDGE_PROJECT_XYZ2UVU:EXPMAP, EdgeProjectXYZ2UVU)
 
 G2O_REGISTER_TYPE (EDGE_SE3_PROJECT_XYZ:EXPMAP, EdgeSE3ProjectXYZ)
 
 G2O_REGISTER_TYPE (EDGE_SE3_PROJECT_XYZONLYPOSE:EXPMAP, EdgeSE3ProjectXYZOnlyPose)
 
 G2O_REGISTER_TYPE (EDGE_STEREO_SE3_PROJECT_XYZ:EXPMAP, EdgeStereoSE3ProjectXYZ)
 
 G2O_REGISTER_TYPE (EDGE_STEREO_SE3_PROJECT_XYZONLYPOSE:EXPMAP, EdgeStereoSE3ProjectXYZOnlyPose)
 
 G2O_REGISTER_TYPE (PARAMS_CAMERAPARAMETERS, CameraParameters)
 
 G2O_USE_TYPE_GROUP (slam2d)
 
 G2O_REGISTER_TYPE_GROUP (sclam)
 
 G2O_REGISTER_TYPE (VERTEX_ODOM_DIFFERENTIAL, VertexOdomDifferentialParams)
 
 G2O_REGISTER_TYPE (EDGE_SE2_CALIB, EdgeSE2SensorCalib)
 
 G2O_REGISTER_TYPE (EDGE_SE2_ODOM_DIFFERENTIAL_CALIB, EdgeSE2OdomDifferentialCalib)
 
std::ostream & operator<< (std::ostream &out_str, const Sim3 &sim3)
 
 G2O_USE_TYPE_GROUP (sba)
 
 G2O_REGISTER_TYPE_GROUP (sim3)
 
 G2O_REGISTER_TYPE (VERTEX_SIM3 :EXPMAP, VertexSim3Expmap)
 
 G2O_REGISTER_TYPE (EDGE_SIM3 :EXPMAP, EdgeSim3)
 
 G2O_REGISTER_TYPE (EDGE_PROJECT_SIM3_XYZ :EXPMAP, EdgeSim3ProjectXYZ)
 
 G2O_REGISTER_TYPE (EDGE_PROJECT_INVERSE_SIM3_XYZ :EXPMAP, EdgeInverseSim3ProjectXYZ)
 
 G2O_REGISTER_TYPE_GROUP (slam2d)
 
 G2O_REGISTER_TYPE (VERTEX_SE2, VertexSE2)
 
 G2O_REGISTER_TYPE (VERTEX_XY, VertexPointXY)
 
 G2O_REGISTER_TYPE (PARAMS_SE2OFFSET, ParameterSE2Offset)
 
 G2O_REGISTER_TYPE (CACHE_SE2_OFFSET, CacheSE2Offset)
 
 G2O_REGISTER_TYPE (EDGE_PRIOR_SE2, EdgeSE2Prior)
 
 G2O_REGISTER_TYPE (EDGE_PRIOR_SE2_XY, EdgeSE2XYPrior)
 
 G2O_REGISTER_TYPE (EDGE_SE2, EdgeSE2)
 
 G2O_REGISTER_TYPE (EDGE_SE2_XY, EdgeSE2PointXY)
 
 G2O_REGISTER_TYPE (EDGE_BEARING_SE2_XY, EdgeSE2PointXYBearing)
 
 G2O_REGISTER_TYPE (EDGE_SE2_XY_CALIB, EdgeSE2PointXYCalib)
 
 G2O_REGISTER_TYPE (EDGE_SE2_OFFSET, EdgeSE2Offset)
 
 G2O_REGISTER_TYPE (EDGE_SE2_POINTXY_OFFSET, EdgeSE2PointXYOffset)
 
 G2O_REGISTER_TYPE (EDGE_POINTXY, EdgePointXY)
 
 G2O_REGISTER_TYPE (EDGE_SE2_TWOPOINTSXY, EdgeSE2TwoPointsXY)
 
 G2O_REGISTER_TYPE (EDGE_SE2_LOTSOFXY, EdgeSE2LotsOfXY)
 
 G2O_REGISTER_TYPE (EDGE_PRIOR_XY, EdgeXYPrior)
 
 G2O_REGISTER_ACTION (VertexSE2WriteGnuplotAction)
 
 G2O_REGISTER_ACTION (VertexPointXYWriteGnuplotAction)
 
 G2O_REGISTER_ACTION (EdgeSE2WriteGnuplotAction)
 
 G2O_REGISTER_ACTION (EdgeSE2PointXYWriteGnuplotAction)
 
 G2O_REGISTER_ACTION (EdgeSE2PointXYBearingWriteGnuplotAction)
 
Line2D operator* (const SE2 &t, const Line2D &l)
 
 G2O_REGISTER_TYPE_GROUP (slam2d_segment)
 
 G2O_REGISTER_TYPE (VERTEX_SEGMENT2D, VertexSegment2D)
 
 G2O_REGISTER_TYPE (VERTEX_LINE2D, VertexLine2D)
 
 G2O_REGISTER_TYPE (EDGE_SE2_SEGMENT2D, EdgeSE2Segment2D)
 
 G2O_REGISTER_TYPE (EDGE_SE2_SEGMENT2D_LINE, EdgeSE2Segment2DLine)
 
 G2O_REGISTER_TYPE (EDGE_SE2_SEGMENT2D_POINTLINE, EdgeSE2Segment2DPointLine)
 
 G2O_REGISTER_TYPE (EDGE_SE2_LINE2D, EdgeSE2Line2D)
 
 G2O_REGISTER_TYPE (EDGE_LINE2D, EdgeLine2D)
 
 G2O_REGISTER_TYPE (EDGE_LINE2D_POINTXY, EdgeLine2DPointXY)
 
G2O_TYPES_SLAM3D_API Matrix3 skew (const Vector3 &v)
 
G2O_TYPES_SLAM3D_API Vector3 deltaR (const Matrix3 &R)
 
G2O_TYPES_SLAM3D_API Vector2 project (const Vector3 &)
 
G2O_TYPES_SLAM3D_API Vector3 project (const Vector4 &)
 
G2O_TYPES_SLAM3D_API Vector3 unproject (const Vector2 &)
 
G2O_TYPES_SLAM3D_API Vector4 unproject (const Vector3 &)
 
std::ostream & operator<< (std::ostream &out_str, const SE3Quat &se3)
 
 G2O_REGISTER_TYPE_GROUP (slam3d)
 
 G2O_REGISTER_TYPE (VERTEX_SE3:QUAT, VertexSE3)
 
 G2O_REGISTER_TYPE (EDGE_SE3:QUAT, EdgeSE3)
 
 G2O_REGISTER_TYPE (VERTEX_TRACKXYZ, VertexPointXYZ)
 
 G2O_REGISTER_TYPE (PARAMS_SE3OFFSET, ParameterSE3Offset)
 
 G2O_REGISTER_TYPE (EDGE_SE3_TRACKXYZ, EdgeSE3PointXYZ)
 
 G2O_REGISTER_TYPE (EDGE_SE3_PRIOR, EdgeSE3Prior)
 
 G2O_REGISTER_TYPE (EDGE_SE3_XYZ_PRIOR, EdgeSE3XYZPrior)
 
 G2O_REGISTER_TYPE (CACHE_SE3_OFFSET, CacheSE3Offset)
 
 G2O_REGISTER_TYPE (EDGE_SE3_OFFSET, EdgeSE3Offset)
 
 G2O_REGISTER_TYPE (PARAMS_CAMERACALIB, ParameterCamera)
 
 G2O_REGISTER_TYPE (PARAMS_STEREOCAMERACALIB, ParameterStereoCamera)
 
 G2O_REGISTER_TYPE (CACHE_CAMERA, CacheCamera)
 
 G2O_REGISTER_TYPE (EDGE_PROJECT_DISPARITY, EdgeSE3PointXYZDisparity)
 
 G2O_REGISTER_TYPE (EDGE_PROJECT_DEPTH, EdgeSE3PointXYZDepth)
 
 G2O_REGISTER_TYPE (EDGE_POINTXYZ, EdgePointXYZ)
 
 G2O_REGISTER_TYPE (EDGE_POINTXYZ_PRIOR, EdgeXYZPrior)
 
 G2O_REGISTER_ACTION (VertexSE3WriteGnuplotAction)
 
 G2O_REGISTER_ACTION (VertexPointXYZWriteGnuplotAction)
 
 G2O_REGISTER_ACTION (EdgeSE3WriteGnuplotAction)
 
static void jac_quat3_euler3 (Eigen::Matrix< double, 6, 6, Eigen::ColMajor > &J, const Isometry3 &t)
 
static Matrix3 _skew (const Vector3 &t)
 
Line3D operator* (const Isometry3 &t, const Line3D &line)
 
Plane3D operator* (const Isometry3 &t, const Plane3D &plane)
 
 G2O_REGISTER_TYPE_GROUP (slam3d_addons)
 
 G2O_REGISTER_TYPE (VERTEX3, VertexSE3Euler)
 
 G2O_REGISTER_TYPE (EDGE3, EdgeSE3Euler)
 
 G2O_REGISTER_TYPE (VERTEX_PLANE, VertexPlane)
 
 G2O_REGISTER_TYPE (EDGE_SE3_PLANE_CALIB, EdgeSE3PlaneSensorCalib)
 
 G2O_REGISTER_TYPE (VERTEX_LINE3D, VertexLine3D)
 
 G2O_REGISTER_TYPE (EDGE_SE3_LINE3D, EdgeSE3Line3D)
 
 G2O_REGISTER_TYPE (EDGE_PLANE, EdgePlane)
 
 G2O_REGISTER_TYPE (EDGE_SE3_CALIB, EdgeSE3Calib)
 
 G2O_ATTRIBUTE_CONSTRUCTOR (init_slam3d_addons_types)
 

Variables

class G2O_CORE_API OptimizationAlgorithm
 
static const double INFORMATION_SCALING_ODOMETRY = 100
 
static std::uniform_real_distribution< double > _uniformReal
 
static std::mt19937 _gen_real
 

Detailed Description

Basic types definitions for SBA translation to HChol

Camera nodes use camera pose in real world v3 position normalized quaternion rotation

Point nodes: v3 position

Typedef Documentation

◆ Affine2

using g2o::Affine2 = typedef Eigen::Transform<double, 2, Eigen::Affine, Eigen::ColMajor>

Definition at line 78 of file eigen_types.h.

◆ Affine3

using g2o::Affine3 = typedef Eigen::Transform<double, 3, Eigen::Affine, Eigen::ColMajor>

Definition at line 79 of file eigen_types.h.

◆ AngleAxis

using g2o::AngleAxis = typedef Eigen::AngleAxis<double>

Definition at line 82 of file eigen_types.h.

◆ BaseMultiEdge

template<int D, typename E >
using g2o::BaseMultiEdge = typedef BaseVariableSizedEdge<D, E>

Definition at line 35 of file base_multi_edge.h.

◆ BatchStatisticsContainer

Definition at line 86 of file batch_stats.h.

◆ BlockSolver_3_2

using g2o::BlockSolver_3_2 = typedef BlockSolverPL<3, 2>

Definition at line 200 of file block_solver.h.

◆ BlockSolver_6_3

using g2o::BlockSolver_6_3 = typedef BlockSolverPL<6, 3>

Definition at line 194 of file block_solver.h.

◆ BlockSolver_7_3

using g2o::BlockSolver_7_3 = typedef BlockSolverPL<7, 3>

Definition at line 197 of file block_solver.h.

◆ BlockSolverPL

template<int p, int l>
using g2o::BlockSolverPL = typedef BlockSolver<BlockSolverTraits<p, l> >

Definition at line 188 of file block_solver.h.

◆ BlockSolverX

using g2o::BlockSolverX = typedef BlockSolverPL<Eigen::Dynamic, Eigen::Dynamic>

Definition at line 191 of file block_solver.h.

◆ BoolProperty

typedef Property<bool> g2o::BoolProperty

Definition at line 149 of file property.h.

◆ DoubleProperty

typedef Property<double> g2o::DoubleProperty

Definition at line 151 of file property.h.

◆ EdgeStarMap

typedef std::map<HyperGraph::Edge*, Star*> g2o::EdgeStarMap

Definition at line 101 of file star.h.

◆ FloatProperty

typedef Property<float> g2o::FloatProperty

Definition at line 150 of file property.h.

◆ ForceLinkFunction

typedef void(* g2o::ForceLinkFunction) (void)

The following two functions are used to force linkage with static libraries.

Definition at line 181 of file misc.h.

◆ IntProperty

typedef Property<int> g2o::IntProperty

Definition at line 148 of file property.h.

◆ Isometry2

using g2o::Isometry2 = typedef Eigen::Transform<double, 2, Eigen::Isometry, Eigen::ColMajor>

Definition at line 76 of file eigen_types.h.

◆ Isometry3

using g2o::Isometry3 = typedef Eigen::Transform<double, 3, Eigen::Isometry, Eigen::ColMajor>

Definition at line 77 of file eigen_types.h.

◆ Matrix2

using g2o::Matrix2 = typedef MatrixN<2>

Definition at line 71 of file eigen_types.h.

◆ Matrix2F

using g2o::Matrix2F = typedef Eigen::Matrix<float, 2, 2, Eigen::ColMajor>

Definition at line 63 of file eigen_types.h.

◆ Matrix2I

using g2o::Matrix2I = typedef Eigen::Matrix<int, 2, 2, Eigen::ColMajor>

Definition at line 57 of file eigen_types.h.

◆ Matrix3

using g2o::Matrix3 = typedef MatrixN<3>

Definition at line 72 of file eigen_types.h.

◆ Matrix3F

using g2o::Matrix3F = typedef Eigen::Matrix<float, 3, 3, Eigen::ColMajor>

Definition at line 64 of file eigen_types.h.

◆ Matrix3I

using g2o::Matrix3I = typedef Eigen::Matrix<int, 3, 3, Eigen::ColMajor>

Definition at line 58 of file eigen_types.h.

◆ Matrix4

using g2o::Matrix4 = typedef MatrixN<4>

Definition at line 73 of file eigen_types.h.

◆ Matrix4F

using g2o::Matrix4F = typedef Eigen::Matrix<float, 4, 4, Eigen::ColMajor>

Definition at line 65 of file eigen_types.h.

◆ Matrix4I

using g2o::Matrix4I = typedef Eigen::Matrix<int, 4, 4, Eigen::ColMajor>

Definition at line 59 of file eigen_types.h.

◆ Matrix6

typedef Eigen::Matrix<double, 6, 6> g2o::Matrix6

Definition at line 38 of file line3d.h.

◆ Matrix6x4

typedef Eigen::Matrix<double, 6, 4> g2o::Matrix6x4

Definition at line 39 of file line3d.h.

◆ MatrixN

template<int N, typename T = double>
using g2o::MatrixN = typedef Eigen::Matrix<T, N, N, Eigen::ColMajor>

Definition at line 70 of file eigen_types.h.

◆ MatrixX

using g2o::MatrixX = typedef MatrixN<Eigen::Dynamic>

Definition at line 74 of file eigen_types.h.

◆ MatrixXF

using g2o::MatrixXF = typedef Eigen::Matrix<float, Eigen::Dynamic, Eigen::Dynamic, Eigen::ColMajor>

Definition at line 66 of file eigen_types.h.

◆ MatrixXI

using g2o::MatrixXI = typedef Eigen::Matrix<int, Eigen::Dynamic, Eigen::Dynamic, Eigen::ColMajor>

Definition at line 60 of file eigen_types.h.

◆ MotionInformationVector

using g2o::MotionInformationVector = typedef std::vector<MotionInformation>

Definition at line 44 of file motion_information.h.

◆ MySigmaPoint

typedef SigmaPoint<VectorXd> g2o::MySigmaPoint

Definition at line 39 of file edge_labeler.cpp.

◆ number_t

using g2o::number_t = typedef double

Definition at line 36 of file eigen_types.h.

◆ OrthonormalLine3D

Definition at line 51 of file line3d.h.

◆ ParameterVector

typedef std::vector<Parameter*> g2o::ParameterVector

Definition at line 54 of file parameter.h.

◆ Quaternion

using g2o::Quaternion = typedef Eigen::Quaternion<double>

Definition at line 81 of file eigen_types.h.

◆ Robot2D

Definition at line 42 of file simulator2d_base.h.

◆ Robot3D

Definition at line 42 of file simulator3d_base.h.

◆ RobustKernelPtr

typedef std::shared_ptr<RobustKernel> g2o::RobustKernelPtr

Definition at line 73 of file robust_kernel.h.

◆ Rotation2D

using g2o::Rotation2D = typedef Eigen::Rotation2D<double>

Definition at line 80 of file eigen_types.h.

◆ seconds

using g2o::seconds = typedef std::chrono::duration<double>

Definition at line 77 of file timeutil.h.

◆ SparseBlockMatrixX

Definition at line 270 of file sparse_block_matrix.h.

◆ StarSet

typedef std::set<Star*> g2o::StarSet

Definition at line 100 of file star.h.

◆ StringProperty

typedef Property<std::string> g2o::StringProperty

Definition at line 152 of file property.h.

◆ TicTocMap

typedef std::map<std::string, TicTocElement> g2o::TicTocMap

Definition at line 66 of file tictoc.cpp.

◆ Vector2

using g2o::Vector2 = typedef VectorN<2>

Definition at line 50 of file eigen_types.h.

◆ Vector2F

using g2o::Vector2F = typedef Eigen::Matrix<float, 2, 1, Eigen::ColMajor>

Definition at line 43 of file eigen_types.h.

◆ Vector2I

using g2o::Vector2I = typedef Eigen::Matrix<int, 2, 1, Eigen::ColMajor>

Definition at line 38 of file eigen_types.h.

◆ Vector3

using g2o::Vector3 = typedef VectorN<3>

Definition at line 51 of file eigen_types.h.

◆ Vector3F

using g2o::Vector3F = typedef Eigen::Matrix<float, 3, 1, Eigen::ColMajor>

Definition at line 44 of file eigen_types.h.

◆ Vector3I

using g2o::Vector3I = typedef Eigen::Matrix<int, 3, 1, Eigen::ColMajor>

Definition at line 39 of file eigen_types.h.

◆ Vector4

using g2o::Vector4 = typedef VectorN<4>

Definition at line 52 of file eigen_types.h.

◆ Vector4F

using g2o::Vector4F = typedef Eigen::Matrix<float, 4, 1, Eigen::ColMajor>

Definition at line 45 of file eigen_types.h.

◆ Vector4I

using g2o::Vector4I = typedef Eigen::Matrix<int, 4, 1, Eigen::ColMajor>

Definition at line 40 of file eigen_types.h.

◆ Vector6

typedef Eigen::Matrix< double, 6, 1 > g2o::Vector6

Definition at line 53 of file eigen_types.h.

◆ Vector7

using g2o::Vector7 = typedef VectorN<7>

Definition at line 54 of file eigen_types.h.

◆ VectorN

template<int N, typename T = double>
using g2o::VectorN = typedef Eigen::Matrix<T, N, 1, Eigen::ColMajor>

Definition at line 49 of file eigen_types.h.

◆ VectorX

using g2o::VectorX = typedef VectorN<Eigen::Dynamic>

Definition at line 55 of file eigen_types.h.

◆ VectorXF

using g2o::VectorXF = typedef Eigen::Matrix<float, Eigen::Dynamic, 1, Eigen::ColMajor>

Definition at line 46 of file eigen_types.h.

◆ VectorXI

using g2o::VectorXI = typedef Eigen::Matrix<int, Eigen::Dynamic, 1, Eigen::ColMajor>

Definition at line 41 of file eigen_types.h.

◆ VertexStarMap

Definition at line 99 of file star.h.

◆ VertexStarMultimap

Definition at line 98 of file star.h.

◆ WorldObjectLine3D

Definition at line 40 of file simulator3d_base.h.

◆ WorldObjectPointXY

Definition at line 38 of file simulator2d_base.h.

◆ WorldObjectSE2

Definition at line 36 of file simulator2d_base.h.

◆ WorldObjectSE3

Definition at line 36 of file simulator3d_base.h.

◆ WorldObjectSegment2D

Definition at line 40 of file simulator2d_base.h.

◆ WorldObjectTrackXYZ

Definition at line 38 of file simulator3d_base.h.

Enumeration Type Documentation

◆ CommandArgumentType

Enumerator
CAT_DOUBLE 
CAT_FLOAT 
CAT_INT 
CAT_STRING 
CAT_BOOL 
CAT_VECTOR_INT 
CAT_VECTOR_DOUBLE 

Definition at line 94 of file command_args.cpp.

94 {
97 CAT_INT,
102};
@ CAT_VECTOR_DOUBLE
@ CAT_DOUBLE
@ CAT_FLOAT
@ CAT_VECTOR_INT
@ CAT_STRING

Function Documentation

◆ _skew()

static Matrix3 g2o::_skew ( const Vector3 t)
inlinestatic

Definition at line 35 of file line3d.cpp.

35 {
36 Matrix3 S;
37 S << 0, -t.z(), t.y(), t.z(), 0, -t.x(), -t.y(), t.x(), 0;
38 return S;
39}
MatrixN< 3 > Matrix3
Definition eigen_types.h:72

Referenced by g2o::Line3D::toCartesian().

◆ _univariateSampler()

static std::normal_distribution< double > g2o::_univariateSampler ( 0.  ,
1.   
)
static

Referenced by sampleGaussian().

◆ activeVertexChi()

double g2o::activeVertexChi ( const OptimizableGraph::Vertex v)

Definition at line 44 of file simple_star_ops.cpp.

44 {
45 const SparseOptimizer* s = dynamic_cast<const SparseOptimizer*>(v->graph());
47 double chi = 0;
48 int ne = 0;
49 for (HyperGraph::EdgeSet::iterator it = v->edges().begin();
50 it != v->edges().end(); ++it) {
51 OptimizableGraph::Edge* e = dynamic_cast<OptimizableGraph::Edge*>(*it);
52 if (!e) continue;
53 if (s->findActiveEdge(e) != av.end()) {
54 chi += e->chi2();
55 ne++;
56 }
57 }
58 if (!ne) return -1;
59 return chi / ne;
60}
const EdgeSet & edges() const
returns the set of hyper-edges that are leaving/entering in this vertex
virtual double chi2() const =0
const OptimizableGraph * graph() const
const EdgeContainer & activeEdges() const
the edges active in the current optimization
EdgeContainer::const_iterator findActiveEdge(const OptimizableGraph::Edge *e) const
std::vector< OptimizableGraph::Edge * > EdgeContainer
vector container for edges

References g2o::SparseOptimizer::activeEdges(), g2o::OptimizableGraph::Edge::chi2(), g2o::HyperGraph::Vertex::edges(), g2o::SparseOptimizer::findActiveEdge(), and g2o::OptimizableGraph::Vertex::graph().

◆ addOdometryCalibLinksDifferential()

G2O_CALIBRATION_ODOM_LASER_API void g2o::addOdometryCalibLinksDifferential ( SparseOptimizer optimizer,
const DataQueue odomData 
)

Definition at line 50 of file sclam_helpers.cpp.

51 {
52 SparseOptimizer::Vertex* odomParamsVertex = 0;
53 odomParamsVertex = new VertexOdomDifferentialParams;
54 odomParamsVertex->setToOrigin();
55 odomParamsVertex->setId(Gm2dlIO::ID_ODOMCALIB);
56 optimizer.addVertex(odomParamsVertex);
57
58 SparseOptimizer::EdgeSet odomCalibEdges;
59 for (SparseOptimizer::EdgeSet::const_iterator it = optimizer.edges().begin();
60 it != optimizer.edges().end(); ++it) {
61 EdgeSE2SensorCalib* scanmatchEdge = dynamic_cast<EdgeSE2SensorCalib*>(*it);
62 if (!scanmatchEdge) continue;
63
64 VertexSE2* r1 = dynamic_cast<VertexSE2*>(scanmatchEdge->vertices()[0]);
65 VertexSE2* r2 = dynamic_cast<VertexSE2*>(scanmatchEdge->vertices()[1]);
66 if (r2->id() - r1->id() != 1) { // ignore non-incremental edges
67 continue;
68 }
69
70 RobotLaser* rl1 = dynamic_cast<RobotLaser*>(r1->userData());
71 RobotLaser* rl2 = dynamic_cast<RobotLaser*>(r2->userData());
72 RobotLaser* odom1 =
73 dynamic_cast<RobotLaser*>(odomData.findClosestData(rl1->timestamp()));
74 RobotLaser* odom2 =
75 dynamic_cast<RobotLaser*>(odomData.findClosestData(rl2->timestamp()));
76
77 if (fabs(rl1->timestamp() - rl2->timestamp()) < 1e-7) {
78 cerr << "strange edge " << r1->id() << " <-> " << r2->id() << endl;
79 cerr << FIXED(PVAR(rl1->timestamp()) << "\t " << PVAR(rl2->timestamp()))
80 << endl;
81 cerr << FIXED(PVAR(odom1->timestamp())
82 << "\t " << PVAR(odom2->timestamp()))
83 << endl;
84 }
85
86 // cerr << PVAR(odom1->odomPose().toVector().transpose()) << endl;
87
88 SE2 odomMotion = odom1->odomPose().inverse() * odom2->odomPose();
89 // cerr << PVAR(odomMotion.toVector().transpose()) << endl;
90 // cerr << PVAR(scanmatchEdge->measurement().toVector().transpose()) <<
91 // endl;
92
93 EdgeSE2OdomDifferentialCalib* e = new EdgeSE2OdomDifferentialCalib;
94 e->vertices()[0] = r1;
95 e->vertices()[1] = r2;
96 e->vertices()[2] = odomParamsVertex;
97
98 MotionMeasurement mm(
99 odomMotion.translation().x(), odomMotion.translation().y(),
100 odomMotion.rotation().angle(), odom2->timestamp() - odom1->timestamp());
101 e->setMeasurement(OdomConvert::convertToVelocity(mm));
102 // cerr << PVAR(e->measurement()) << endl;
103
104 e->information() = Matrix3d::Identity() * INFORMATION_SCALING_ODOMETRY;
105 odomCalibEdges.insert(e);
106 }
107
108 for (SparseOptimizer::EdgeSet::iterator it = odomCalibEdges.begin();
109 it != odomCalibEdges.end(); ++it)
110 optimizer.addEdge(dynamic_cast<OptimizableGraph::Edge*>(*it));
111}
RobotData * findClosestData(double timestamp) const
scanmatch measurement that also calibrates an offset for the laser
const Data * userData() const
the user data associated with this vertex
const VertexContainer & vertices() const
abstract Vertex, your types must derive from that one
int id() const
returns the id
virtual void setId(int newId)
std::set< Edge * > EdgeSet
const EdgeSet & edges() const
2D pose Vertex, (x,y,theta)
Definition vertex_se2.h:41
static const double INFORMATION_SCALING_ODOMETRY
virtual bool addEdge(HyperGraph::Edge *e)
virtual bool addVertex(HyperGraph::Vertex *v, Data *userData)

References g2o::OptimizableGraph::addEdge(), g2o::OptimizableGraph::addVertex(), g2o::OdomConvert::convertToVelocity(), g2o::HyperGraph::edges(), g2o::DataQueue::findClosestData(), g2o::HyperGraph::Vertex::id(), g2o::Gm2dlIO::ID_ODOMCALIB, g2o::BaseEdge< D, E >::information(), INFORMATION_SCALING_ODOMETRY, g2o::SE2::inverse(), g2o::RobotLaser::odomPose(), g2o::SE2::rotation(), g2o::HyperGraph::Vertex::setId(), g2o::BaseEdge< D, E >::setMeasurement(), g2o::RobotData::timestamp(), g2o::SE2::translation(), g2o::HyperGraph::DataContainer::userData(), and g2o::HyperGraph::Edge::vertices().

Referenced by main().

◆ allocate_aligned()

template<typename Type >
Type * g2o::allocate_aligned ( size_t  n)

Definition at line 10 of file dynamic_aligned_buffer.hpp.

10 {
11 return (Type*)Eigen::internal::aligned_malloc(n * sizeof(Type));
12}

◆ allocateSolverForSclam()

G2O_CALIBRATION_ODOM_LASER_API void g2o::allocateSolverForSclam ( SparseOptimizer optimizer,
bool  levenberg 
)

Definition at line 113 of file sclam_helpers.cpp.

113 {
114 typedef BlockSolver<BlockSolverTraits<-1, -1> > SclamBlockSolver;
116
117 std::unique_ptr<SclamLinearSolver> linearSolver =
118 std::make_unique<SclamLinearSolver>();
119 linearSolver->setBlockOrdering(false);
120 OptimizationAlgorithm* solver = 0;
121 if (levenberg) {
123 std::make_unique<SclamBlockSolver>(std::move(linearSolver)));
124 } else {
125 solver = new OptimizationAlgorithmGaussNewton(
126 std::make_unique<SclamBlockSolver>(std::move(linearSolver)));
127 }
128 optimizer.setAlgorithm(solver);
129}
Implementation of a solver operating on the blocks of the Hessian.
linear solver which uses the sparse Cholesky solver from Eigen
Implementation of the Levenberg Algorithm.
Generic interface for a non-linear solver operating on a graph.
void setAlgorithm(OptimizationAlgorithm *algorithm)
traits to summarize the properties of the fixed size optimization problem

References g2o::SparseOptimizer::setAlgorithm().

Referenced by main().

◆ applyAction()

void G2O_CORE_API g2o::applyAction ( HyperGraph graph,
HyperGraphElementAction action,
HyperGraphElementAction::Parameters parameters = 0,
const std::string &  typeName = "" 
)

apply an action to all the elements of the graph.

Definition at line 261 of file hyper_graph_action.cpp.

263 {
264 for (HyperGraph::VertexIDMap::iterator it = graph->vertices().begin();
265 it != graph->vertices().end(); ++it) {
266 auto& aux = *it->second;
267 if (typeName.empty() || typeid(aux).name() == typeName) {
268 (*action)(it->second, params);
269 }
270 }
271 for (HyperGraph::EdgeSet::iterator it = graph->edges().begin();
272 it != graph->edges().end(); ++it) {
273 auto& aux = **it;
274 if (typeName.empty() || typeid(aux).name() == typeName)
275 (*action)(*it, params);
276 }
277}
const VertexIDMap & vertices() const

References g2o::HyperGraph::edges(), and g2o::HyperGraph::vertices().

Referenced by g2o::G2oQGLViewer::draw().

◆ arrayHasNaN()

bool g2o::arrayHasNaN ( const double *  array,
int  size,
int *  nanIndex = 0 
)
inline

tests whether there is a NaN in the array

Definition at line 168 of file misc.h.

168 {
169 for (int i = 0; i < size; ++i)
170 if (g2o_isnan(array[i])) {
171 if (nanIndex) *nanIndex = i;
172 return true;
173 }
174 return false;
175}
#define g2o_isnan(x)
Definition macros.h:100

References g2o_isnan.

Referenced by g2o::BlockSolver< Traits >::buildSystem(), g2o::SparseOptimizer::computeActiveErrors(), g2o::SparseOptimizer::initializeOptimization(), and g2o::SparseOptimizer::update().

◆ assignHierarchicalEdges()

void g2o::assignHierarchicalEdges ( StarSet stars,
EdgeStarMap esmap,
EdgeLabeler labeler,
EdgeCreator creator,
SparseOptimizer optimizer,
int  minNumEdges,
int  maxIterations 
)

Definition at line 111 of file simple_star_ops.cpp.

114 {
115 // now construct the hierarchical edges for all the stars
116 for (StarSet::iterator it = stars.begin(); it != stars.end(); ++it) {
117 Star* s = *it;
118 std::vector<OptimizableGraph::Vertex*> vertices(2);
119 vertices[0] = (OptimizableGraph::Vertex*)*s->_gauge.begin();
121 for (HyperGraph::VertexSet::iterator vit = s->_lowLevelVertices.begin();
122 vit != s->_lowLevelVertices.end(); ++vit) {
124 vertices[1] = v;
125 if (v == vertices[0]) continue;
127 int numEdges = vertexEdgesInStar(eInSt, v, s, esmap);
128 if (Factory::instance()->tag(v) ==
129 Factory::instance()->tag(vertices[0]) ||
130 numEdges > minNumEdges) {
131 OptimizableGraph::Edge* e = creator->createEdge(vertices);
132 // cerr << "creating edge" << e << endl;
133 if (e) {
134 e->setLevel(1);
135 optimizer->addEdge(e);
136 s->_starEdges.insert(e);
137 }
138 } else {
139 vNew.erase(v);
140 // remove from the star all edges that are not sufficiently connected
141 for (HyperGraph::EdgeSet::iterator it = eInSt.begin();
142 it != eInSt.end(); ++it) {
143 HyperGraph::Edge* e = *it;
144 s->lowLevelEdges().erase(e);
145 }
146 }
147 }
148 s->lowLevelVertices() = vNew;
149
150 bool labelOk = s->labelStarEdges(maxIterations, labeler);
151 assert(labelOk);
152 (void)labelOk;
153 }
154}
std::set< Vertex * > VertexSet
void setLevel(int l)
sets the level of the edge
A general case Vertex for optimization.
size_t vertexEdgesInStar(HyperGraph::EdgeSet &eset, HyperGraph::Vertex *v, Star *s, EdgeStarMap &esmap)
OptimizableGraph::Edge * createEdge(std::vector< OptimizableGraph::Vertex * > &vertices)
bool labelStarEdges(int iterations, EdgeLabeler *labeler)
Definition star.cpp:37
HyperGraph::VertexSet _lowLevelVertices
vertices that are fixed (center of the star)
Definition star.h:95
HyperGraph::EdgeSet & lowLevelEdges()
low level edge set
Definition star.h:72
HyperGraph::VertexSet & lowLevelVertices()
set of all vertices in the low level
Definition star.h:80
HyperGraph::VertexSet _gauge
vertices that are fixed (center of the star)
Definition star.h:93
HyperGraph::EdgeSet _starEdges
edges in the star
Definition star.h:89

References g2o::Star::_gauge, g2o::Star::_lowLevelVertices, g2o::Star::_starEdges, g2o::OptimizableGraph::addEdge(), g2o::EdgeCreator::createEdge(), g2o::Factory::instance(), g2o::Star::labelStarEdges(), g2o::Star::lowLevelEdges(), g2o::Star::lowLevelVertices(), g2o::OptimizableGraph::Edge::setLevel(), and vertexEdgesInStar().

◆ average_angle()

double g2o::average_angle ( double  theta1,
double  theta2 
)
inline

average two angles

Definition at line 119 of file misc.h.

119 {
120 double x, y;
121
122 x = std::cos(theta1) + std::cos(theta2);
123 y = std::sin(theta1) + std::sin(theta2);
124 if (x == 0 && y == 0)
125 return 0;
126 else
127 return std::atan2(y, x);
128}

◆ changeFileExtension()

G2O_STUFF_API std::string g2o::changeFileExtension ( const std::string &  filename,
const std::string &  newExt,
bool  stripDot = false 
)

change the fileextension of a given filename. Only if filename contains an extension, otherwise filename is returned.

Definition at line 102 of file filesys_tools.cpp.

103 {
104 std::string::size_type lastDot = filename.find_last_of('.');
105 if (lastDot != std::string::npos) {
106 if (stripDot)
107 return filename.substr(0, lastDot) + newExt;
108 else
109 return filename.substr(0, lastDot + 1) + newExt;
110 } else
111 return filename;
112}

◆ clamp()

template<typename T >
T g2o::clamp ( l,
x,
u 
)
inline

clamp x to the interval [l, u]

Definition at line 148 of file misc.h.

148 {
149 if (x < l) return l;
150 if (x > u) return u;
151 return x;
152}

◆ clipSegmentCircle()

G2O_SIMULATOR_API int g2o::clipSegmentCircle ( Eigen::Vector2d &  p1,
Eigen::Vector2d &  p2,
double  r 
)

Definition at line 37 of file simutils.cpp.

37 {
38 double r2 = r * r;
39 Eigen::Vector2d pBase = p1;
40 Eigen::Vector2d dp = p2 - p1;
41 double length = dp.norm();
42 dp.normalize();
43 double p = 2 * dp.dot(p1);
44 double q = p1.squaredNorm() - r2;
45 double disc = p * p - 4 * q;
46
47 if (disc <= 0) { // no intersection or single point intersection
48 return -1;
49 }
50 disc = sqrt(disc);
51
52 double t1 = .5 * (-p - disc);
53 double t2 = .5 * (-p + disc);
54
55 if (t1 > length || t2 < 0) return -1; // no intersection
56 bool clip1 = false;
57 bool clip2 = false;
58 if (t1 > 0) {
59 p1 = pBase + dp * t1;
60 clip1 = true;
61 }
62 if (t2 < length) {
63 p2 = pBase + dp * t1;
64 clip2 = true;
65 }
66 if (clip1)
67 if (clip2)
68 return 3;
69 else
70 return 0;
71 else if (clip2)
72 return 1;
73 return 2;
74}

Referenced by g2o::SensorSegment2D::isVisible(), g2o::SensorSegment2DLine::isVisible(), and g2o::SensorSegment2DPointLine::isVisible().

◆ clipSegmentFov()

G2O_SIMULATOR_API int g2o::clipSegmentFov ( Eigen::Vector2d &  p1,
Eigen::Vector2d &  p2,
double  min,
double  max 
)

Definition at line 107 of file simutils.cpp.

108 {
109 bool clip1 = false, clip2 = false;
110 // normal to the first line
111 double amin = sin(min), bmin = -cos(min);
112 int minClip = clipSegmentLine(p1, p2, amin, bmin, 0);
113 switch (minClip) {
114 case -1:
115 return -1;
116 case 0:
117 clip1 = true;
118 break;
119 case 1:
120 clip2 = true;
121 break;
122 default:;
123 }
124 // normal to the second line
125 double amax = -sin(max), bmax = cos(max);
126 int maxClip = clipSegmentLine(p1, p2, amax, bmax, 0);
127 switch (maxClip) {
128 case -1:
129 return -1;
130 case 0:
131 clip1 = true;
132 break;
133 case 1:
134 clip2 = true;
135 break;
136 default:;
137 }
138 if (clip1)
139 if (clip2)
140 return 3;
141 else
142 return 0;
143 else if (clip2)
144 return 1;
145 return 2;
146}
int clipSegmentLine(Eigen::Vector2d &p1, Eigen::Vector2d &p2, double a, double b, double c)
Definition simutils.cpp:81

References clipSegmentLine().

Referenced by g2o::SensorSegment2D::isVisible(), g2o::SensorSegment2DLine::isVisible(), and g2o::SensorSegment2DPointLine::isVisible().

◆ clipSegmentLine()

G2O_SIMULATOR_API int g2o::clipSegmentLine ( Eigen::Vector2d &  p1,
Eigen::Vector2d &  p2,
double  a,
double  b,
double  c 
)

Definition at line 81 of file simutils.cpp.

82 {
83 bool p1inside = true;
84 bool p2inside = true;
85 if (a * p1.x() + b * p1.y() + c < 0) {
86 p1inside = false;
87 }
88 if (a * p2.x() + b * p2.y() + c < 0) {
89 p2inside = false;
90 }
91 if (p1inside && p2inside) return 2;
92 if (!p1inside && !p2inside) return -1;
93
94 Eigen::Vector2d dp = p2 - p1;
95 double den = a * dp.x() + b * dp.y();
96 if (den == 0) return -1;
97 double num = c + a * p1.x() + b * p1.y();
98 double t = -num / den;
99 if (p1inside) {
100 p2 = p1 + dp * t;
101 return 1;
102 }
103 p1 = p1 + dp * t;
104 return 0;
105}

Referenced by clipSegmentFov().

◆ computeBorder()

G2O_HIERARCHICAL_API void g2o::computeBorder ( StarSet stars,
EdgeStarMap hesmap 
)

Definition at line 156 of file simple_star_ops.cpp.

156 {
157 for (StarSet::iterator it = stars.begin(); it != stars.end(); ++it) {
158 Star* s = *it;
159 for (HyperGraph::EdgeSet::iterator iit = s->_starEdges.begin();
160 iit != s->_starEdges.end(); ++iit) {
162 StarSet sset;
163 starsInEdge(sset, e, hesmap, s->gauge());
164 // cerr << "e: " << e << " l:" << e->level() << " sset.size()=" <<
165 // sset.size() << endl;
166 if (sset.size() > 1) {
167 s->starFrontierEdges().insert(e);
168 }
169 }
170 }
171}
std::set< Star * > StarSet
Definition star.h:100
void starsInEdge(StarSet &stars, HyperGraph::Edge *e, EdgeStarMap &esmap, HyperGraph::VertexSet &gauge)
HyperGraph::EdgeSet & starFrontierEdges()
edges in the high level that lead to some node owned by a different star
Definition star.h:76
HyperGraph::VertexSet & gauge()
set of nodes to keep fixed in the optimization
Definition star.h:78

References g2o::Star::_starEdges, g2o::Star::gauge(), g2o::Star::starFrontierEdges(), and starsInEdge().

Referenced by main().

◆ computeLineParameters()

G2O_SIMULATOR_API Eigen::Vector2d g2o::computeLineParameters ( const Eigen::Vector2d &  p1,
const Eigen::Vector2d &  p2 
)

Definition at line 148 of file simutils.cpp.

149 {
150 Eigen::Vector2d lp;
151 Eigen::Vector2d dp = p2 - p1;
152 lp[0] = atan2(-dp.x(), dp.y());
153 Eigen::Vector2d n(cos(lp[0]), sin(lp[0]));
154 lp[1] = n.dot(p1 + p2) * .5;
155 return lp;
156}

Referenced by LineInfo::LineInfo(), and main().

◆ computeSimpleStars()

G2O_HIERARCHICAL_API void g2o::computeSimpleStars ( StarSet stars,
SparseOptimizer optimizer,
EdgeLabeler labeler,
EdgeCreator creator,
OptimizableGraph::Vertex gauge_,
std::string  edgeTag,
std::string  vertexTag,
int  level,
int  step,
int  backboneIterations,
int  starIterations,
double  rejectionThreshold,
bool  debug 
)

Definition at line 173 of file simple_star_ops.cpp.

178 {
179 HyperDijkstra d(optimizer);
180 // compute a spanning tree based on the types of edges and vertices in the
181 // pool
182 EdgeTypesCostFunction f(edgeTag, vertexTag, level);
183 d.shortestPaths(gauge_, &f, std::numeric_limits<double>::max(), 1e-6, false,
184 std::numeric_limits<double>::max() / 2);
185
186 HyperDijkstra::computeTree(d.adjacencyMap());
187 // constructs the stars on the backbone
188
189 BackBoneTreeAction bact(optimizer, vertexTag, level, step);
190 bact.init();
191
192 // perform breadth-first visit of the visit tree and create the stars on the
193 // backbone
194 d.visitAdjacencyMap(d.adjacencyMap(), &bact, true);
195 stars.clear();
196
197 for (VertexStarMultimap::iterator it = bact.vertexStarMultiMap().begin();
198 it != bact.vertexStarMultiMap().end(); ++it) {
199 stars.insert(it->second);
200 }
201
202 // for each star
203
204 // for all vertices in the backbone, select all edges leading/leaving from
205 // that vertex that are contained in freeEdges.
206
207 // mark the corresponding "open" vertices and add them to a multimap
208 // (vertex->star)
209
210 // select a gauge in the backbone
211
212 // push all vertices on the backbone
213
214 // compute an initial guess on the backbone
215
216 // one round of optimization backbone
217
218 // lock all vertices in the backbone
219
220 // push all "open" vertices
221
222 // for each open vertex,
223 // compute an initial guess given the backbone
224 // do some rounds of solveDirect
225 // if (fail)
226 // - remove the vertex and the edges in that vertex from the star
227 // - make the structures consistent
228
229 // pop all "open" vertices
230 // pop all "vertices" in the backbone
231 // unfix the vertices in the backbone
232
233 int starNum = 0;
234 for (StarSet::iterator it = stars.begin(); it != stars.end(); ++it) {
235 Star* s = *it;
236 HyperGraph::VertexSet backboneVertices = s->_lowLevelVertices;
237 HyperGraph::EdgeSet backboneEdges = s->_lowLevelEdges;
238 if (backboneEdges.empty()) continue;
239
240 // cerr << "optimizing backbone" << endl;
241 // one of these should be the gauge, to be simple we select the first one
242 // in the backbone
243 OptimizableGraph::VertexSet gauge;
244 gauge.insert(*backboneVertices.begin());
245 s->gauge() = gauge;
246 s->optimizer()->push(backboneVertices);
247 s->optimizer()->setFixed(gauge, true);
248 s->optimizer()->initializeOptimization(backboneEdges);
249 s->optimizer()->computeInitialGuess();
250 s->optimizer()->optimize(backboneIterations);
251 s->optimizer()->setFixed(backboneVertices, true);
252
253 // cerr << "assignind edges.vertices not in bbone" << endl;
254 HyperGraph::EdgeSet otherEdges;
255 HyperGraph::VertexSet otherVertices;
256 std::multimap<HyperGraph::Vertex*, HyperGraph::Edge*> vemap;
257 for (HyperGraph::VertexSet::iterator bit = backboneVertices.begin();
258 bit != backboneVertices.end(); ++bit) {
259 HyperGraph::Vertex* v = *bit;
260 for (HyperGraph::EdgeSet::iterator eit = v->edges().begin();
261 eit != v->edges().end(); ++eit) {
262 OptimizableGraph::Edge* e = (OptimizableGraph::Edge*)*eit;
263 HyperGraph::EdgeSet::iterator feit = bact.freeEdges().find(e);
264 if (feit != bact.freeEdges().end()) { // edge is admissible
265 otherEdges.insert(e);
266 bact.freeEdges().erase(feit);
267 for (size_t i = 0; i < e->vertices().size(); i++) {
268 OptimizableGraph::Vertex* ve =
269 (OptimizableGraph::Vertex*)e->vertices()[i];
270 if (backboneVertices.find(ve) == backboneVertices.end()) {
271 otherVertices.insert(ve);
272 vemap.insert(make_pair(ve, e));
273 }
274 }
275 }
276 }
277 }
278
279 // RAINER TODO maybe need a better solution than dynamic casting here??
280 OptimizationAlgorithmWithHessian* solverWithHessian =
281 dynamic_cast<OptimizationAlgorithmWithHessian*>(
282 s->optimizer()->solver());
283 if (solverWithHessian) {
284 s->optimizer()->push(otherVertices);
285 // cerr << "optimizing vertices out of bbone" << endl;
286 // cerr << "push" << endl;
287 // cerr << "init" << endl;
288 s->optimizer()->initializeOptimization(otherEdges);
289 // cerr << "guess" << endl;
290 s->optimizer()->computeInitialGuess();
291 // cerr << "solver init" << endl;
292 s->optimizer()->solver()->init();
293 // cerr << "structure" << endl;
294 if (!solverWithHessian->buildLinearStructure())
295 cerr << "FATAL: failure while building linear structure" << endl;
296 // cerr << "errors" << endl;
297 s->optimizer()->computeActiveErrors();
298 // cerr << "system" << endl;
299 solverWithHessian->updateLinearSystem();
300 // cerr << "directSolove" << endl;
301 } else {
302 cerr << "FATAL: hierarchical thing cannot be used with a solver that "
303 "does not support the system structure "
304 "construction"
305 << endl;
306 }
307
308 // // then optimize the vertices one at a time to check if a solution is
309 // good
310 for (HyperGraph::VertexSet::iterator vit = otherVertices.begin();
311 vit != otherVertices.end(); ++vit) {
312 OptimizableGraph::Vertex* v = (OptimizableGraph::Vertex*)(*vit);
313 v->solveDirect();
314 // cerr << " " << d;
315 // if a solution is found, add a vertex and all the edges in
316 // othervertices that are pointing to that edge to the star
317 s->_lowLevelVertices.insert(v);
318 for (HyperGraph::EdgeSet::iterator eit = v->edges().begin();
319 eit != v->edges().end(); ++eit) {
320 OptimizableGraph::Edge* e = (OptimizableGraph::Edge*)*eit;
321 if (otherEdges.find(e) != otherEdges.end()) s->_lowLevelEdges.insert(e);
322 }
323 }
324 // cerr << endl;
325
326 // relax the backbone and optimize it all
327 // cerr << "relax bbone" << endl;
328 s->optimizer()->setFixed(backboneVertices, false);
329 // cerr << "fox gauge bbone" << endl;
330 s->optimizer()->setFixed(s->gauge(), true);
331
332 // cerr << "opt init" << endl;
333 s->optimizer()->initializeOptimization(s->_lowLevelEdges);
334 optimizer->computeActiveErrors();
335 int starOptResult = s->optimizer()->optimize(starIterations);
336 // cerr << starOptResult << "(" << starIterations << ") " << endl;
337
338 if (!starIterations || starOptResult > 0) {
339 optimizer->computeActiveErrors();
340
341#if 1
342
343 s->optimizer()->computeActiveErrors();
344 // cerr << "system" << endl;
345 if (solverWithHessian) solverWithHessian->updateLinearSystem();
346 HyperGraph::EdgeSet prunedStarEdges = backboneEdges;
347 HyperGraph::VertexSet prunedStarVertices = backboneVertices;
348 for (HyperGraph::VertexSet::iterator vit = otherVertices.begin();
349 vit != otherVertices.end(); ++vit) {
350 // discard the vertices whose error is too big
351
352 OptimizableGraph::Vertex* v = (OptimizableGraph::Vertex*)(*vit);
353 MatrixXd h(v->dimension(), v->dimension());
354 for (int i = 0; i < v->dimension(); i++) {
355 for (int j = 0; j < v->dimension(); j++) h(i, j) = v->hessian(i, j);
356 }
357 EigenSolver<Eigen::MatrixXd> esolver;
358 esolver.compute(h);
359 VectorXcd ev = esolver.eigenvalues();
360 double emin = std::numeric_limits<double>::max();
361 double emax = -std::numeric_limits<double>::max();
362 for (int i = 0; i < ev.size(); i++) {
363 emin = ev(i).real() > emin ? emin : ev(i).real();
364 emax = ev(i).real() < emax ? emax : ev(i).real();
365 }
366
367 double d = emin / emax;
368
369 // cerr << " " << d;
370 if (d > rejectionThreshold) {
371 // if a solution is found, add a vertex and all the edges in
372 // othervertices that are pointing to that edge to the star
373 prunedStarVertices.insert(v);
374 for (HyperGraph::EdgeSet::iterator eit = v->edges().begin();
375 eit != v->edges().end(); ++eit) {
376 OptimizableGraph::Edge* e = (OptimizableGraph::Edge*)*eit;
377 if (otherEdges.find(e) != otherEdges.end())
378 prunedStarEdges.insert(e);
379 }
380 // cerr << "K( " << v->id() << "," << d << ")" ;
381 }
382 }
383 s->_lowLevelEdges = prunedStarEdges;
384 s->_lowLevelVertices = prunedStarVertices;
385
386#endif
387 // cerr << "addHedges" << endl;
388 // now add to the star the hierarchical edges
389 std::vector<OptimizableGraph::Vertex*> vertices(2);
390 vertices[0] = (OptimizableGraph::Vertex*)*s->_gauge.begin();
391
392 for (HyperGraph::VertexSet::iterator vit = s->_lowLevelVertices.begin();
393 vit != s->_lowLevelVertices.end(); ++vit) {
394 OptimizableGraph::Vertex* v = (OptimizableGraph::Vertex*)*vit;
395 vertices[1] = v;
396 if (v == vertices[0]) continue;
397 OptimizableGraph::Edge* e = creator->createEdge(vertices);
398 // rr << "creating edge" << e << Factory::instance()->tag(vertices[0])
399 // << "->" << Factory::instance()->tag(v) <endl;
400 if (e) {
401 e->setLevel(level + 1);
402 optimizer->addEdge(e);
403 s->_starEdges.insert(e);
404 }
405 }
406 }
407
408 if (debug) {
409 char starLowName[100];
410 snprintf(starLowName, 99, "star-%04d-low.g2o", starNum);
411 ofstream starLowStream(starLowName);
412 optimizer->saveSubset(starLowStream, s->_lowLevelEdges);
413 }
414 bool labelOk = false;
415 if (!starIterations || starOptResult > 0)
416 labelOk = s->labelStarEdges(0, labeler);
417 if (labelOk) {
418 if (debug) {
419 char starHighName[100];
420 snprintf(starHighName, 99, "star-%04d-high.g2o", starNum);
421 ofstream starHighStream(starHighName);
422 optimizer->saveSubset(starHighStream, s->_starEdges);
423 }
424 }
425 starNum++;
426
427 // label each hierarchical edge
428 s->optimizer()->pop(otherVertices);
429 s->optimizer()->pop(backboneVertices);
430 s->optimizer()->setFixed(s->gauge(), false);
431 }
432
433 StarSet stars2;
434 // now erase the stars that have 0 edges. They r useless
435 for (StarSet::iterator it = stars.begin(); it != stars.end(); ++it) {
436 Star* s = *it;
437 if (s->lowLevelEdges().size() == 0) {
438 delete s;
439 } else
440 stars2.insert(s);
441 }
442 stars = stars2;
443}
yylloc step()
bool saveSubset(std::ostream &os, HyperGraph::VertexSet &vset, int level=0)
save a subgraph to a stream. Again uses the Factory system.

References g2o::Star::_gauge, g2o::Star::_lowLevelEdges, g2o::Star::_lowLevelVertices, g2o::Star::_starEdges, g2o::OptimizableGraph::addEdge(), g2o::HyperDijkstra::adjacencyMap(), g2o::OptimizationAlgorithmWithHessian::buildLinearStructure(), g2o::SparseOptimizer::computeActiveErrors(), g2o::SparseOptimizer::computeInitialGuess(), g2o::HyperDijkstra::computeTree(), g2o::EdgeCreator::createEdge(), g2o::OptimizableGraph::Vertex::dimension(), g2o::HyperGraph::Vertex::edges(), g2o::BackBoneTreeAction::freeEdges(), g2o::Star::gauge(), g2o::OptimizableGraph::Vertex::hessian(), g2o::BackBoneTreeAction::init(), g2o::OptimizationAlgorithm::init(), g2o::SparseOptimizer::initializeOptimization(), g2o::Star::labelStarEdges(), g2o::Star::lowLevelEdges(), g2o::SparseOptimizer::optimize(), g2o::Star::optimizer(), g2o::SparseOptimizer::pop(), g2o::SparseOptimizer::push(), g2o::OptimizableGraph::saveSubset(), g2o::OptimizableGraph::setFixed(), g2o::OptimizableGraph::Edge::setLevel(), g2o::HyperDijkstra::shortestPaths(), g2o::OptimizableGraph::Vertex::solveDirect(), g2o::SparseOptimizer::solver(), step(), g2o::OptimizationAlgorithmWithHessian::updateLinearSystem(), g2o::BackBoneTreeAction::vertexStarMultiMap(), g2o::HyperGraph::Edge::vertices(), and g2o::HyperDijkstra::visitAdjacencyMap().

Referenced by main().

◆ const_pi()

constexpr double g2o::const_pi ( )
constexpr

Definition at line 62 of file misc.h.

62{ return cst(3.14159265358979323846); }
constexpr double cst(long double v)
Definition misc.h:60

References cst().

Referenced by inverse_theta(), and normalize_theta().

◆ constructEdgeStarMap()

G2O_HIERARCHICAL_API void g2o::constructEdgeStarMap ( EdgeStarMap esmap,
StarSet stars,
bool  low 
)

Definition at line 62 of file simple_star_ops.cpp.

62 {
63 esmap.clear();
64 for (StarSet::iterator it = stars.begin(); it != stars.end(); ++it) {
65 Star* s = *it;
66 if (low) {
67 for (HyperGraph::EdgeSet::iterator it = s->lowLevelEdges().begin();
68 it != s->lowLevelEdges().end(); ++it) {
69 HyperGraph::Edge* e = *it;
70 esmap.insert(make_pair(e, s));
71 }
72 } else {
73 for (HyperGraph::EdgeSet::iterator it = s->starEdges().begin();
74 it != s->starEdges().end(); ++it) {
75 HyperGraph::Edge* e = *it;
76 esmap.insert(make_pair(e, s));
77 }
78 }
79 }
80}
HyperGraph::EdgeSet & starEdges()
high level edge set
Definition star.h:74

References g2o::Star::lowLevelEdges(), and g2o::Star::starEdges().

Referenced by main().

◆ convertString()

template<typename T >
bool g2o::convertString ( const std::string &  s,
T &  x,
bool  failIfLeftoverChars = true 
)

convert a string into an other type.

Definition at line 123 of file string_tools.h.

124 {
125 std::istringstream i(s);
126 char c;
127 if (!(i >> x) || (failIfLeftoverChars && i.get(c))) return false;
128 return true;
129}

Referenced by g2o::Property< T >::fromString(), and stringToType().

◆ createSolver() [1/8]

static OptimizationAlgorithm * g2o::createSolver ( const std::string &  fullSolverName)
static

Definition at line 54 of file solver_cholmod.cpp.

54 {
55 static const std::map<std::string,
56 std::function<std::unique_ptr<BlockSolverBase>()>>
57 solver_factories{
58 {"var_cholmod", &AllocateSolver<-1, -1, true>},
59 {"fix3_2_cholmod", &AllocateSolver<3, 2, true>},
60 {"fix6_3_cholmod", &AllocateSolver<6, 3, true>},
61 {"fix7_3_cholmod", &AllocateSolver<7, 3, true>},
62#ifdef ADD_SCALAR_ORDERING
63 {"fix3_2_cholmod_scalar", &AllocateSolver<3, 2, false>},
64 {"fix6_3_cholmod_scalar", &AllocateSolver<6, 3, false>},
65 {"fix7_3_cholmod_scalar", &AllocateSolver<7, 3, false>},
66#endif
67 };
68
69 string solverName = fullSolverName.substr(3);
70 auto solverf = solver_factories.find(solverName);
71 if (solverf == solver_factories.end()) return nullptr;
72
73 string methodName = fullSolverName.substr(0, 2);
74
75 if (methodName == "gn") {
76 return new OptimizationAlgorithmGaussNewton(solverf->second());
77 } else if (methodName == "lm") {
78 return new OptimizationAlgorithmLevenberg(solverf->second());
79 } else if (methodName == "dl") {
80 return new OptimizationAlgorithmDogleg(solverf->second());
81 }
82
83 return nullptr;
84}

◆ createSolver() [2/8]

static OptimizationAlgorithm * g2o::createSolver ( const std::string &  fullSolverName)
static

helper function for allocating

Definition at line 47 of file solver_csparse.cpp.

47 {
48 static const std::map<std::string,
49 std::function<std::unique_ptr<BlockSolverBase>()>>
50 solver_factories{
51 {"var_csparse", &AllocateSolver<-1, -1, true>},
52 {"fix3_2_csparse", &AllocateSolver<3, 2, true>},
53 {"fix6_3_csparse", &AllocateSolver<6, 3, true>},
54 {"fix7_3_csparse", &AllocateSolver<7, 3, true>},
55 {"fix3_2_scalar_csparse", &AllocateSolver<3, 2, false>},
56 {"fix6_3_scalar_csparse", &AllocateSolver<6, 3, false>},
57 {"fix7_3_scalar_csparse", &AllocateSolver<7, 3, false>},
58 };
59
60 string solverName = fullSolverName.substr(3);
61 auto solverf = solver_factories.find(solverName);
62 if (solverf == solver_factories.end()) return nullptr;
63
64 string methodName = fullSolverName.substr(0, 2);
65
66 if (methodName == "gn") {
67 return new OptimizationAlgorithmGaussNewton(solverf->second());
68 } else if (methodName == "lm") {
69 return new OptimizationAlgorithmLevenberg(solverf->second());
70 } else if (methodName == "dl") {
71 return new OptimizationAlgorithmDogleg(solverf->second());
72 }
73
74 return nullptr;
75}

◆ createSolver() [3/8]

static OptimizationAlgorithm * g2o::createSolver ( const std::string &  fullSolverName)
static

Definition at line 49 of file solver_dense.cpp.

49 {
50 static const std::map<std::string,
51 std::function<std::unique_ptr<g2o::Solver>()>>
52 solver_factories{
53 {"dense", &AllocateSolver<-1, -1>},
54 {"dense3_2", &AllocateSolver<3, 2>},
55 {"dense6_3", &AllocateSolver<6, 3>},
56 {"dense7_3", &AllocateSolver<7, 3>},
57 };
58
59 string solverName = fullSolverName.substr(3);
60 auto solverf = solver_factories.find(solverName);
61 if (solverf == solver_factories.end()) return nullptr;
62
63 string methodName = fullSolverName.substr(0, 2);
64
65 if (methodName == "gn") {
66 return new OptimizationAlgorithmGaussNewton(solverf->second());
67 } else if (methodName == "lm") {
68 return new OptimizationAlgorithmLevenberg(solverf->second());
69 }
70
71 return nullptr;
72}

◆ createSolver() [4/8]

static OptimizationAlgorithm * g2o::createSolver ( const std::string &  fullSolverName)
static

helper function for allocating

Definition at line 58 of file solver_eigen.cpp.

58 {
59 static const std::map<std::string,
60 std::function<std::unique_ptr<BlockSolverBase>()>>
61 solver_factories{
62 {"var", &AllocateSolver<-1, -1, true>},
63 {"fix3_2", &AllocateSolver<3, 2, true>},
64 {"fix6_3", &AllocateSolver<6, 3, true>},
65 {"fix7_3", &AllocateSolver<7, 3, true>},
66 {"fix3_2_scalar", &AllocateSolver<3, 2, false>},
67 {"fix6_3_scalar", &AllocateSolver<6, 3, false>},
68 {"fix7_3_scalar", &AllocateSolver<7, 3, false>},
69 };
70
71 string solverName = fullSolverName.substr(3);
72 auto solverf = solver_factories.find(solverName);
73 if (solverf == solver_factories.end()) return nullptr;
74
75 string methodName = fullSolverName.substr(0, 2);
76
77 if (methodName == "gn") {
78 return new OptimizationAlgorithmGaussNewton(solverf->second());
79 } else if (methodName == "lm") {
80 return new OptimizationAlgorithmLevenberg(solverf->second());
81 } else if (methodName == "dl") {
82 return new OptimizationAlgorithmDogleg(solverf->second());
83 }
84
85 return nullptr;
86}

◆ createSolver() [5/8]

static OptimizationAlgorithm * g2o::createSolver ( const std::string &  fullSolverName)
static

Definition at line 49 of file solver_pcg.cpp.

49 {
50 static const std::map<std::string,
51 std::function<std::unique_ptr<g2o::Solver>()>>
52 solver_factories{
53 {"pcg", &AllocateSolver<-1, -1>},
54 {"pcg3_2", &AllocateSolver<3, 2>},
55 {"pcg6_3", &AllocateSolver<6, 3>},
56 {"pcg7_3", &AllocateSolver<7, 3>},
57 };
58
59 string solverName = fullSolverName.substr(3);
60 auto solverf = solver_factories.find(solverName);
61 if (solverf == solver_factories.end()) return nullptr;
62
63 string methodName = fullSolverName.substr(0, 2);
64
65 if (methodName == "gn") {
66 return new OptimizationAlgorithmGaussNewton(solverf->second());
67 } else if (methodName == "lm") {
68 return new OptimizationAlgorithmLevenberg(solverf->second());
69 }
70
71 return nullptr;
72}

◆ createSolver() [6/8]

static OptimizationAlgorithm * g2o::createSolver ( const std::string &  fullSolverName)
static

helper function for allocating

Definition at line 54 of file slam2d_linear.cpp.

54 {
55 if (fullSolverName != "2dlinear") return nullptr;
56
57 return new SolverSLAM2DLinear{AllocateSolver<3, 2, true>()};
58}
Implementation of a linear approximation for 2D pose graph SLAM.

◆ createSolver() [7/8]

static OptimizationAlgorithm * g2o::createSolver ( const std::string &  fullSolverName)
static

helper function for allocating

Definition at line 37 of file structure_only.cpp.

37 {
38 if (fullSolverName == "structure_only_2") {
39 OptimizationAlgorithm* optimizationAlgo = new StructureOnlySolver<2>;
40 return optimizationAlgo;
41 } else if (fullSolverName == "structure_only_3") {
42 OptimizationAlgorithm* optimizationAlgo = new StructureOnlySolver<3>;
43 return optimizationAlgo;
44 } else
45 return nullptr;
46}
This is a solver for "structure-only" optimization".

◆ createSolver() [8/8]

static OptimizationAlgorithm * g2o::createSolver ( const std::string &  solverName)
static

Definition at line 471 of file graph_optimizer_sparse_incremental.cpp.

471 {
472 std::unique_ptr<g2o::Solver> s;
473
474 if (solverName == "fix3_2_cholmod") {
475 s = AllocateCholmodSolver<3, 2>();
476 } else if (solverName == "fix6_3_cholmod") {
477 s = AllocateCholmodSolver<6, 3>();
478 }
479
480 OptimizationAlgorithmGaussNewton* gaussNewton =
481 new OptimizationAlgorithmGaussNewton(std::move(s));
482 return gaussNewton;
483}

Referenced by g2o::CholmodSolverCreator::construct(), g2o::CSparseSolverCreator::construct(), g2o::DenseSolverCreator::construct(), g2o::EigenSolverCreator::construct(), g2o::PCGSolverCreator::construct(), g2o::SLAM2DLinearSolverCreator::construct(), g2o::StructureOnlyCreator::construct(), and g2o::SparseOptimizerIncremental::initSolver().

◆ cst()

constexpr double g2o::cst ( long double  v)
inlineconstexpr

◆ deg2rad()

double g2o::deg2rad ( double  degree)
inline

convert from degree to radian

Definition at line 91 of file misc.h.

91 {
92 return degree * cst(0.01745329251994329576);
93}

References cst().

◆ deltaR()

G2O_TYPES_SLAM3D_API Vector3 g2o::deltaR ( const Matrix3 R)
inline

Referenced by g2o::Sim3::log().

◆ dumpEdges()

G2O_CLI_API bool g2o::dumpEdges ( std::ostream &  os,
const OptimizableGraph optimizer 
)

dump the edges to a stream, e.g., cout and redirect to gnuplot

Definition at line 185 of file output_helper.cpp.

185 {
186 // seek for an action whose name is writeGnuplot in the library
188 HyperGraphActionLibrary::instance()->actionByName("writeGnuplot");
189 if (!saveGnuplot) {
190 cerr << __PRETTY_FUNCTION__ << ": no action \"writeGnuplot\" registered"
191 << endl;
192 return false;
193 }
194 WriteGnuplotAction::Parameters params;
195 params.os = &os;
196
197 // writing all edges
198 os << "set terminal x11 noraise" << endl;
199 os << "set size ratio -1" << endl;
200 os << "plot \"-\" w l" << endl;
201 for (HyperGraph::EdgeSet::const_iterator it = optimizer.edges().begin();
202 it != optimizer.edges().end(); ++it) {
203 OptimizableGraph::Edge* e = static_cast<OptimizableGraph::Edge*>(*it);
204 (*saveGnuplot)(e, &params);
205 }
206 os << "e" << endl;
207
208 return true;
209}
Abstract action that operates on a graph entity.
#define __PRETTY_FUNCTION__
Definition macros.h:90
bool saveGnuplot(const std::string &gnudump, const OptimizableGraph &optimizer)

References __PRETTY_FUNCTION__, g2o::HyperGraphActionLibrary::actionByName(), g2o::HyperGraph::edges(), g2o::HyperGraphActionLibrary::instance(), g2o::WriteGnuplotAction::Parameters::os, and saveGnuplot().

Referenced by gnudump_edges(), and main().

◆ edgeAllVertsSameDim()

bool g2o::edgeAllVertsSameDim ( OptimizableGraph::Edge e,
int  dim 
)

Definition at line 41 of file output_helper.cpp.

41 {
42 for (size_t i = 0; i < e->vertices().size(); ++i) {
44 static_cast<OptimizableGraph::Vertex*>(e->vertices()[i]);
45 if (v->dimension() != dim) return false;
46 }
47 return true;
48}
int dimension() const
dimension of the estimated state belonging to this node

References g2o::OptimizableGraph::Vertex::dimension(), and g2o::HyperGraph::Edge::vertices().

Referenced by saveGnuplot().

◆ fileExists()

G2O_STUFF_API bool g2o::fileExists ( const char *  filename)

check if file exists (note a directory is also a file)

Definition at line 114 of file filesys_tools.cpp.

114 {
115 struct stat statInfo;
116 return (stat(filename, &statInfo) == 0);
117}

◆ findArguments()

void g2o::findArguments ( const std::string &  option,
vector< string > &  args,
int  argc,
char **  argv 
)

Definition at line 89 of file g2o_common.cpp.

90 {
91 args.clear();
92 for (int i = 0; i < argc; ++i) {
93 if (argv[i] == option && i + 1 < argc) {
94 args.push_back(argv[i + 1]);
95 }
96 }
97}

Referenced by loadStandardSolver(), and loadStandardTypes().

◆ findConnectedEdgesWithCostLimit()

void g2o::findConnectedEdgesWithCostLimit ( HyperGraph::EdgeSet selected,
HyperGraph::EdgeSet border,
HyperGraph::Edge start,
HyperDijkstra::CostFunction cost,
double  maxEdgeCost,
double  comparisonConditioner 
)

Definition at line 41 of file tools.cpp.

46 {
47 (void)comparisonConditioner; // no warning (unused)
48 typedef std::queue<HyperGraph::Edge*> EdgeDeque;
49 EdgeDeque frontier;
50 frontier.push(start);
51
52 selected.clear();
53 border.clear();
54
55 while (!frontier.empty()) {
56 HyperGraph::Edge* e = frontier.front();
57 frontier.pop();
58
59 const VertexSE2* from = dynamic_cast<const VertexSE2*>(e->vertices()[0]);
60 const VertexSE2* to = dynamic_cast<const VertexSE2*>(e->vertices()[1]);
61
62 if (!(from && to)) continue;
63
64 double edgecost = (*cost)(e, e->vertices()[0], e->vertices()[1]);
65 if (edgecost != std::numeric_limits<double>::max()) {
66 if (edgecost > maxEdgeCost) { // + comparisonConditioner) {
67 border.insert(e);
68 } else /*if (edgecost <= maxEdgeCost)*/ {
69 selected.insert(e);
70 for (auto it = e->vertices()[0]->edges().begin();
71 it != e->vertices()[0]->edges().end(); ++it) {
72 if (selected.find(*it) == selected.end())
73 frontier.push(dynamic_cast<HyperGraph::Edge*>(*it));
74 }
75 for (auto it = e->vertices()[1]->edges().begin();
76 it != e->vertices()[1]->edges().end(); ++it) {
77 if (selected.find(*it) == selected.end())
78 frontier.push(dynamic_cast<HyperGraph::Edge*>(*it));
79 }
80 }
81 }
82 }
83}
virtual void push()
backup the position of the vertex to a stack

References g2o::BaseVertex< D, T >::push(), and g2o::HyperGraph::Edge::vertices().

Referenced by main().

◆ formatString()

G2O_STUFF_API std::string g2o::formatString ( const char *  fmt,
  ... 
)

format a string and return a std::string. Format is just like printf, see man 3 printf

Definition at line 90 of file string_tools.cpp.

90 {
91 char* auxPtr = NULL;
92 va_list arg_list;
93 va_start(arg_list, fmt);
94 int numChar = vasprintf(&auxPtr, fmt, arg_list);
95 va_end(arg_list);
96 string retString;
97 if (numChar != -1)
98 retString = auxPtr;
99 else {
100 G2O_ERROR("{}: Error while allocating memory", __PRETTY_FUNCTION__);
101 }
102 free(auxPtr);
103 return retString;
104}
#define G2O_ERROR(...)
Definition logger.h:89

References __PRETTY_FUNCTION__, and G2O_ERROR.

Referenced by gnudump_edges(), and gnudump_features().

◆ free_aligned()

template<typename Type >
void g2o::free_aligned ( Type *  block)

Definition at line 21 of file dynamic_aligned_buffer.hpp.

21 {
22 Eigen::internal::aligned_free(block);
23}

Referenced by g2o::aligned_deleter< T >::operator()(), g2o::Solver::resizeVector(), and g2o::Solver::~Solver().

◆ G2O_ATTRIBUTE_CONSTRUCTOR() [1/2]

g2o::G2O_ATTRIBUTE_CONSTRUCTOR ( init_icp_types  )

Definition at line 70 of file types_icp.cpp.

70{ types_icp::init(); }

References g2o::types_icp::init().

◆ G2O_ATTRIBUTE_CONSTRUCTOR() [2/2]

g2o::G2O_ATTRIBUTE_CONSTRUCTOR ( init_slam3d_addons_types  )

Definition at line 57 of file types_slam3d_addons.cpp.

57 {
58 static bool initialized = false;
59 if (initialized) return;
60 initialized = true;
61
62#ifdef G2O_HAVE_OPENGL
63 HyperGraphActionLibrary* actionLib = HyperGraphActionLibrary::instance();
65 new g2o::VertexSE3DrawAction);
66 vertexse3eulerdraw->setTypeName(typeid(VertexSE3Euler).name());
67 actionLib->registerAction(vertexse3eulerdraw);
68
70 new g2o::EdgeSE3DrawAction);
71 edgese3eulerdraw->setTypeName(typeid(EdgeSE3Euler).name());
72 actionLib->registerAction(edgese3eulerdraw);
73#endif
74}
3D edge between two VertexSE3, uses the euler angle parameterization for the read/write functions onl...
library of actions, indexed by the action name;
bool registerAction(const HyperGraphElementAction::HyperGraphElementActionPtr &action)
std::shared_ptr< HyperGraphElementAction > HyperGraphElementActionPtr
3D pose Vertex, (x,y,z,roll,pitch,yaw) the internal parameterization is the same as veretx_se3_quat....

References g2o::HyperGraphActionLibrary::instance(), and g2o::HyperGraphActionLibrary::registerAction().

◆ G2O_REGISTER_ACTION() [1/8]

g2o::G2O_REGISTER_ACTION ( EdgeSE2PointXYBearingWriteGnuplotAction  )

◆ G2O_REGISTER_ACTION() [2/8]

g2o::G2O_REGISTER_ACTION ( EdgeSE2PointXYWriteGnuplotAction  )

◆ G2O_REGISTER_ACTION() [3/8]

g2o::G2O_REGISTER_ACTION ( EdgeSE2WriteGnuplotAction  )

◆ G2O_REGISTER_ACTION() [4/8]

g2o::G2O_REGISTER_ACTION ( EdgeSE3WriteGnuplotAction  )

◆ G2O_REGISTER_ACTION() [5/8]

g2o::G2O_REGISTER_ACTION ( VertexPointXYWriteGnuplotAction  )

◆ G2O_REGISTER_ACTION() [6/8]

g2o::G2O_REGISTER_ACTION ( VertexPointXYZWriteGnuplotAction  )

◆ G2O_REGISTER_ACTION() [7/8]

g2o::G2O_REGISTER_ACTION ( VertexSE2WriteGnuplotAction  )

◆ G2O_REGISTER_ACTION() [8/8]

g2o::G2O_REGISTER_ACTION ( VertexSE3WriteGnuplotAction  )

◆ G2O_REGISTER_OPTIMIZATION_ALGORITHM() [1/46]

g2o::G2O_REGISTER_OPTIMIZATION_ALGORITHM ( 2dlinear  ,
new   SLAM2DLinearSolverCreatorOptimizationAlgorithmProperty("2dlinear", "Solve Orientation + Gauss-Newton: Works only on 2D pose graphs!!", "Eigen", false, 3, 3) 
)

◆ G2O_REGISTER_OPTIMIZATION_ALGORITHM() [2/46]

g2o::G2O_REGISTER_OPTIMIZATION_ALGORITHM ( dl_var  ,
new   EigenSolverCreatorOptimizationAlgorithmProperty("dl_var", "Dogleg: Cholesky solver using Eigen's Sparse Cholesky methods (variable blocksize)", "Eigen", false, Eigen::Dynamic, Eigen::Dynamic) 
)

◆ G2O_REGISTER_OPTIMIZATION_ALGORITHM() [3/46]

g2o::G2O_REGISTER_OPTIMIZATION_ALGORITHM ( dl_var_cholmod  ,
new   CholmodSolverCreatorOptimizationAlgorithmProperty("dl_var_cholmod", "Dogleg: Cholesky solver using CHOLMOD (variable blocksize)", "CHOLMOD", false, Eigen::Dynamic, Eigen::Dynamic) 
)

◆ G2O_REGISTER_OPTIMIZATION_ALGORITHM() [4/46]

g2o::G2O_REGISTER_OPTIMIZATION_ALGORITHM ( dl_var_csparse  ,
new   CSparseSolverCreatorOptimizationAlgorithmProperty("dl_var_csparse", "Dogleg: Cholesky solver using CSparse (variable blocksize)", "CSparse", false, Eigen::Dynamic, Eigen::Dynamic) 
)

◆ G2O_REGISTER_OPTIMIZATION_ALGORITHM() [5/46]

g2o::G2O_REGISTER_OPTIMIZATION_ALGORITHM ( gn_dense  ,
new   DenseSolverCreatorOptimizationAlgorithmProperty("gn_dense", "Gauss-Newton: Dense solver (variable blocksize)", "Dense", false, Eigen::Dynamic, Eigen::Dynamic) 
)

◆ G2O_REGISTER_OPTIMIZATION_ALGORITHM() [6/46]

g2o::G2O_REGISTER_OPTIMIZATION_ALGORITHM ( gn_dense3_2  ,
new   DenseSolverCreatorOptimizationAlgorithmProperty("gn_dense3_2", "Gauss-Newton: Dense solver (fixed blocksize)", "Dense", true, 3, 2) 
)

◆ G2O_REGISTER_OPTIMIZATION_ALGORITHM() [7/46]

g2o::G2O_REGISTER_OPTIMIZATION_ALGORITHM ( gn_dense6_3  ,
new   DenseSolverCreatorOptimizationAlgorithmProperty("gn_dense6_3", "Gauss-Newton: Dense solver (fixed blocksize)", "Dense", true, 6, 3) 
)

◆ G2O_REGISTER_OPTIMIZATION_ALGORITHM() [8/46]

g2o::G2O_REGISTER_OPTIMIZATION_ALGORITHM ( gn_dense7_3  ,
new   DenseSolverCreatorOptimizationAlgorithmProperty("gn_dense7_3", "Gauss-Newton: Dense solver (fixed blocksize)", "Dense", true, 7, 3) 
)

◆ G2O_REGISTER_OPTIMIZATION_ALGORITHM() [9/46]

g2o::G2O_REGISTER_OPTIMIZATION_ALGORITHM ( gn_fix3_2  ,
new   EigenSolverCreatorOptimizationAlgorithmProperty("gn_fix3_2", "Gauss-Newton: Cholesky solver using Eigen's Sparse Cholesky (fixed blocksize)", "Eigen", true, 3, 2) 
)

◆ G2O_REGISTER_OPTIMIZATION_ALGORITHM() [10/46]

g2o::G2O_REGISTER_OPTIMIZATION_ALGORITHM ( gn_fix3_2_cholmod  ,
new   CholmodSolverCreatorOptimizationAlgorithmProperty("gn_fix3_2_cholmod", "Gauss-Newton: Cholesky solver using CHOLMOD (fixed blocksize)", "CHOLMOD", true, 3, 2) 
)

◆ G2O_REGISTER_OPTIMIZATION_ALGORITHM() [11/46]

g2o::G2O_REGISTER_OPTIMIZATION_ALGORITHM ( gn_fix3_2_csparse  ,
new   CSparseSolverCreatorOptimizationAlgorithmProperty("gn_fix3_2_csparse", "Gauss-Newton: Cholesky solver using CSparse (fixed blocksize)", "CSparse", true, 3, 2) 
)

◆ G2O_REGISTER_OPTIMIZATION_ALGORITHM() [12/46]

g2o::G2O_REGISTER_OPTIMIZATION_ALGORITHM ( gn_fix6_3  ,
new   EigenSolverCreatorOptimizationAlgorithmProperty("gn_fix6_3", "Gauss-Newton: Cholesky solver using Eigen's Sparse Cholesky (fixed blocksize)", "Eigen", true, 6, 3) 
)

◆ G2O_REGISTER_OPTIMIZATION_ALGORITHM() [13/46]

g2o::G2O_REGISTER_OPTIMIZATION_ALGORITHM ( gn_fix6_3_cholmod  ,
new   CholmodSolverCreatorOptimizationAlgorithmProperty("gn_fix6_3_cholmod", "Gauss-Newton: Cholesky solver using CHOLMOD (fixed blocksize)", "CHOLMOD", true, 6, 3) 
)

◆ G2O_REGISTER_OPTIMIZATION_ALGORITHM() [14/46]

g2o::G2O_REGISTER_OPTIMIZATION_ALGORITHM ( gn_fix6_3_csparse  ,
new   CSparseSolverCreatorOptimizationAlgorithmProperty("gn_fix6_3_csparse", "Gauss-Newton: Cholesky solver using CSparse (fixed blocksize)", "CSparse", true, 6, 3) 
)

◆ G2O_REGISTER_OPTIMIZATION_ALGORITHM() [15/46]

g2o::G2O_REGISTER_OPTIMIZATION_ALGORITHM ( gn_fix7_3  ,
new   EigenSolverCreatorOptimizationAlgorithmProperty("gn_fix7_3", "Gauss-Newton: Cholesky solver using Eigen's Sparse Cholesky (fixed blocksize)", "Eigen", true, 7, 3) 
)

◆ G2O_REGISTER_OPTIMIZATION_ALGORITHM() [16/46]

g2o::G2O_REGISTER_OPTIMIZATION_ALGORITHM ( gn_fix7_3_cholmod  ,
new   CholmodSolverCreatorOptimizationAlgorithmProperty("gn_fix7_3_cholmod", "Gauss-Newton: Cholesky solver using CHOLMOD (fixed blocksize)", "CHOLMOD", true, 7, 3) 
)

◆ G2O_REGISTER_OPTIMIZATION_ALGORITHM() [17/46]

g2o::G2O_REGISTER_OPTIMIZATION_ALGORITHM ( gn_fix7_3_csparse  ,
new   CSparseSolverCreatorOptimizationAlgorithmProperty("gn_fix7_3_csparse", "Gauss-Newton: Cholesky solver using CSparse (fixed blocksize)", "CSparse", true, 7, 3) 
)

◆ G2O_REGISTER_OPTIMIZATION_ALGORITHM() [18/46]

g2o::G2O_REGISTER_OPTIMIZATION_ALGORITHM ( gn_pcg  ,
new   PCGSolverCreatorOptimizationAlgorithmProperty("gn_pcg", "Gauss-Newton: PCG solver using block-Jacobi pre-conditioner " "(variable blocksize)", "PCG", false, Eigen::Dynamic, Eigen::Dynamic) 
)

◆ G2O_REGISTER_OPTIMIZATION_ALGORITHM() [19/46]

g2o::G2O_REGISTER_OPTIMIZATION_ALGORITHM ( gn_pcg3_2  ,
new   PCGSolverCreatorOptimizationAlgorithmProperty("gn_pcg3_2", "Gauss-Newton: PCG solver using block-Jacobi " "pre-conditioner (fixed blocksize)", "PCG", true, 3, 2) 
)

◆ G2O_REGISTER_OPTIMIZATION_ALGORITHM() [20/46]

g2o::G2O_REGISTER_OPTIMIZATION_ALGORITHM ( gn_pcg6_3  ,
new   PCGSolverCreatorOptimizationAlgorithmProperty("gn_pcg6_3", "Gauss-Newton: PCG solver using block-Jacobi " "pre-conditioner (fixed blocksize)", "PCG", true, 6, 3) 
)

◆ G2O_REGISTER_OPTIMIZATION_ALGORITHM() [21/46]

g2o::G2O_REGISTER_OPTIMIZATION_ALGORITHM ( gn_pcg7_3  ,
new   PCGSolverCreatorOptimizationAlgorithmProperty("gn_pcg7_3", "Gauss-Newton: PCG solver using block-Jacobi " "pre-conditioner (fixed blocksize)", "PCG", true, 7, 3) 
)

◆ G2O_REGISTER_OPTIMIZATION_ALGORITHM() [22/46]

g2o::G2O_REGISTER_OPTIMIZATION_ALGORITHM ( gn_var  ,
new   EigenSolverCreatorOptimizationAlgorithmProperty("gn_var", "Gauss-Newton: Cholesky solver using Eigen's Sparse Cholesky methods (variable blocksize)", "Eigen", false, Eigen::Dynamic, Eigen::Dynamic) 
)

◆ G2O_REGISTER_OPTIMIZATION_ALGORITHM() [23/46]

g2o::G2O_REGISTER_OPTIMIZATION_ALGORITHM ( gn_var_cholmod  ,
new   CholmodSolverCreatorOptimizationAlgorithmProperty("gn_var_cholmod", "Gauss-Newton: Cholesky solver using CHOLMOD (variable blocksize)", "CHOLMOD", false, Eigen::Dynamic, Eigen::Dynamic) 
)

◆ G2O_REGISTER_OPTIMIZATION_ALGORITHM() [24/46]

g2o::G2O_REGISTER_OPTIMIZATION_ALGORITHM ( gn_var_csparse  ,
new   CSparseSolverCreatorOptimizationAlgorithmProperty("gn_var_csparse", "Gauss-Newton: Cholesky solver using CSparse (variable blocksize)", "CSparse", false, Eigen::Dynamic, Eigen::Dynamic) 
)

◆ G2O_REGISTER_OPTIMIZATION_ALGORITHM() [25/46]

g2o::G2O_REGISTER_OPTIMIZATION_ALGORITHM ( lm_dense  ,
new   DenseSolverCreatorOptimizationAlgorithmProperty("lm_dense", "Levenberg: Dense solver (variable blocksize)", "Dense", false, -1, -1) 
)

◆ G2O_REGISTER_OPTIMIZATION_ALGORITHM() [26/46]

g2o::G2O_REGISTER_OPTIMIZATION_ALGORITHM ( lm_dense3_2  ,
new   DenseSolverCreatorOptimizationAlgorithmProperty("lm_dense3_2", "Levenberg: Dense solver (fixed blocksize)", "Dense", true, 3, 2) 
)

◆ G2O_REGISTER_OPTIMIZATION_ALGORITHM() [27/46]

g2o::G2O_REGISTER_OPTIMIZATION_ALGORITHM ( lm_dense6_3  ,
new   DenseSolverCreatorOptimizationAlgorithmProperty("lm_dense6_3", "Levenberg: Dense solver (fixed blocksize)", "Dense", true, 6, 3) 
)

◆ G2O_REGISTER_OPTIMIZATION_ALGORITHM() [28/46]

g2o::G2O_REGISTER_OPTIMIZATION_ALGORITHM ( lm_dense7_3  ,
new   DenseSolverCreatorOptimizationAlgorithmProperty("lm_dense7_3", "Levenberg: Dense solver (fixed blocksize)", "Dense", true, 7, 3) 
)

◆ G2O_REGISTER_OPTIMIZATION_ALGORITHM() [29/46]

g2o::G2O_REGISTER_OPTIMIZATION_ALGORITHM ( lm_fix3_2  ,
new   EigenSolverCreatorOptimizationAlgorithmProperty("lm_fix3_2", "Levenberg: Cholesky solver using Eigen's Sparse Cholesky (fixed blocksize)", "Eigen", true, 3, 2) 
)

◆ G2O_REGISTER_OPTIMIZATION_ALGORITHM() [30/46]

g2o::G2O_REGISTER_OPTIMIZATION_ALGORITHM ( lm_fix3_2_cholmod  ,
new   CholmodSolverCreatorOptimizationAlgorithmProperty("lm_fix3_2_cholmod", "Levenberg: Cholesky solver using CHOLMOD (fixed blocksize)", "CHOLMOD", true, 3, 2) 
)

◆ G2O_REGISTER_OPTIMIZATION_ALGORITHM() [31/46]

g2o::G2O_REGISTER_OPTIMIZATION_ALGORITHM ( lm_fix3_2_csparse  ,
new   CSparseSolverCreatorOptimizationAlgorithmProperty("lm_fix3_2_csparse", "Levenberg: Cholesky solver using CSparse (fixed blocksize)", "CSparse", true, 3, 2) 
)

◆ G2O_REGISTER_OPTIMIZATION_ALGORITHM() [32/46]

g2o::G2O_REGISTER_OPTIMIZATION_ALGORITHM ( lm_fix6_3  ,
new   EigenSolverCreatorOptimizationAlgorithmProperty("lm_fix6_3", "Levenberg: Cholesky solver using Eigen's Sparse Cholesky (fixed blocksize)", "Eigen", true, 6, 3) 
)

◆ G2O_REGISTER_OPTIMIZATION_ALGORITHM() [33/46]

g2o::G2O_REGISTER_OPTIMIZATION_ALGORITHM ( lm_fix6_3_cholmod  ,
new   CholmodSolverCreatorOptimizationAlgorithmProperty("lm_fix6_3_cholmod", "Levenberg: Cholesky solver using CHOLMOD (fixed blocksize)", "CHOLMOD", true, 6, 3) 
)

◆ G2O_REGISTER_OPTIMIZATION_ALGORITHM() [34/46]

g2o::G2O_REGISTER_OPTIMIZATION_ALGORITHM ( lm_fix6_3_csparse  ,
new   CSparseSolverCreatorOptimizationAlgorithmProperty("lm_fix6_3_csparse", "Levenberg: Cholesky solver using CSparse (fixed blocksize)", "CSparse", true, 6, 3) 
)

◆ G2O_REGISTER_OPTIMIZATION_ALGORITHM() [35/46]

g2o::G2O_REGISTER_OPTIMIZATION_ALGORITHM ( lm_fix7_3  ,
new   EigenSolverCreatorOptimizationAlgorithmProperty("lm_fix7_3", "Levenberg: Cholesky solver using Eigen's Sparse Cholesky (fixed blocksize)", "Eigen", true, 7, 3) 
)

◆ G2O_REGISTER_OPTIMIZATION_ALGORITHM() [36/46]

g2o::G2O_REGISTER_OPTIMIZATION_ALGORITHM ( lm_fix7_3_cholmod  ,
new   CholmodSolverCreatorOptimizationAlgorithmProperty("lm_fix7_3_cholmod", "Levenberg: Cholesky solver using CHOLMOD (fixed blocksize)", "CHOLMOD", true, 7, 3) 
)

◆ G2O_REGISTER_OPTIMIZATION_ALGORITHM() [37/46]

g2o::G2O_REGISTER_OPTIMIZATION_ALGORITHM ( lm_fix7_3_csparse  ,
new   CSparseSolverCreatorOptimizationAlgorithmProperty("lm_fix7_3_csparse", "Levenberg: Cholesky solver using CSparse (fixed blocksize)", "CSparse", true, 7, 3) 
)

◆ G2O_REGISTER_OPTIMIZATION_ALGORITHM() [38/46]

g2o::G2O_REGISTER_OPTIMIZATION_ALGORITHM ( lm_pcg  ,
new   PCGSolverCreatorOptimizationAlgorithmProperty("lm_pcg", "Levenberg: PCG solver using block-Jacobi pre-conditioner " "(variable blocksize)", "PCG", false, Eigen::Dynamic, Eigen::Dynamic) 
)

◆ G2O_REGISTER_OPTIMIZATION_ALGORITHM() [39/46]

g2o::G2O_REGISTER_OPTIMIZATION_ALGORITHM ( lm_pcg3_2  ,
new   PCGSolverCreatorOptimizationAlgorithmProperty("lm_pcg3_2", "Levenberg: PCG solver using block-Jacobi pre-conditioner " "(fixed blocksize)", "PCG", true, 3, 2) 
)

◆ G2O_REGISTER_OPTIMIZATION_ALGORITHM() [40/46]

g2o::G2O_REGISTER_OPTIMIZATION_ALGORITHM ( lm_pcg6_3  ,
new   PCGSolverCreatorOptimizationAlgorithmProperty("lm_pcg6_3", "Levenberg: PCG solver using block-Jacobi pre-conditioner " "(fixed blocksize)", "PCG", true, 6, 3) 
)

◆ G2O_REGISTER_OPTIMIZATION_ALGORITHM() [41/46]

g2o::G2O_REGISTER_OPTIMIZATION_ALGORITHM ( lm_pcg7_3  ,
new   PCGSolverCreatorOptimizationAlgorithmProperty("lm_pcg7_3", "Levenberg: PCG solver using block-Jacobi pre-conditioner " "(fixed blocksize)", "PCG", true, 7, 3) 
)

◆ G2O_REGISTER_OPTIMIZATION_ALGORITHM() [42/46]

g2o::G2O_REGISTER_OPTIMIZATION_ALGORITHM ( lm_var  ,
new   EigenSolverCreatorOptimizationAlgorithmProperty("lm_var", "Levenberg: Cholesky solver using Eigen's Sparse Cholesky methods (variable blocksize)", "Eigen", false, Eigen::Dynamic, Eigen::Dynamic) 
)

◆ G2O_REGISTER_OPTIMIZATION_ALGORITHM() [43/46]

g2o::G2O_REGISTER_OPTIMIZATION_ALGORITHM ( lm_var_cholmod  ,
new   CholmodSolverCreatorOptimizationAlgorithmProperty("lm_var_cholmod", "Levenberg: Cholesky solver using CHOLMOD (variable blocksize)", "CHOLMOD", false, Eigen::Dynamic, Eigen::Dynamic) 
)

◆ G2O_REGISTER_OPTIMIZATION_ALGORITHM() [44/46]

g2o::G2O_REGISTER_OPTIMIZATION_ALGORITHM ( lm_var_csparse  ,
new   CSparseSolverCreatorOptimizationAlgorithmProperty("lm_var_csparse", "Levenberg: Cholesky solver using CSparse (variable blocksize)", "CSparse", false, Eigen::Dynamic, Eigen::Dynamic) 
)

◆ G2O_REGISTER_OPTIMIZATION_ALGORITHM() [45/46]

g2o::G2O_REGISTER_OPTIMIZATION_ALGORITHM ( structure_only_2  ,
new   StructureOnlyCreatorOptimizationAlgorithmProperty("structure_only_2", "Optimize the landmark poses (2D)", "Eigen", true, 3, 2) 
)

◆ G2O_REGISTER_OPTIMIZATION_ALGORITHM() [46/46]

g2o::G2O_REGISTER_OPTIMIZATION_ALGORITHM ( structure_only_3  ,
new   StructureOnlyCreatorOptimizationAlgorithmProperty("structure_only_3", "Optimize the landmark poses (3D)", "Eigen", true, 6, 3) 
)

◆ G2O_REGISTER_OPTIMIZATION_LIBRARY() [1/7]

g2o::G2O_REGISTER_OPTIMIZATION_LIBRARY ( cholmod  )

◆ G2O_REGISTER_OPTIMIZATION_LIBRARY() [2/7]

g2o::G2O_REGISTER_OPTIMIZATION_LIBRARY ( csparse  )

◆ G2O_REGISTER_OPTIMIZATION_LIBRARY() [3/7]

g2o::G2O_REGISTER_OPTIMIZATION_LIBRARY ( dense  )

◆ G2O_REGISTER_OPTIMIZATION_LIBRARY() [4/7]

g2o::G2O_REGISTER_OPTIMIZATION_LIBRARY ( eigen  )

◆ G2O_REGISTER_OPTIMIZATION_LIBRARY() [5/7]

g2o::G2O_REGISTER_OPTIMIZATION_LIBRARY ( pcg  )

◆ G2O_REGISTER_OPTIMIZATION_LIBRARY() [6/7]

g2o::G2O_REGISTER_OPTIMIZATION_LIBRARY ( slam2d_linear  )

◆ G2O_REGISTER_OPTIMIZATION_LIBRARY() [7/7]

g2o::G2O_REGISTER_OPTIMIZATION_LIBRARY ( structure_only  )

◆ G2O_REGISTER_TYPE() [1/78]

g2o::G2O_REGISTER_TYPE ( CACHE_CAMERA  ,
CacheCamera   
)

◆ G2O_REGISTER_TYPE() [2/78]

g2o::G2O_REGISTER_TYPE ( CACHE_SE2_OFFSET  ,
CacheSE2Offset   
)

◆ G2O_REGISTER_TYPE() [3/78]

g2o::G2O_REGISTER_TYPE ( CACHE_SE3_OFFSET  ,
CacheSE3Offset   
)

◆ G2O_REGISTER_TYPE() [4/78]

g2o::G2O_REGISTER_TYPE ( EDGE3  ,
EdgeSE3Euler   
)

◆ G2O_REGISTER_TYPE() [5/78]

g2o::G2O_REGISTER_TYPE ( EDGE_BEARING_SE2_XY  ,
EdgeSE2PointXYBearing   
)

◆ G2O_REGISTER_TYPE() [6/78]

g2o::G2O_REGISTER_TYPE ( EDGE_CAM  ,
EdgeSBACam   
)

◆ G2O_REGISTER_TYPE() [7/78]

g2o::G2O_REGISTER_TYPE ( EDGE_LINE2D  ,
EdgeLine2D   
)

◆ G2O_REGISTER_TYPE() [8/78]

g2o::G2O_REGISTER_TYPE ( EDGE_LINE2D_POINTXY  ,
EdgeLine2DPointXY   
)

◆ G2O_REGISTER_TYPE() [9/78]

g2o::G2O_REGISTER_TYPE ( EDGE_PLANE  ,
EdgePlane   
)

◆ G2O_REGISTER_TYPE() [10/78]

g2o::G2O_REGISTER_TYPE ( EDGE_POINTXY  ,
EdgePointXY   
)

◆ G2O_REGISTER_TYPE() [11/78]

g2o::G2O_REGISTER_TYPE ( EDGE_POINTXYZ  ,
EdgePointXYZ   
)

◆ G2O_REGISTER_TYPE() [12/78]

g2o::G2O_REGISTER_TYPE ( EDGE_POINTXYZ_PRIOR  ,
EdgeXYZPrior   
)

◆ G2O_REGISTER_TYPE() [13/78]

g2o::G2O_REGISTER_TYPE ( EDGE_PRIOR_SE2  ,
EdgeSE2Prior   
)

◆ G2O_REGISTER_TYPE() [14/78]

g2o::G2O_REGISTER_TYPE ( EDGE_PRIOR_SE2_XY  ,
EdgeSE2XYPrior   
)

◆ G2O_REGISTER_TYPE() [15/78]

g2o::G2O_REGISTER_TYPE ( EDGE_PRIOR_XY  ,
EdgeXYPrior   
)

◆ G2O_REGISTER_TYPE() [16/78]

g2o::G2O_REGISTER_TYPE ( EDGE_PROJECT_DEPTH  ,
EdgeSE3PointXYZDepth   
)

◆ G2O_REGISTER_TYPE() [17/78]

g2o::G2O_REGISTER_TYPE ( EDGE_PROJECT_DISPARITY  ,
EdgeSE3PointXYZDisparity   
)

◆ G2O_REGISTER_TYPE() [18/78]

g2o::G2O_REGISTER_TYPE ( EDGE_PROJECT_INVERSE_SIM3_XYZ :EXPMAP  ,
EdgeInverseSim3ProjectXYZ   
)

◆ G2O_REGISTER_TYPE() [19/78]

g2o::G2O_REGISTER_TYPE ( EDGE_PROJECT_P2MC  ,
EdgeProjectP2MC   
)

◆ G2O_REGISTER_TYPE() [20/78]

g2o::G2O_REGISTER_TYPE ( EDGE_PROJECT_P2SC  ,
EdgeProjectP2SC   
)

◆ G2O_REGISTER_TYPE() [21/78]

g2o::G2O_REGISTER_TYPE ( EDGE_PROJECT_SIM3_XYZ :EXPMAP  ,
EdgeSim3ProjectXYZ   
)

◆ G2O_REGISTER_TYPE() [22/78]

g2o::G2O_REGISTER_TYPE ( EDGE_PROJECT_XYZ2UV:EXPMAP  ,
EdgeProjectXYZ2UV   
)

◆ G2O_REGISTER_TYPE() [23/78]

g2o::G2O_REGISTER_TYPE ( EDGE_PROJECT_XYZ2UVU:EXPMAP  ,
EdgeProjectXYZ2UVU   
)

◆ G2O_REGISTER_TYPE() [24/78]

g2o::G2O_REGISTER_TYPE ( EDGE_SCALE  ,
EdgeSBAScale   
)

◆ G2O_REGISTER_TYPE() [25/78]

g2o::G2O_REGISTER_TYPE ( EDGE_SE2  ,
EdgeSE2   
)

◆ G2O_REGISTER_TYPE() [26/78]

g2o::G2O_REGISTER_TYPE ( EDGE_SE2_CALIB  ,
EdgeSE2SensorCalib   
)

◆ G2O_REGISTER_TYPE() [27/78]

g2o::G2O_REGISTER_TYPE ( EDGE_SE2_LINE2D  ,
EdgeSE2Line2D   
)

◆ G2O_REGISTER_TYPE() [28/78]

g2o::G2O_REGISTER_TYPE ( EDGE_SE2_LOTSOFXY  ,
EdgeSE2LotsOfXY   
)

◆ G2O_REGISTER_TYPE() [29/78]

g2o::G2O_REGISTER_TYPE ( EDGE_SE2_ODOM_DIFFERENTIAL_CALIB  ,
EdgeSE2OdomDifferentialCalib   
)

◆ G2O_REGISTER_TYPE() [30/78]

g2o::G2O_REGISTER_TYPE ( EDGE_SE2_OFFSET  ,
EdgeSE2Offset   
)

◆ G2O_REGISTER_TYPE() [31/78]

g2o::G2O_REGISTER_TYPE ( EDGE_SE2_POINTXY_OFFSET  ,
EdgeSE2PointXYOffset   
)

◆ G2O_REGISTER_TYPE() [32/78]

g2o::G2O_REGISTER_TYPE ( EDGE_SE2_SEGMENT2D  ,
EdgeSE2Segment2D   
)

◆ G2O_REGISTER_TYPE() [33/78]

g2o::G2O_REGISTER_TYPE ( EDGE_SE2_SEGMENT2D_LINE  ,
EdgeSE2Segment2DLine   
)

◆ G2O_REGISTER_TYPE() [34/78]

g2o::G2O_REGISTER_TYPE ( EDGE_SE2_SEGMENT2D_POINTLINE  ,
EdgeSE2Segment2DPointLine   
)

◆ G2O_REGISTER_TYPE() [35/78]

g2o::G2O_REGISTER_TYPE ( EDGE_SE2_TWOPOINTSXY  ,
EdgeSE2TwoPointsXY   
)

◆ G2O_REGISTER_TYPE() [36/78]

g2o::G2O_REGISTER_TYPE ( EDGE_SE2_XY  ,
EdgeSE2PointXY   
)

◆ G2O_REGISTER_TYPE() [37/78]

g2o::G2O_REGISTER_TYPE ( EDGE_SE2_XY_CALIB  ,
EdgeSE2PointXYCalib   
)

◆ G2O_REGISTER_TYPE() [38/78]

g2o::G2O_REGISTER_TYPE ( EDGE_SE3:EXPMAP  ,
EdgeSE3Expmap   
)

◆ G2O_REGISTER_TYPE() [39/78]

g2o::G2O_REGISTER_TYPE ( EDGE_SE3:QUAT  ,
EdgeSE3   
)

◆ G2O_REGISTER_TYPE() [40/78]

g2o::G2O_REGISTER_TYPE ( EDGE_SE3_CALIB  ,
EdgeSE3Calib   
)

◆ G2O_REGISTER_TYPE() [41/78]

g2o::G2O_REGISTER_TYPE ( EDGE_SE3_LINE3D  ,
EdgeSE3Line3D   
)

◆ G2O_REGISTER_TYPE() [42/78]

g2o::G2O_REGISTER_TYPE ( EDGE_SE3_OFFSET  ,
EdgeSE3Offset   
)

◆ G2O_REGISTER_TYPE() [43/78]

g2o::G2O_REGISTER_TYPE ( EDGE_SE3_PLANE_CALIB  ,
EdgeSE3PlaneSensorCalib   
)

◆ G2O_REGISTER_TYPE() [44/78]

g2o::G2O_REGISTER_TYPE ( EDGE_SE3_PRIOR  ,
EdgeSE3Prior   
)

◆ G2O_REGISTER_TYPE() [45/78]

g2o::G2O_REGISTER_TYPE ( EDGE_SE3_PROJECT_XYZ:EXPMAP  ,
EdgeSE3ProjectXYZ   
)

◆ G2O_REGISTER_TYPE() [46/78]

g2o::G2O_REGISTER_TYPE ( EDGE_SE3_PROJECT_XYZONLYPOSE:EXPMAP  ,
EdgeSE3ProjectXYZOnlyPose   
)

◆ G2O_REGISTER_TYPE() [47/78]

g2o::G2O_REGISTER_TYPE ( EDGE_SE3_TRACKXYZ  ,
EdgeSE3PointXYZ   
)

◆ G2O_REGISTER_TYPE() [48/78]

g2o::G2O_REGISTER_TYPE ( EDGE_SE3_XYZ_PRIOR  ,
EdgeSE3XYZPrior   
)

◆ G2O_REGISTER_TYPE() [49/78]

g2o::G2O_REGISTER_TYPE ( EDGE_SIM3 :EXPMAP  ,
EdgeSim3   
)

◆ G2O_REGISTER_TYPE() [50/78]

g2o::G2O_REGISTER_TYPE ( EDGE_STEREO_SE3_PROJECT_XYZ:EXPMAP  ,
EdgeStereoSE3ProjectXYZ   
)

◆ G2O_REGISTER_TYPE() [51/78]

g2o::G2O_REGISTER_TYPE ( EDGE_STEREO_SE3_PROJECT_XYZONLYPOSE:EXPMAP  ,
EdgeStereoSE3ProjectXYZOnlyPose   
)

◆ G2O_REGISTER_TYPE() [52/78]

g2o::G2O_REGISTER_TYPE ( EDGE_V_V_GICP  ,
Edge_V_V_GICP   
)

◆ G2O_REGISTER_TYPE() [53/78]

g2o::G2O_REGISTER_TYPE ( ONLINE_EDGE_SE2  ,
OnlineEdgeSE2   
)

◆ G2O_REGISTER_TYPE() [54/78]

g2o::G2O_REGISTER_TYPE ( ONLINE_EDGE_SE3:QUAT  ,
OnlineEdgeSE3   
)

◆ G2O_REGISTER_TYPE() [55/78]

g2o::G2O_REGISTER_TYPE ( ONLINE_VERTEX_SE2  ,
OnlineVertexSE2   
)

◆ G2O_REGISTER_TYPE() [56/78]

g2o::G2O_REGISTER_TYPE ( ONLINE_VERTEX_SE3:QUAT  ,
OnlineVertexSE3   
)

◆ G2O_REGISTER_TYPE() [57/78]

g2o::G2O_REGISTER_TYPE ( PARAMS_CAMERACALIB  ,
ParameterCamera   
)

◆ G2O_REGISTER_TYPE() [58/78]

g2o::G2O_REGISTER_TYPE ( PARAMS_CAMERAPARAMETERS  ,
CameraParameters   
)

◆ G2O_REGISTER_TYPE() [59/78]

g2o::G2O_REGISTER_TYPE ( PARAMS_SE2OFFSET  ,
ParameterSE2Offset   
)

◆ G2O_REGISTER_TYPE() [60/78]

g2o::G2O_REGISTER_TYPE ( PARAMS_SE3OFFSET  ,
ParameterSE3Offset   
)

◆ G2O_REGISTER_TYPE() [61/78]

g2o::G2O_REGISTER_TYPE ( PARAMS_STEREOCAMERACALIB  ,
ParameterStereoCamera   
)

◆ G2O_REGISTER_TYPE() [62/78]

g2o::G2O_REGISTER_TYPE ( ROBOTLASER1  ,
RobotLaser   
)

◆ G2O_REGISTER_TYPE() [63/78]

g2o::G2O_REGISTER_TYPE ( VERTEX3  ,
VertexSE3Euler   
)

◆ G2O_REGISTER_TYPE() [64/78]

g2o::G2O_REGISTER_TYPE ( VERTEX_CAM  ,
VertexCam   
)

◆ G2O_REGISTER_TYPE() [65/78]

g2o::G2O_REGISTER_TYPE ( VERTEX_ELLIPSE  ,
VertexEllipse   
)

◆ G2O_REGISTER_TYPE() [66/78]

g2o::G2O_REGISTER_TYPE ( VERTEX_INTRINSICS  ,
VertexIntrinsics   
)

◆ G2O_REGISTER_TYPE() [67/78]

g2o::G2O_REGISTER_TYPE ( VERTEX_LINE2D  ,
VertexLine2D   
)

◆ G2O_REGISTER_TYPE() [68/78]

g2o::G2O_REGISTER_TYPE ( VERTEX_LINE3D  ,
VertexLine3D   
)

◆ G2O_REGISTER_TYPE() [69/78]

g2o::G2O_REGISTER_TYPE ( VERTEX_ODOM_DIFFERENTIAL  ,
VertexOdomDifferentialParams   
)

◆ G2O_REGISTER_TYPE() [70/78]

g2o::G2O_REGISTER_TYPE ( VERTEX_PLANE  ,
VertexPlane   
)

◆ G2O_REGISTER_TYPE() [71/78]

g2o::G2O_REGISTER_TYPE ( VERTEX_SE2  ,
VertexSE2   
)

◆ G2O_REGISTER_TYPE() [72/78]

g2o::G2O_REGISTER_TYPE ( VERTEX_SE3:EXPMAP  ,
VertexSE3Expmap   
)

◆ G2O_REGISTER_TYPE() [73/78]

g2o::G2O_REGISTER_TYPE ( VERTEX_SE3:QUAT  ,
VertexSE3   
)

◆ G2O_REGISTER_TYPE() [74/78]

g2o::G2O_REGISTER_TYPE ( VERTEX_SEGMENT2D  ,
VertexSegment2D   
)

◆ G2O_REGISTER_TYPE() [75/78]

g2o::G2O_REGISTER_TYPE ( VERTEX_SIM3 :EXPMAP  ,
VertexSim3Expmap   
)

◆ G2O_REGISTER_TYPE() [76/78]

g2o::G2O_REGISTER_TYPE ( VERTEX_TAG  ,
VertexTag   
)

◆ G2O_REGISTER_TYPE() [77/78]

g2o::G2O_REGISTER_TYPE ( VERTEX_TRACKXYZ  ,
VertexPointXYZ   
)

◆ G2O_REGISTER_TYPE() [78/78]

g2o::G2O_REGISTER_TYPE ( VERTEX_XY  ,
VertexPointXY   
)

◆ G2O_REGISTER_TYPE_GROUP() [1/11]

g2o::G2O_REGISTER_TYPE_GROUP ( data  )

◆ G2O_REGISTER_TYPE_GROUP() [2/11]

g2o::G2O_REGISTER_TYPE_GROUP ( expmap  )

◆ G2O_REGISTER_TYPE_GROUP() [3/11]

g2o::G2O_REGISTER_TYPE_GROUP ( icp  )

◆ G2O_REGISTER_TYPE_GROUP() [4/11]

g2o::G2O_REGISTER_TYPE_GROUP ( online  )

◆ G2O_REGISTER_TYPE_GROUP() [5/11]

g2o::G2O_REGISTER_TYPE_GROUP ( sba  )

◆ G2O_REGISTER_TYPE_GROUP() [6/11]

g2o::G2O_REGISTER_TYPE_GROUP ( sclam  )

◆ G2O_REGISTER_TYPE_GROUP() [7/11]

g2o::G2O_REGISTER_TYPE_GROUP ( sim3  )

◆ G2O_REGISTER_TYPE_GROUP() [8/11]

g2o::G2O_REGISTER_TYPE_GROUP ( slam2d  )

◆ G2O_REGISTER_TYPE_GROUP() [9/11]

g2o::G2O_REGISTER_TYPE_GROUP ( slam2d_segment  )

◆ G2O_REGISTER_TYPE_GROUP() [10/11]

g2o::G2O_REGISTER_TYPE_GROUP ( slam3d  )

◆ G2O_REGISTER_TYPE_GROUP() [11/11]

g2o::G2O_REGISTER_TYPE_GROUP ( slam3d_addons  )

◆ G2O_USE_OPTIMIZATION_LIBRARY()

g2o::G2O_USE_OPTIMIZATION_LIBRARY ( cholmod  )

◆ G2O_USE_TYPE_GROUP() [1/2]

g2o::G2O_USE_TYPE_GROUP ( sba  )

◆ G2O_USE_TYPE_GROUP() [2/2]

g2o::G2O_USE_TYPE_GROUP ( slam2d  )

◆ get_monotonic_time()

G2O_STUFF_API double g2o::get_monotonic_time ( )

◆ get_time()

double g2o::get_time ( )
inline

return the current time in seconds since 1. Jan 1970

Definition at line 82 of file timeutil.h.

82 {
83 return seconds{std::chrono::system_clock::now().time_since_epoch()}.count();
84}

◆ getBasename()

G2O_STUFF_API std::string g2o::getBasename ( const std::string &  filename)

return the basename of the given filename /etc/fstab -> fstab

Definition at line 78 of file filesys_tools.cpp.

78 {
79#ifdef WINDOWS
80 std::string::size_type lastSlash = filename.find_last_of('\\');
81#else
82 std::string::size_type lastSlash = filename.find_last_of('/');
83#endif
84 if (lastSlash != std::string::npos)
85 return filename.substr(lastSlash + 1);
86 else
87 return filename;
88}

◆ getDirname()

G2O_STUFF_API std::string g2o::getDirname ( const std::string &  filename)

return the directory of a given filename /etc/fstab -> /etc

Definition at line 90 of file filesys_tools.cpp.

90 {
91#ifdef WINDOWS
92 std::string::size_type lastSlash = filename.find_last_of('\\');
93#else
94 std::string::size_type lastSlash = filename.find_last_of('/');
95#endif
96 if (lastSlash != std::string::npos)
97 return filename.substr(0, lastSlash);
98 else
99 return "";
100}

Referenced by loadStandardSolver(), and loadStandardTypes().

◆ getFileExtension()

G2O_STUFF_API std::string g2o::getFileExtension ( const std::string &  filename)

get filename extension (the part after the last .), e.g. the extension of file.txt is txt

Definition at line 62 of file filesys_tools.cpp.

62 {
63 std::string::size_type lastDot = filename.find_last_of('.');
64 if (lastDot != std::string::npos)
65 return filename.substr(lastDot + 1);
66 else
67 return "";
68}

Referenced by gnudump_edges(), gnudump_features(), and saveGnuplot().

◆ getFilesByPattern()

G2O_STUFF_API std::vector< std::string > g2o::getFilesByPattern ( const char *  pattern)

return all files that match a given pattern, e.g., ~/blaa*.txt, /tmp/a*

Definition at line 119 of file filesys_tools.cpp.

119 {
120 std::vector<std::string> result;
121
122#ifdef WINDOWS
123
124 HANDLE hFind;
125 WIN32_FIND_DATA FData;
126 if ((hFind = FindFirstFile(pattern, &FData)) != INVALID_HANDLE_VALUE) {
127 do {
128 result.push_back(FData.cFileName);
129 } while (FindNextFile(hFind, &FData));
130 FindClose(hFind);
131 }
132
133#elif (defined(UNIX) || defined(CYGWIN)) && !defined(ANDROID)
134
135 wordexp_t p;
136 wordexp(pattern, &p, 0);
137
138 // For some reason, wordexp sometimes fails on an APPLE machine to
139 // return anything; therefore, run it several times until we do find
140 // something - or give up
141#ifdef __APPLE__
142 for (int k = 0; (k < 100) && (p.we_wordc == 0); k++) {
143 // chrono::milliseconds duration(20);
144 // this_thread::sleep_for(duration);
145 wordexp(pattern, &p, WRDE_APPEND);
146 }
147#endif
148
149 result.reserve(p.we_wordc);
150 for (size_t i = 0; i < p.we_wordc; ++i) result.push_back(p.we_wordv[i]);
151
152 wordfree(&p);
153
154#endif
155
156 return result;
157}

Referenced by g2o::DlWrapper::openLibraries().

◆ getPureFilename()

G2O_STUFF_API std::string g2o::getPureFilename ( const std::string &  filename)

get the filename without the extension. file.txt -> file

Definition at line 70 of file filesys_tools.cpp.

70 {
71 std::string::size_type lastDot = filename.find_last_of('.');
72 if (lastDot != std::string::npos)
73 return filename.substr(0, lastDot);
74 else
75 return filename;
76}

Referenced by gnudump_edges(), gnudump_features(), and saveGnuplot().

◆ hypot()

template<typename T >
T g2o::hypot ( x,
y 
)
inline

return the hypot of x and y

Definition at line 76 of file misc.h.

76 {
77 return (T)(std::sqrt(x * x + y * y));
78}

◆ hypot_sqr()

template<typename T >
T g2o::hypot_sqr ( x,
y 
)
inline

return the squared hypot of x and y

Definition at line 84 of file misc.h.

84 {
85 return x * x + y * y;
86}

Referenced by g2o::tutorial::Simulator::simulate().

◆ inverse_theta()

double g2o::inverse_theta ( double  th)
inline

inverse of an angle, i.e., +180 degree

Definition at line 112 of file misc.h.

112 {
113 return normalize_theta(th + const_pi());
114}
double normalize_theta(double theta)
Definition misc.h:103
constexpr double const_pi()
Definition misc.h:62

References const_pi(), and normalize_theta().

◆ jac_quat3_euler3()

static void g2o::jac_quat3_euler3 ( Eigen::Matrix< double, 6, 6, Eigen::ColMajor > &  J,
const Isometry3 t 
)
static

conversion code from Euler angles

Definition at line 38 of file edge_se3_euler.cpp.

39 {
41
42 double delta = cst(1e-6);
43 double idelta = 1 / (2 * delta);
44
45 Vector7 ta;
46 Vector7 tb;
47 for (int i = 0; i < 6; i++) {
48 ta = tb = t0;
49 ta[i] -= delta;
50 tb[i] += delta;
53 J.col(i) = (eb - ea) * idelta;
54 }
55}
Isometry3 fromVectorQT(const Vector7 &v)
Vector6 toVectorET(const Isometry3 &t)
Vector7 toVectorQT(const Isometry3 &t)
VectorN< 7 > Vector7
Definition eigen_types.h:54
VectorN< 6 > Vector6
Definition eigen_types.h:53

References cst(), g2o::internal::fromVectorQT(), g2o::internal::toVectorET(), and g2o::internal::toVectorQT().

Referenced by g2o::G2oSlamInterface::addEdge(), g2o::EdgeSE3Euler::read(), and g2o::EdgeSE3Euler::write().

◆ loadStandardSolver()

G2O_CLI_API void g2o::loadStandardSolver ( DlWrapper dlSolverWrapper,
int  argc = 0,
char **  argv = 0 
)

will also look for -solverlib in (argc, argv) and load that solver

Definition at line 135 of file g2o_common.cpp.

135 {
136 char* envSolversPath = getenv("G2O_SOLVERS_DIR");
137 string solversPath = G2O_DEFAULT_SOLVERS_DIR_;
138
139 if (envSolversPath != NULL) {
140 solversPath = envSolversPath;
141 } else {
142#if (defined UNIX)
143 if (dladdr(&info, &info) != 0) {
144 solversPath = getDirname(info.dli_fname);
145 }
146#elif (defined WINDOWS)
147 char libFilename[MAX_PATH + 1];
148 HMODULE instance = getMyInstance();
149 if (instance && GetModuleFileName(instance, libFilename, MAX_PATH) > 0) {
150 solversPath = getDirname(libFilename);
151 }
152#endif
153 }
154
155 vector<string> paths = strSplit(solversPath, PATH_SEPARATOR);
156 for (vector<string>::const_iterator it = paths.begin(); it != paths.end();
157 ++it) {
158 if (it->size() > 0) dlSolverWrapper.openLibraries(*it, SOLVERS_PATTERN);
159 }
160
161 vector<string> libs;
162 if (argc > 0 && argv != 0) findArguments("-solverlib", libs, argc, argv);
163 for (vector<string>::const_iterator it = libs.begin(); it != libs.end();
164 ++it) {
165 cerr << "Loading solver " << *it << endl;
166 dlSolverWrapper.openLibrary(*it);
167 }
168}
bool openLibrary(const std::string &filename)
int openLibraries(const std::string &directory, const std::string &pattern="")
#define PATH_SEPARATOR
HMODULE getMyInstance()
static const string SOLVERS_PATTERN
void findArguments(const std::string &option, vector< string > &args, int argc, char **argv)
std::vector< std::string > strSplit(const std::string &str, const std::string &delimiters)
std::string getDirname(const std::string &filename)

References findArguments(), getDirname(), getMyInstance(), g2o::DlWrapper::openLibraries(), g2o::DlWrapper::openLibrary(), PATH_SEPARATOR, SOLVERS_PATTERN, and strSplit().

Referenced by main().

◆ loadStandardTypes()

G2O_CLI_API void g2o::loadStandardTypes ( DlWrapper dlWrapper,
int  argc = 0,
char **  argv = 0 
)

will also look for -typeslib in (argc, argv) and load that types

Definition at line 99 of file g2o_common.cpp.

99 {
100 char* envTypesPath = getenv("G2O_TYPES_DIR");
101 string typesPath;
102
103 if (envTypesPath != NULL) {
104 typesPath = envTypesPath;
105 } else {
106 typesPath = G2O_DEFAULT_TYPES_DIR_;
107#if (defined UNIX)
108 if (dladdr(&info, &info) != 0) {
109 typesPath = getDirname(info.dli_fname);
110 }
111#elif (defined WINDOWS)
112 char libFilename[MAX_PATH + 1];
113 HMODULE instance = getMyInstance();
114 if (instance && GetModuleFileName(instance, libFilename, MAX_PATH) > 0) {
115 typesPath = getDirname(libFilename);
116 }
117#endif
118 }
119
120 vector<string> paths = strSplit(typesPath, PATH_SEPARATOR);
121 for (vector<string>::const_iterator it = paths.begin(); it != paths.end();
122 ++it) {
123 if (it->size() > 0) dlTypesWrapper.openLibraries(*it, TYPES_PATTERN);
124 }
125
126 vector<string> libs;
127 if (argc > 0 && argv != 0) findArguments("-typeslib", libs, argc, argv);
128 for (vector<string>::const_iterator it = libs.begin(); it != libs.end();
129 ++it) {
130 cerr << "Loading types " << *it << endl;
131 dlTypesWrapper.openLibrary(*it);
132 }
133}
static const string TYPES_PATTERN

References findArguments(), getDirname(), getMyInstance(), g2o::DlWrapper::openLibraries(), g2o::DlWrapper::openLibrary(), PATH_SEPARATOR, strSplit(), and TYPES_PATTERN.

Referenced by main().

◆ normalize_theta()

double g2o::normalize_theta ( double  theta)
inline

◆ operator*() [1/3]

G2O_TYPES_SLAM3D_ADDONS_API Line3D g2o::operator* ( const Isometry3 t,
const Line3D line 
)

Definition at line 51 of file line3d.cpp.

51 {
52 Matrix6 A = Matrix6::Zero();
53 A.block<3, 3>(0, 0) = t.linear();
54 A.block<3, 3>(0, 3) = _skew(t.translation()) * t.linear();
55 A.block<3, 3>(3, 3) = t.linear();
56 Vector6 v = (Vector6)line;
57 return Line3D(A * v);
58}
Eigen::Matrix< double, 6, 6 > Matrix6
Definition line3d.h:38
static Matrix3 _skew(const Vector3 &t)
Definition line3d.cpp:35

◆ operator*() [2/3]

Plane3D g2o::operator* ( const Isometry3 t,
const Plane3D plane 
)
inline

Definition at line 107 of file plane3d.h.

107 {
108 Vector4 v = plane._coeffs;
109 Vector4 v2;
110 Matrix3 R = t.rotation();
111 v2.head<3>() = R * v.head<3>();
112 v2(3) = v(3) - t.translation().dot(v2.head<3>());
113 return Plane3D(v2);
114};
Vector4 _coeffs
Definition plane3d.h:104
VectorN< 4 > Vector4
Definition eigen_types.h:52

◆ operator*() [3/3]

Line2D g2o::operator* ( const SE2 t,
const Line2D l 
)
inline

Definition at line 47 of file line_2d.h.

47 {
48 Line2D est = l;
49 est[0] += t.rotation().angle();
50 est[0] = normalize_theta(est[0]);
51 Vector2 n(std::cos(est[0]), std::sin(est[0]));
52 est[1] += n.dot(t.translation());
53 return est;
54}
const Vector2 & translation() const
translational component
Definition se2.h:57
const Rotation2D & rotation() const
rotational component
Definition se2.h:61
VectorN< 2 > Vector2
Definition eigen_types.h:50

References normalize_theta(), g2o::SE2::rotation(), and g2o::SE2::translation().

◆ operator<()

bool g2o::operator< ( const HyperDijkstra::AdjacencyMapEntry a,
const HyperDijkstra::AdjacencyMapEntry b 
)

Definition at line 85 of file hyper_dijkstra.cpp.

86 {
87 return a.distance() > b.distance();
88}

References g2o::HyperDijkstra::AdjacencyMapEntry::distance().

◆ operator<<() [1/5]

template<class MatrixType >
std::ostream & g2o::operator<< ( std::ostream &  os,
const SparseBlockMatrix< MatrixType > &  m 
)

Definition at line 428 of file sparse_block_matrix.hpp.

429 {
430 os << "RBI: " << m.rowBlockIndices().size();
431 for (size_t i = 0; i < m.rowBlockIndices().size(); ++i)
432 os << " " << m.rowBlockIndices()[i];
433 os << std::endl;
434 os << "CBI: " << m.colBlockIndices().size();
435 for (size_t i = 0; i < m.colBlockIndices().size(); ++i)
436 os << " " << m.colBlockIndices()[i];
437 os << std::endl;
438
439 for (size_t i = 0; i < m.blockCols().size(); ++i) {
441 it = m.blockCols()[i].begin();
442 it != m.blockCols()[i].end(); ++it) {
444 it->second;
445 os << "BLOCK: " << it->first << " " << i << std::endl;
446 os << *b << std::endl;
447 }
448 }
449 return os;
450}
Sparse matrix which uses blocks.
const std::vector< IntBlockMap > & blockCols() const
the block matrices per block-column
const std::vector< int > & colBlockIndices() const
indices of the column blocks
MatrixType SparseMatrixBlock
this is the type of the elementary block, it is an Eigen::Matrix.
const std::vector< int > & rowBlockIndices() const
indices of the row blocks

References g2o::SparseBlockMatrix< MatrixType >::blockCols(), g2o::SparseBlockMatrix< MatrixType >::colBlockIndices(), and g2o::SparseBlockMatrix< MatrixType >::rowBlockIndices().

◆ operator<<() [2/5]

G2O_CORE_API std::ostream & g2o::operator<< ( std::ostream &  os,
const G2OBatchStatistics st 
)

timings

Definition at line 48 of file batch_stats.cpp.

48 {
49 os << PTHING(iteration);
50
51 os << PTHING(numVertices); // how many vertices are involved
52 os << PTHING(numEdges); // hoe many edges
53 os << PTHING(chi2); // total chi2
54
56 // nonlinear part
57 os << PTHING(timeResiduals);
58 os << PTHING(timeLinearize); // jacobians
59 os << PTHING(timeQuadraticForm); // construct the quadratic form in the graph
60
61 // block_solver (constructs Ax=b, plus maybe schur);
62 os << PTHING(
63 timeSchurComplement); // compute schur complement (0 if not done);
64
65 // linear solver (computes Ax=b); );
66 os << PTHING(
67 timeSymbolicDecomposition); // symbolic decomposition (0 if not done);
68 os << PTHING(
69 timeNumericDecomposition); // numeric decomposition (0 if not done);
70 os << PTHING(timeLinearSolution); // total time for solving Ax=b
71 os << PTHING(iterationsLinearSolver); // iterations of PCG
72 os << PTHING(timeUpdate); // oplus
73 os << PTHING(timeIteration); // total time );
74
75 os << PTHING(levenbergIterations);
76 os << PTHING(timeLinearSolver);
77
78 os << PTHING(hessianDimension);
79 os << PTHING(hessianPoseDimension);
80 os << PTHING(hessianLandmarkDimension);
81 os << PTHING(choleskyNNZ);
82 os << PTHING(timeMarginals);
83
84 return os;
85};
#define PTHING(s)

References PTHING.

◆ operator<<() [3/5]

std::ostream & g2o::operator<< ( std::ostream &  out_str,
const SBACam cam 
)

Definition at line 125 of file sbacam.cpp.

125 {
126 out_str << cam.translation().transpose() << std::endl;
127 out_str << cam.rotation().coeffs().transpose() << std::endl << std::endl;
128 out_str << cam.Kcam << std::endl << std::endl;
129 out_str << cam.w2n << std::endl << std::endl;
130 out_str << cam.w2i << std::endl << std::endl;
131 return out_str;
132}
Matrix3 Kcam
Definition sbacam.h:51
Eigen::Matrix< double, 3, 4 > w2i
Definition sbacam.h:56
Eigen::Matrix< double, 3, 4 > w2n
Definition sbacam.h:55
const Quaternion & rotation() const
Definition se3quat.h:93
const Vector3 & translation() const
Definition se3quat.h:89

References g2o::SBACam::Kcam, g2o::SE3Quat::rotation(), g2o::SE3Quat::translation(), g2o::SBACam::w2i, and g2o::SBACam::w2n.

◆ operator<<() [4/5]

std::ostream & g2o::operator<< ( std::ostream &  out_str,
const SE3Quat se3 
)
inline

Definition at line 268 of file se3quat.h.

268 {
269 out_str << se3.to_homogeneous_matrix() << std::endl;
270 return out_str;
271}
Eigen::Matrix< double, 4, 4, Eigen::ColMajor > to_homogeneous_matrix() const
Definition se3quat.h:242

References g2o::SE3Quat::to_homogeneous_matrix().

◆ operator<<() [5/5]

std::ostream & g2o::operator<< ( std::ostream &  out_str,
const Sim3 sim3 
)
inline

Definition at line 258 of file sim3.h.

258 {
259 out_str << sim3.rotation().coeffs() << std::endl;
260 out_str << sim3.translation() << std::endl;
261 out_str << sim3.scale() << std::endl;
262
263 return out_str;
264}
const Quaternion & rotation() const
Definition sim3.h:249
const Vector3 & translation() const
Definition sim3.h:245
const double & scale() const
Definition sim3.h:253

References g2o::Sim3::rotation(), g2o::Sim3::scale(), and g2o::Sim3::translation().

◆ project() [1/2]

G2O_TYPES_SLAM3D_API Vector2 g2o::project ( const Vector3 )
inline

◆ project() [2/2]

G2O_TYPES_SLAM3D_API Vector3 g2o::project ( const Vector4 )
inline

◆ rad2deg()

double g2o::rad2deg ( double  rad)
inline

convert from radian to degree

Definition at line 98 of file misc.h.

98{ return rad * cst(57.29577951308232087721); }

References cst().

◆ readFloats()

template<typename OutputIterator >
OutputIterator g2o::readFloats ( const char *  str,
OutputIterator  out 
)

read float values (separated by spaces) from a string and store them in the given OutputIterator.

Definition at line 94 of file string_tools.h.

94 {
95 char* cl = (char*)str;
96 char* cle = cl;
97 while (1) {
98 double val = strtod(cl, &cle);
99 if (cl == cle) break;
100 *out++ = val;
101 cl = cle;
102 }
103 return out;
104}
std::ostream * out
Definition scanner.l:138

References out.

◆ readInts()

template<typename OutputIterator >
OutputIterator g2o::readInts ( const char *  str,
OutputIterator  out 
)

read integer values (separated by spaces) from a string and store them in the given OutputIterator.

Definition at line 77 of file string_tools.h.

77 {
78 char* cl = (char*)str;
79 char* cle = cl;
80 while (1) {
81 long int id = strtol(cl, &cle, 10);
82 if (cl == cle) break;
83 *out++ = id;
84 cl = cle;
85 }
86 return out;
87}

References out.

◆ readLine()

G2O_STUFF_API int g2o::readLine ( std::istream &  is,
std::stringstream &  currentLine 
)

read a line from is into currentLine.

Returns
the number of characters read into currentLine (excluding newline), -1 on eof()

Definition at line 161 of file string_tools.cpp.

161 {
162 if (is.eof()) return -1;
163 currentLine.str("");
164 currentLine.clear();
165 is.get(*currentLine.rdbuf());
166 if (is.fail()) // fail is set on empty lines
167 is.clear();
168 skipLine(is); // read \n not read by get()
169 if (currentLine.str().empty() && is.eof()) {
170 return -1;
171 }
172 return static_cast<int>(currentLine.str().size());
173}
void skipLine(std::istream &is)

References skipLine().

Referenced by main(), g2o::ParameterContainer::read(), g2o::Gm2dlIO::readGm2dl(), and g2o::Gm2dlIO::readRobotLaser().

◆ reallocate_aligned()

template<typename Type >
Type * g2o::reallocate_aligned ( Type *  ptr,
size_t  newSize,
size_t  oldSize 
)

Definition at line 15 of file dynamic_aligned_buffer.hpp.

15 {
16 return (Type*)Eigen::internal::aligned_realloc(ptr, newSize * sizeof(Type),
17 oldSize * sizeof(Type));
18}

◆ reconstructGaussian()

template<class SampleType , class CovarianceType >
void g2o::reconstructGaussian ( SampleType &  mean,
CovarianceType &  covariance,
const std::vector< SigmaPoint< SampleType > > &  sigmaPoints 
)

Definition at line 77 of file unscented.h.

79 {
80 mean.fill(0);
81 covariance.fill(0);
82 for (size_t i = 0; i < sigmaPoints.size(); i++) {
83 mean += sigmaPoints[i]._wi * sigmaPoints[i]._sample;
84 }
85 for (size_t i = 0; i < sigmaPoints.size(); i++) {
86 SampleType delta = sigmaPoints[i]._sample - mean;
87 covariance += sigmaPoints[i]._wp * (delta * delta.transpose());
88 }
89}

Referenced by g2o::EdgeLabeler::labelEdge(), testMarginals(), and unscentedTest().

◆ release()

template<typename T >
void g2o::release ( T *  obj)

◆ sampleGaussian()

double G2O_STUFF_API g2o::sampleGaussian ( std::mt19937 *  generator)

Definition at line 40 of file sampler.cpp.

40 {
41 if (generator) return _univariateSampler(*generator);
42 return _univariateSampler(_gen_real);
43}
static std::normal_distribution< double > _univariateSampler(0., 1.)

References _gen_real, and _univariateSampler().

Referenced by g2o::GaussianSampler< SampleType, CovarianceType >::generateSample(), main(), and main().

◆ sampleUniform()

double G2O_STUFF_API g2o::sampleUniform ( double  min,
double  max,
std::mt19937 *  generator 
)

Definition at line 35 of file sampler.cpp.

35 {
36 if (generator) return _uniformReal(*generator) * (max - min) + min;
37 return _uniformReal(_gen_real) * (max - min) + min;
38}
static std::uniform_real_distribution< double > _uniformReal
Definition sampler.cpp:32

References _gen_real, and _uniformReal.

Referenced by main(), main(), and main().

◆ sampleUnscented()

template<class SampleType , class CovarianceType >
bool g2o::sampleUnscented ( std::vector< SigmaPoint< SampleType > > &  sigmaPoints,
const SampleType &  mean,
const CovarianceType &  covariance 
)

Definition at line 48 of file unscented.h.

49 {
50 const int dim = mean.size();
51 const int numPoints = 2 * dim + 1;
52 assert(covariance.rows() == covariance.cols() &&
53 covariance.cols() == mean.size() && "Dimension Mismatch");
54 const double alpha = cst(1e-3);
55 const double beta = 2;
56 const double lambda = alpha * alpha * dim;
57 const double wi = cst(1) / (2 * (dim + lambda));
58
59 sigmaPoints.resize(numPoints);
60 sigmaPoints[0] = SigmaPoint<SampleType>(
61 mean, lambda / (dim + lambda),
62 lambda / (dim + lambda) + (1. - alpha * alpha + beta));
63 Eigen::LLT<CovarianceType> cholDecomp;
64 cholDecomp.compute(covariance * (dim + lambda));
65 if (cholDecomp.info() == Eigen::NumericalIssue) return false;
66 const CovarianceType& L = cholDecomp.matrixL();
67 int k = 1;
68 for (int i = 0; i < dim; i++) {
69 SampleType s(L.col(i));
70 sigmaPoints[k++] = SigmaPoint<SampleType>(mean + s, wi, wi);
71 sigmaPoints[k++] = SigmaPoint<SampleType>(mean - s, wi, wi);
72 }
73 return true;
74}

References cst().

Referenced by g2o::EdgeLabeler::labelEdge(), testMarginals(), and unscentedTest().

◆ saveGnuplot() [1/2]

G2O_CLI_API bool g2o::saveGnuplot ( const std::string &  gnudump,
const HyperGraph::VertexSet vertices,
const HyperGraph::EdgeSet edges 
)

Definition at line 61 of file output_helper.cpp.

63 {
64 // seek for an action whose name is writeGnuplot in the library
66 HyperGraphActionLibrary::instance()->actionByName("writeGnuplot");
67 if (!saveGnuplot) {
68 cerr << __PRETTY_FUNCTION__ << ": no action \"writeGnuplot\" registered"
69 << endl;
70 return false;
71 }
72 WriteGnuplotAction::Parameters params;
73
74 int maxDim = -1;
75 int minDim = numeric_limits<int>::max();
76 for (HyperGraph::VertexSet::const_iterator it = vertices.begin();
77 it != vertices.end(); ++it) {
78 OptimizableGraph::Vertex* v = static_cast<OptimizableGraph::Vertex*>(*it);
79 int vdim = v->dimension();
80 maxDim = (std::max)(vdim, maxDim);
81 minDim = (std::min)(vdim, minDim);
82 }
83
84 string extension = getFileExtension(gnudump);
85 if (extension.size() == 0) extension = "dat";
86 string baseFilename = getPureFilename(gnudump);
87
88 // check for odometry edges
89 bool hasOdomEdge = false;
90 bool hasLandmarkEdge = false;
91 for (HyperGraph::EdgeSet::const_iterator it = edges.begin();
92 it != edges.end(); ++it) {
93 OptimizableGraph::Edge* e = static_cast<OptimizableGraph::Edge*>(*it);
94 if (e->vertices().size() == 2) {
95 if (edgeAllVertsSameDim(e, maxDim))
96 hasOdomEdge = true;
97 else
98 hasLandmarkEdge = true;
99 }
100 if (hasOdomEdge && hasLandmarkEdge) break;
101 }
102
103 bool fileStatus = true;
104 if (hasOdomEdge) {
105 string odomFilename = baseFilename + "_odom_edges." + extension;
106 cerr << "# saving " << odomFilename << " ... ";
107 ofstream fout(odomFilename.c_str());
108 if (!fout) {
109 cerr << "Unable to open file" << endl;
110 return false;
111 }
112 params.os = &fout;
113
114 // writing odometry edges
115 for (HyperGraph::EdgeSet::const_iterator it = edges.begin();
116 it != edges.end(); ++it) {
117 OptimizableGraph::Edge* e = static_cast<OptimizableGraph::Edge*>(*it);
118 if (e->vertices().size() != 2 || !edgeAllVertsSameDim(e, maxDim))
119 continue;
120 (*saveGnuplot)(e, &params);
121 }
122 cerr << "done." << endl;
123 }
124
125 if (hasLandmarkEdge) {
126 string filename = baseFilename + "_landmarks_edges." + extension;
127 cerr << "# saving " << filename << " ... ";
128 ofstream fout(filename.c_str());
129 if (!fout) {
130 cerr << "Unable to open file" << endl;
131 return false;
132 }
133 params.os = &fout;
134
135 // writing landmark edges
136 for (HyperGraph::EdgeSet::const_iterator it = edges.begin();
137 it != edges.end(); ++it) {
138 OptimizableGraph::Edge* e = static_cast<OptimizableGraph::Edge*>(*it);
139 if (e->vertices().size() != 2 || edgeAllVertsSameDim(e, maxDim)) continue;
140 (*saveGnuplot)(e, &params);
141 }
142 cerr << "done." << endl;
143 }
144
145 if (1) {
146 string filename = baseFilename + "_edges." + extension;
147 cerr << "# saving " << filename << " ... ";
148 ofstream fout(filename.c_str());
149 if (!fout) {
150 cerr << "Unable to open file" << endl;
151 return false;
152 }
153 params.os = &fout;
154
155 // writing all edges
156 for (HyperGraph::EdgeSet::const_iterator it = edges.begin();
157 it != edges.end(); ++it) {
158 OptimizableGraph::Edge* e = static_cast<OptimizableGraph::Edge*>(*it);
159 (*saveGnuplot)(e, &params);
160 }
161 cerr << "done." << endl;
162 }
163
164 if (1) {
165 string filename = baseFilename + "_vertices." + extension;
166 cerr << "# saving " << filename << " ... ";
167 ofstream fout(filename.c_str());
168 if (!fout) {
169 cerr << "Unable to open file" << endl;
170 return false;
171 }
172 params.os = &fout;
173
174 for (HyperGraph::VertexSet::const_iterator it = vertices.begin();
175 it != vertices.end(); ++it) {
176 OptimizableGraph::Vertex* v = static_cast<OptimizableGraph::Vertex*>(*it);
177 (*saveGnuplot)(v, &params);
178 }
179 cerr << "done." << endl;
180 }
181
182 return fileStatus;
183}
bool edgeAllVertsSameDim(OptimizableGraph::Edge *e, int dim)
std::string getFileExtension(const std::string &filename)
std::string getPureFilename(const std::string &filename)

References __PRETTY_FUNCTION__, g2o::HyperGraphActionLibrary::actionByName(), g2o::OptimizableGraph::Vertex::dimension(), edgeAllVertsSameDim(), getFileExtension(), getPureFilename(), g2o::HyperGraphActionLibrary::instance(), g2o::WriteGnuplotAction::Parameters::os, saveGnuplot(), and g2o::HyperGraph::Edge::vertices().

◆ saveGnuplot() [2/2]

G2O_CLI_API bool g2o::saveGnuplot ( const std::string &  gnudump,
const OptimizableGraph optimizer 
)

save the state of the optimizer into files for visualizing using Gnuplot

Definition at line 50 of file output_helper.cpp.

51 {
53 for (HyperGraph::VertexIDMap::const_iterator it =
54 optimizer.vertices().begin();
55 it != optimizer.vertices().end(); ++it) {
56 vset.insert(it->second);
57 }
58 return saveGnuplot(gnudump, vset, optimizer.edges());
59}

References g2o::HyperGraph::edges(), saveGnuplot(), and g2o::HyperGraph::vertices().

Referenced by dumpEdges(), main(), saveGnuplot(), and saveGnuplot().

◆ sign()

template<typename T >
int g2o::sign ( x)
inline

sign function.

Returns
the sign of x. +1 for x > 0, -1 for x < 0, 0 for x == 0

Definition at line 135 of file misc.h.

135 {
136 if (x > 0)
137 return 1;
138 else if (x < 0)
139 return -1;
140 else
141 return 0;
142}

◆ skew()

G2O_TYPES_SLAM3D_API Matrix3 g2o::skew ( const Vector3 v)
inline

Referenced by g2o::Sim3::log(), and g2o::Sim3::Sim3().

◆ skipLine()

G2O_STUFF_API void g2o::skipLine ( std::istream &  is)

read from string until the end of a line is reached.

Definition at line 175 of file string_tools.cpp.

175 {
176 char c = ' ';
177 while (c != '\n' && is.good() && !is.eof()) is.get(c);
178}

Referenced by readLine().

◆ square()

template<typename T >
T g2o::square ( x)
inline

return the square value

Definition at line 68 of file misc.h.

68 {
69 return x * x;
70}

◆ starsInEdge()

void g2o::starsInEdge ( StarSet stars,
HyperGraph::Edge e,
EdgeStarMap esmap,
HyperGraph::VertexSet gauge 
)

Definition at line 103 of file simple_star_ops.cpp.

104 {
105 for (size_t i = 0; i < e->vertices().size(); i++) {
107 if (gauge.find(v) == gauge.end()) starsInVertex(stars, v, esmap);
108 }
109}
void starsInVertex(StarSet &stars, HyperGraph::Vertex *v, EdgeStarMap &esmap)

References starsInVertex(), and g2o::HyperGraph::Edge::vertices().

Referenced by computeBorder().

◆ starsInVertex()

void g2o::starsInVertex ( StarSet stars,
HyperGraph::Vertex v,
EdgeStarMap esmap 
)

Definition at line 94 of file simple_star_ops.cpp.

94 {
95 for (HyperGraph::EdgeSet::iterator it = v->edges().begin();
96 it != v->edges().end(); ++it) {
97 HyperGraph::Edge* e = *it;
98 EdgeStarMap::iterator eit = esmap.find(e);
99 if (eit != esmap.end()) stars.insert(eit->second);
100 }
101}

References g2o::HyperGraph::Vertex::edges().

Referenced by starsInEdge().

◆ strEndsWith()

G2O_STUFF_API bool g2o::strEndsWith ( const std::string &  str,
const std::string &  substr 
)

return true, if str ends with substr

Definition at line 156 of file string_tools.cpp.

156 {
157 if (s.size() < end.size()) return false;
158 return equal(end.rbegin(), end.rend(), s.rbegin());
159}

Referenced by str2solver().

◆ strExpandFilename()

G2O_STUFF_API std::string g2o::strExpandFilename ( const std::string &  filename)

expand the given filename like a posix shell, e.g., ~ $CARMEN_HOME and other will get expanded. Also command substitution, e.g. pwd will give the current directory.

Definition at line 117 of file string_tools.cpp.

117 {
118#if (defined(UNIX) || defined(CYGWIN)) && !defined(ANDROID)
119 string result = filename;
120 wordexp_t p;
121
122 wordexp(filename.c_str(), &p, 0);
123 if (p.we_wordc > 0) {
124 result = p.we_wordv[0];
125 }
126 wordfree(&p);
127 return result;
128#else
129 (void)filename;
130 G2O_WARN("{} not implemented", __PRETTY_FUNCTION__);
131 return std::string();
132#endif
133}
#define G2O_WARN(...)
Definition logger.h:88

References __PRETTY_FUNCTION__, and G2O_WARN.

◆ stringToType()

template<typename T >
T g2o::stringToType ( const std::string &  s,
bool  failIfLeftoverChars = true 
)

convert a string into an other type. Return the converted value. Throw error if parsing is wrong.

Definition at line 136 of file string_tools.h.

136 {
137 T x;
138 convertString(s, x, failIfLeftoverChars);
139 return x;
140}
bool convertString(const std::string &s, T &x, bool failIfLeftoverChars=true)

References convertString().

◆ strPrintf()

G2O_STUFF_API int g2o::strPrintf ( std::string &  str,
const char *  fmt,
  ... 
)

replacement function for sprintf which fills a std::string instead of a char*

Definition at line 106 of file string_tools.cpp.

106 {
107 char* auxPtr = NULL;
108 va_list arg_list;
109 va_start(arg_list, fmt);
110 int numChars = vasprintf(&auxPtr, fmt, arg_list);
111 va_end(arg_list);
112 str = auxPtr;
113 free(auxPtr);
114 return numChars;
115}

◆ strSplit()

G2O_STUFF_API std::vector< std::string > g2o::strSplit ( const std::string &  s,
const std::string &  delim 
)

split a string into token based on the characters given in delim

Definition at line 135 of file string_tools.cpp.

136 {
137 std::vector<std::string> tokens;
138 if (str.empty()) return tokens;
139 string::size_type lastPos = 0;
140 string::size_type pos = 0;
141
142 do {
143 pos = str.find_first_of(delimiters, lastPos);
144 tokens.push_back(str.substr(lastPos, pos - lastPos));
145 lastPos = pos + 1;
146 } while (string::npos != pos);
147
148 return tokens;
149}

Referenced by loadStandardSolver(), loadStandardTypes(), g2o::OptimizableGraph::setRenamedTypesFromString(), and g2o::PropertyMap::updateMapFromString().

◆ strStartsWith()

G2O_STUFF_API bool g2o::strStartsWith ( const std::string &  str,
const std::string &  substr 
)

return true, if str starts with substr

Definition at line 151 of file string_tools.cpp.

151 {
152 if (s.size() < start.size()) return false;
153 return equal(start.begin(), start.end(), s.begin());
154}

Referenced by str2solver().

◆ strToLower()

G2O_STUFF_API std::string g2o::strToLower ( const std::string &  s)

convert the string to lower case

Definition at line 74 of file string_tools.cpp.

74 {
75 string ret;
76 ret.reserve(s.size());
77 std::transform(s.begin(), s.end(), back_inserter(ret),
78 [](unsigned char c) { return std::tolower(c); });
79 return ret;
80}

◆ strToUpper()

G2O_STUFF_API std::string g2o::strToUpper ( const std::string &  s)

convert a string to upper case

Definition at line 82 of file string_tools.cpp.

82 {
83 string ret;
84 ret.reserve(s.size());
85 std::transform(s.begin(), s.end(), back_inserter(ret),
86 [](unsigned char c) { return std::toupper(c); });
87 return ret;
88}

◆ tictoc()

G2O_STUFF_API double g2o::tictoc ( const char *  algorithmPart)

Profile the timing of certain parts of your algorithm.

Profile the timing of certain parts of your algorithm. A typical use-case is as follows:

tictoc("doSomething"); // place the code here. tictoc("doSomething");

This will calculate statistics for the operations within the two calls to tictoc()

If the environment variable G2O_ENABLE_TICTOC is defined, the timing will be performed.

Definition at line 118 of file tictoc.cpp.

118 {
119 static TicTocInitializer initializer;
120 if (!initializer.enabled) return 0.;
121
122 TicTocMap& tictocElements = initializer.tictocElements;
123 static double alpha = cst(0.01);
124 double now = get_monotonic_time();
125
126 double dt = 0.;
127 TicTocMap::iterator foundIt = tictocElements.find(algorithmPart);
128 if (foundIt == tictocElements.end()) {
129 // insert element
131 e.ticTime = now;
132 e.algorithmPart = algorithmPart;
133 tictocElements[e.algorithmPart] = e;
134 } else {
135 if (foundIt->second.clockIsRunning) {
136 dt = now - foundIt->second.ticTime;
137 foundIt->second.totalTime += dt;
138 foundIt->second.minTime = std::min(foundIt->second.minTime, dt);
139 foundIt->second.maxTime = std::max(foundIt->second.maxTime, dt);
140 if (foundIt->second.numCalls == 0)
141 foundIt->second.exponentialMovingAverage = dt;
142 else
143 foundIt->second.exponentialMovingAverage =
144 (1. - alpha) * foundIt->second.exponentialMovingAverage +
145 alpha * dt;
146 foundIt->second.numCalls++;
147 } else {
148 foundIt->second.ticTime = now;
149 }
150 foundIt->second.clockIsRunning = !foundIt->second.clockIsRunning;
151 }
152 return dt;
153}
std::map< std::string, TicTocElement > TicTocMap
Definition tictoc.cpp:66
double get_monotonic_time()
Definition timeutil.cpp:43
Internal structure of the tictoc profiling.
Definition tictoc.cpp:44
std::string algorithmPart
name / description of the code block
Definition tictoc.cpp:52
double ticTime
the time of the last tic
Definition tictoc.cpp:45
helper for printing the struct at the end of the lifetime of the program
Definition tictoc.cpp:72
TicTocMap tictocElements
Definition tictoc.cpp:73

References g2o::TicTocElement::algorithmPart, cst(), g2o::TicTocInitializer::enabled, get_monotonic_time(), g2o::TicTocElement::ticTime, and g2o::TicTocInitializer::tictocElements.

Referenced by main(), g2o::ScopedTictoc::ScopedTictoc(), and g2o::ScopedTictoc::~ScopedTictoc().

◆ trim()

G2O_STUFF_API std::string g2o::trim ( const std::string &  s)

remove whitespaces from the start/end of a string

Definition at line 50 of file string_tools.cpp.

50 {
51 if (s.length() == 0) return s;
52 string::size_type b = s.find_first_not_of(" \t\n");
53 string::size_type e = s.find_last_not_of(" \t\n");
54 if (b == string::npos) return "";
55 return std::string(s, b, e - b + 1);
56}

Referenced by g2o::OptimizableGraph::setRenamedTypesFromString(), and g2o::PropertyMap::updateMapFromString().

◆ trimLeft()

G2O_STUFF_API std::string g2o::trimLeft ( const std::string &  s)

remove whitespaces from the left side of the string

Definition at line 58 of file string_tools.cpp.

58 {
59 if (s.length() == 0) return s;
60 string::size_type b = s.find_first_not_of(" \t\n");
61 string::size_type e = s.length() - 1;
62 if (b == string::npos) return "";
63 return std::string(s, b, e - b + 1);
64}

◆ trimRight()

G2O_STUFF_API std::string g2o::trimRight ( const std::string &  s)

remove whitespaced from the right side of the string

Definition at line 66 of file string_tools.cpp.

66 {
67 if (s.length() == 0) return s;
68 string::size_type b = 0;
69 string::size_type e = s.find_last_not_of(" \t\n");
70 if (e == string::npos) return "";
71 return std::string(s, b, e - b + 1);
72}

◆ tuple_apply_i()

template<typename F , typename T >
void g2o::tuple_apply_i ( F &&  f,
T &  t,
int  i 
)

Definition at line 39 of file tuple_tools.h.

39 {
41 f, t, i, std::make_index_sequence<std::tuple_size_v<std::decay_t<T>>>());
42}
void tuple_apply_i_(F &&f, T &t, int i, std::index_sequence< I... >)
Definition tuple_tools.h:34

References tuple_apply_i_().

Referenced by g2o::BaseFixedSizedEdge< D, OdomAndLaserMotion, VertexSE2, VertexBaseline >::linearizeOplus(), and g2o::BaseFixedSizedEdge< D, OdomAndLaserMotion, VertexSE2, VertexBaseline >::linearizeOplus().

◆ tuple_apply_i_()

template<typename F , typename T , std::size_t... I>
void g2o::tuple_apply_i_ ( F &&  f,
T &  t,
int  i,
std::index_sequence< I... >   
)

Definition at line 34 of file tuple_tools.h.

34 {
35 (..., (I == i ? f(std::get<I>(t)) : void()));
36}

Referenced by tuple_apply_i().

◆ unproject() [1/2]

G2O_TYPES_SLAM3D_API Vector3 g2o::unproject ( const Vector2 )
inline

◆ unproject() [2/2]

G2O_TYPES_SLAM3D_API Vector4 g2o::unproject ( const Vector3 )
inline

◆ vertexEdgesInStar()

size_t g2o::vertexEdgesInStar ( HyperGraph::EdgeSet eset,
HyperGraph::Vertex v,
Star s,
EdgeStarMap esmap 
)

Definition at line 82 of file simple_star_ops.cpp.

83 {
84 eset.clear();
85 for (HyperGraph::EdgeSet::iterator it = v->edges().begin();
86 it != v->edges().end(); ++it) {
87 HyperGraph::Edge* e = *it;
88 EdgeStarMap::iterator eit = esmap.find(e);
89 if (eit != esmap.end() && eit->second == s) eset.insert(e);
90 }
91 return eset.size();
92}

References g2o::HyperGraph::Vertex::edges().

Referenced by assignHierarchicalEdges().

◆ wrap()

template<typename T >
T g2o::wrap ( l,
x,
u 
)
inline

wrap x to be in the interval [l, u]

Definition at line 158 of file misc.h.

158 {
159 T intervalWidth = u - l;
160 while (x < l) x += intervalWidth;
161 while (x > u) x -= intervalWidth;
162 return x;
163}

◆ writeCCSMatrix() [1/2]

G2O_STUFF_API bool g2o::writeCCSMatrix ( const std::string &  filename,
int  rows,
int  cols,
const int *  p,
const int *  i,
const double *  v,
bool  upperTriangleSymmetric = true 
)

write a CCS matrix given by pointer to column, row, and values

◆ writeCCSMatrix() [2/2]

bool g2o::writeCCSMatrix ( const string &  filename,
int  rows,
int  cols,
const int *  Ap,
const int *  Ai,
const double *  Ax,
bool  upperTriangleSymmetric 
)

Definition at line 68 of file sparse_helper.cpp.

70 {
71 vector<TripletEntry> entries;
72 entries.reserve((size_t)Ap[cols]);
73 for (int i = 0; i < cols; i++) {
74 const int& rbeg = Ap[i];
75 const int& rend = Ap[i + 1];
76 for (int j = rbeg; j < rend; j++) {
77 entries.emplace_back(TripletEntry(Ai[j], i, Ax[j]));
78 if (upperTriangleSymmetric && Ai[j] != i)
79 entries.emplace_back(TripletEntry(i, Ai[j], Ax[j]));
80 }
81 }
82 sort(entries.begin(), entries.end(), TripletColSort());
83 return writeTripletEntries(filename, rows, cols, entries);
84}
static bool writeTripletEntries(const std::string &filename, int rows, int cols, const std::vector< TripletEntry > &triplets)

References writeTripletEntries().

Referenced by g2o::LinearSolverCholmodOnline< MatrixType >::choleskyUpdate(), g2o::LinearSolverCholmod< MatrixType >::saveMatrix(), g2o::LinearSolverCholmodOnline< MatrixType >::solve(), and g2o::csparse_extension::writeCs2Octave().

◆ writeTripletEntries()

static bool g2o::writeTripletEntries ( const std::string &  filename,
int  rows,
int  cols,
const std::vector< TripletEntry > &  triplets 
)
static

Definition at line 39 of file sparse_helper.cpp.

40 {
41 const string name = [&filename]() {
42 const std::string::size_type lastDot = filename.find_last_of('.');
43 if (lastDot != std::string::npos) return filename.substr(0, lastDot);
44 return filename;
45 }();
46
47 std::ofstream fout(filename.c_str());
48 fout << "# name: " << name << std::endl;
49 fout << "# type: sparse matrix" << std::endl;
50 fout << "# nnz: " << triplets.size() << std::endl;
51 fout << "# rows: " << rows << std::endl;
52 fout << "# columns: " << cols << std::endl;
53 // fout << fixed;
54 fout << setprecision(9) << endl;
55 for (const TripletEntry& entry : triplets) {
56 fout << entry.r + 1 << " " << entry.c + 1 << " " << entry.x << std::endl;
57 }
58 return fout.good();
59}

Referenced by writeCCSMatrix(), and writeTripletMatrix().

◆ writeTripletMatrix()

G2O_STUFF_API bool g2o::writeTripletMatrix ( const std::string &  filename,
int  nz,
int  rows,
int  cols,
const int *  Ai,
const int *  Aj,
const double *  Ax,
bool  upperTriangleSymmetric = true 
)

write a triplet matrix given by pointers

Parameters
filenamefilename to write to
nznumber of elements
rowsnumber of rows of the matrix
colsnumber of colmuns of the matrix
Aipointer to the row index (nz elements)
Ajpointer to the column index (nz elements)
Axpointer to the values index (nz elements)

Definition at line 86 of file sparse_helper.cpp.

88 {
89 vector<TripletEntry> entries;
90 entries.reserve(nz);
91 for (int i = 0; i < nz; ++i) {
92 entries.emplace_back(TripletEntry(Ai[i], Aj[i], Ax[i]));
93 if (upperTriangleSymmetric && Ai[i] != Aj[i])
94 entries.emplace_back(TripletEntry(Aj[i], Ai[i], Ax[i]));
95 }
96 sort(entries.begin(), entries.end(), TripletColSort());
97 return writeTripletEntries(filename, rows, cols, entries);
98}

References writeTripletEntries().

Referenced by g2o::csparse_extension::writeCs2Octave().

◆ writeVector() [1/2]

G2O_STUFF_API bool g2o::writeVector ( const std::string &  filename,
const double *  v,
int  n 
)

write an array to a file, debugging

◆ writeVector() [2/2]

bool g2o::writeVector ( const string &  filename,
const double *  v,
int  n 
)

Definition at line 61 of file sparse_helper.cpp.

61 {
62 ofstream os(filename.c_str());
63 os << fixed;
64 for (int i = 0; i < n; i++) os << *v++ << endl;
65 return os.good();
66}

Variable Documentation

◆ _gen_real

std::mt19937 g2o::_gen_real
static

Definition at line 33 of file sampler.cpp.

Referenced by sampleGaussian(), and sampleUniform().

◆ _uniformReal

std::uniform_real_distribution<double> g2o::_uniformReal
static

Definition at line 32 of file sampler.cpp.

Referenced by sampleUniform().

◆ INFORMATION_SCALING_ODOMETRY

const double g2o::INFORMATION_SCALING_ODOMETRY = 100
static

Definition at line 48 of file sclam_helpers.cpp.

Referenced by addOdometryCalibLinksDifferential().

◆ OptimizationAlgorithm

Definition at line 45 of file optimization_algorithm_factory.h.