diff --git a/gtsam/slam/dataset.cpp b/gtsam/slam/dataset.cpp index 4bd7bc7e2..270dbeb95 100644 --- a/gtsam/slam/dataset.cpp +++ b/gtsam/slam/dataset.cpp @@ -1129,6 +1129,13 @@ bool readBAL(const string &filename, SfmData &data) { return true; } +/* ************************************************************************* */ +SfmData readBal(const string &filename) { + SfmData data; + readBAL(filename, data); + return data; +} + /* ************************************************************************* */ bool writeBAL(const string &filename, SfmData &data) { // Open the output file diff --git a/gtsam/slam/dataset.h b/gtsam/slam/dataset.h index 7ceca00f4..2e03c92d8 100644 --- a/gtsam/slam/dataset.h +++ b/gtsam/slam/dataset.h @@ -277,6 +277,14 @@ GTSAM_EXPORT bool readBundler(const std::string& filename, SfmData &data); */ GTSAM_EXPORT bool readBAL(const std::string& filename, SfmData &data); +/** + * @brief This function parses a "Bundle Adjustment in the Large" (BAL) file and returns the data + * as a SfmData structure. Mainly used by wrapped code. + * @param filename The name of the BAL file. + * @return SfM structure where the data is stored. + */ +GTSAM_EXPORT SfmData readBal(const std::string& filename); + /** * @brief This function writes a "Bundle Adjustment in the Large" (BAL) file from a * SfmData structure