37#include <boost/smart_ptr/shared_ptr.hpp>
76 KernelFunctionTypeNONE, KernelFunctionTypeHUBER, KernelFunctionTypeTUKEY
96GTSAM_EXPORT std::vector<BinaryMeasurement<T>>
97parseMeasurements(
const std::string &filename,
98 const noiseModel::Diagonal::shared_ptr &model =
nullptr,
106GTSAM_EXPORT std::vector<typename BetweenFactor<T>::shared_ptr>
108 const noiseModel::Diagonal::shared_ptr &model =
nullptr,
109 size_t maxIndex = 0);
113typedef std::pair<size_t, Point2> IndexedLandmark;
114typedef std::pair<std::pair<size_t, size_t>,
Pose2> IndexedEdge;
121GTSAM_EXPORT boost::optional<IndexedPose>
parseVertexPose(std::istream& is,
122 const std::string& tag);
130 const std::string& tag);
137GTSAM_EXPORT boost::optional<IndexedEdge>
parseEdge(std::istream& is,
138 const std::string& tag);
144 std::pair<NonlinearFactorGraph::shared_ptr, Values::shared_ptr>;
154 std::pair<std::string, SharedNoiseModel> dataset,
size_t maxIndex = 0,
155 bool addNoise =
false,
173 size_t maxIndex = 0,
bool addNoise =
false,
bool smart =
true,
179 const Values& config,
const noiseModel::Diagonal::shared_ptr model,
180 const std::string& filename);
191readG2o(
const std::string& g2oFile,
const bool is3D =
false,
207 const Values& estimate,
const std::string& filename);
213using BetweenFactorPose2s = std::vector<BetweenFactor<Pose2>::shared_ptr>;
214GTSAM_EXPORT BetweenFactorPose2s
215parse2DFactors(
const std::string &filename,
216 const noiseModel::Diagonal::shared_ptr &model =
nullptr,
217 size_t maxIndex = 0);
219using BetweenFactorPose3s = std::vector<BetweenFactor<Pose3>::shared_ptr>;
220GTSAM_EXPORT BetweenFactorPose3s
221parse3DFactors(
const std::string &filename,
222 const noiseModel::Diagonal::shared_ptr &model =
nullptr,
223 size_t maxIndex = 0);
225using BinaryMeasurementsUnit3 = std::vector<BinaryMeasurement<Unit3>>;
226using BinaryMeasurementsPoint3 = std::vector<BinaryMeasurement<Point3>>;
227using BinaryMeasurementsRot3 = std::vector<BinaryMeasurement<Rot3>>;
229#ifdef GTSAM_ALLOW_DEPRECATED_SINCE_V42
230inline boost::optional<IndexedPose> GTSAM_DEPRECATED
231parseVertex(std::istream& is,
const std::string& tag) {
235GTSAM_EXPORT std::map<size_t, Pose3> GTSAM_DEPRECATED
236parse3DPoses(
const std::string& filename,
size_t maxIndex = 0);
238GTSAM_EXPORT std::map<size_t, Point3> GTSAM_DEPRECATED
239parse3DLandmarks(
const std::string& filename,
size_t maxIndex = 0);
242load2D_robust(
const std::string& filename,
243 const noiseModel::Base::shared_ptr& model,
size_t maxIndex = 0);
Convenience functions for serializing data structures via boost.serialization.
Typedefs for easier changing of types.
Concept check for values that can be used in unit tests.
Base class for all pinhole cameras.
Calibration used by Bundler.
Factor Graph consisting of non-linear factors.
A non-templated config holding any types of Manifold-group elements.
Data structure for dealing with Structure from Motion data.
Binary measurement represents a measurement between two keys in a graph. A binary measurement is simi...
Global functions in a separate testing namespace.
Definition chartTesting.h:28
GraphAndValues load2D(const string &filename, SharedNoiseModel model, size_t maxIndex, bool addNoise, bool smart, NoiseFormat noiseFormat, KernelFunctionType kernelFunctionType)
Load TORO/G2O style graph files.
Definition dataset.cpp:502
GTSAM_EXPORT std::map< size_t, T > parseVariables(const std::string &filename, size_t maxIndex=0)
Parse variables in a line-based text format (like g2o) into a map.
void writeG2o(const NonlinearFactorGraph &graph, const Values &estimate, const string &filename)
This function writes a g2o file from NonlinearFactorGraph and a Values structure.
Definition dataset.cpp:632
std::pair< size_t, Pose2 > IndexedPose
Return type for auxiliary functions.
Definition dataset.h:112
GraphAndValues readG2o(const string &g2oFile, const bool is3D, KernelFunctionType kernelFunctionType)
This function parses a g2o file and stores the measurements into a NonlinearFactorGraph and the initi...
Definition dataset.cpp:617
GTSAM_EXPORT std::vector< typename BetweenFactor< T >::shared_ptr > parseFactors(const std::string &filename, const noiseModel::Diagonal::shared_ptr &model=nullptr, size_t maxIndex=0)
Parse BetweenFactors in a line-based text format (like g2o) into a vector of shared pointers.
KernelFunctionType
Robust kernel type to wrap around quadratic noise model.
Definition dataset.h:75
NoiseFormat
Indicates how noise parameters are stored in file.
Definition dataset.h:66
@ NoiseFormatGRAPH
default: toro-style order, but covariance matrix !
Definition dataset.h:69
@ NoiseFormatAUTO
Try to guess covariance matrix layout.
Definition dataset.h:71
@ NoiseFormatTORO
Information matrix, but inf_ff inf_fs inf_ss inf_rr inf_fr inf_sr.
Definition dataset.h:68
@ NoiseFormatCOV
Covariance matrix C11, C12, C13, C22, C23, C33.
Definition dataset.h:70
@ NoiseFormatG2O
Information matrix I11, I12, I13, I22, I23, I33.
Definition dataset.h:67
boost::optional< IndexedLandmark > parseVertexLandmark(istream &is, const string &tag)
Parse G2O landmark vertex "id x y".
Definition dataset.cpp:187
noiseModel::Base::shared_ptr SharedNoiseModel
Aliases.
Definition NoiseModel.h:724
boost::optional< IndexedEdge > parseEdge(istream &is, const string &tag)
Parse TORO/G2O edge "id1 id2 x y yaw".
Definition dataset.cpp:293
std::pair< NonlinearFactorGraph::shared_ptr, Values::shared_ptr > GraphAndValues
Return type for load functions, which return a graph and initial values.
Definition dataset.h:144
boost::optional< IndexedPose > parseVertexPose(istream &is, const string &tag)
Parse TORO/G2O vertex "id x y yaw".
Definition dataset.cpp:167
GraphAndValues load3D(const string &filename)
Load TORO 3D Graph.
Definition dataset.cpp:918
void save2D(const NonlinearFactorGraph &graph, const Values &config, const noiseModel::Diagonal::shared_ptr model, const string &filename)
save 2d graph
Definition dataset.cpp:584
string createRewrittenFileName(const string &name)
Creates a temporary file name that needs to be ignored in .gitingnore for checking read-write opratio...
Definition dataset.cpp:99
string findExampleDataFile(const string &name)
Find the full path to an example dataset distributed with gtsam.
Definition dataset.cpp:62
A 2D pose (Point2,Rot2)
Definition Pose2.h:36
Definition NonlinearFactorGraph.h:55
A non-templated config holding any types of Manifold-group elements.
Definition Values.h:65