testSerializationDataset.cpp
Go to the documentation of this file.
1 /* ----------------------------------------------------------------------------
2 
3  * GTSAM Copyright 2010, Georgia Tech Research Corporation,
4  * Atlanta, Georgia 30332-0415
5  * All Rights Reserved
6  * Authors: Frank Dellaert, et al. (see THANKS for the full author list)
7 
8  * See LICENSE for the license information
9 
10  * -------------------------------------------------------------------------- */
11 
19 #include <gtsam/sfm/SfmData.h>
20 #include <gtsam/slam/dataset.h>
21 
24 
25 using namespace std;
26 using namespace gtsam;
27 using namespace gtsam::serializationTestHelpers;
28 
29 /* ************************************************************************* */
30 TEST(dataSet, sfmDataSerialization) {
31  // Test the serialization of SfmData
32  const string filename = findExampleDataFile("dubrovnik-3-7-pre");
33  SfmData mydata = SfmData::FromBalFile(filename);
34 
35  // round-trip equality check on serialization and subsequent deserialization
36  EXPECT(equalsObj(mydata));
37  EXPECT(equalsXML(mydata));
38  EXPECT(equalsBinary(mydata));
39 }
40 
41 /* ************************************************************************* */
42 TEST(dataSet, sfmTrackSerialization) {
43  // Test the serialization of SfmTrack
44  const string filename = findExampleDataFile("dubrovnik-3-7-pre");
45  SfmData mydata = SfmData::FromBalFile(filename);
46 
47  SfmTrack track = mydata.track(0);
48 
49  // round-trip equality check on serialization and subsequent deserialization
50  EXPECT(equalsObj(track));
51  EXPECT(equalsXML(track));
52  EXPECT(equalsBinary(track));
53 }
54 
55 /* ************************************************************************* */
56 int main() { TestResult tr; return TestRegistry::runAllTests(tr); }
57 /* ************************************************************************* */
SfmData stores a bunch of SfmTracks.
Definition: SfmData.h:39
static int runAllTests(TestResult &result)
const SfmTrack & track(size_t idx) const
The track formed by series of landmark measurements.
Definition: SfmData.h:80
Definition: BFloat16.h:88
#define EXPECT(condition)
Definition: Test.h:150
Data structure for dealing with Structure from Motion data.
TEST(dataSet, sfmDataSerialization)
traits
Definition: chartTesting.h:28
GTSAM_EXPORT std::string findExampleDataFile(const std::string &name)
Definition: dataset.cpp:70
utility functions for loading datasets


gtsam
Author(s):
autogenerated on Tue Jul 4 2023 02:39:18