|
g2o
|
example for an interface to a SLAM algorithm More...
#include <example_slam_interface.h>


Public Member Functions | |
| ExampleSlamInterface () | |
| bool | addNode (const std::string &tag, int id, int dimension, const std::vector< double > &values) |
| bool | addEdge (const std::string &tag, int id, int dimension, int v1, int v2, const std::vector< double > &measurement, const std::vector< double > &information) |
| bool | fixNode (const std::vector< int > &nodes) |
| bool | queryState (const std::vector< int > &nodes) |
| bool | solveState () |
Protected Attributes | |
| std::map< int, std::pair< std::string, std::vector< double > > > | _vertices |
example for an interface to a SLAM algorithm
Example for an interface to a SLAM algorithm. You may modify this class to fit your needs. The example class does not actually perform any optimization, it just keeps the input values and outputs the same values if asked. See the documentation of SlamParser::AbstractSlamInterface for details.
Definition at line 43 of file example_slam_interface.h.
| ExampleSlamInterface::ExampleSlamInterface | ( | ) |
Definition at line 32 of file example_slam_interface.cpp.
|
virtual |
adding an edge to the SLAM engine.
| tag | the tag specifying the type of the vertex |
| id | the unique id of the edge. |
| dimension | the dimension of the edge. |
| v1 | the unique id of the edge of the first vertex |
| v2 | the unique id of the edge of the second vertex |
| measurement | the measurement of the constraint |
| information | the information matrix (inverse of the covariance) representing the uncertainty of the measurement (row-major upper triangular and diagonal) |
Implements SlamParser::AbstractSlamInterface.
Definition at line 53 of file example_slam_interface.cpp.
|
virtual |
adding a node to the SLAM engine.
| tag | the tag specifying the type of the vertex |
| id | the unique id of the node. |
| dimension | the dimension of the node. |
| values | the pose of the node, may be empty (i.e., the engine should initialize the node itself) |
Implements SlamParser::AbstractSlamInterface.
Definition at line 34 of file example_slam_interface.cpp.
References _vertices.
|
virtual |
set some nodes to a fixed position
| nodes | the list of vertex IDs to fix |
Implements SlamParser::AbstractSlamInterface.
Definition at line 67 of file example_slam_interface.cpp.
|
virtual |
Ask the SLAM engine to print the current estimate of the variables
| nodes | the list of vertex IDs to print, if empty print all variables |
Implements SlamParser::AbstractSlamInterface.
Definition at line 74 of file example_slam_interface.cpp.
References _vertices.
|
virtual |
ask the engine to solve
Implements SlamParser::AbstractSlamInterface.
Definition at line 109 of file example_slam_interface.cpp.
|
protected |
the original value of the input (actually not needed if a real SLAM engine is running)
Definition at line 64 of file example_slam_interface.h.
Referenced by addNode(), and queryState().