gtsam
slam
tests
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
22
#include <
gtsam/base/serializationTestHelpers.h
>
23
#include <
CppUnitLite/TestHarness.h
>
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
/* ************************************************************************* */
TestRegistry::runAllTests
static int runAllTests(TestResult &result)
Definition:
TestRegistry.cpp:27
EXPECT
#define EXPECT(condition)
Definition:
Test.h:150
TestHarness.h
gtsam::SfmData::track
const SfmTrack & track(size_t idx) const
The track formed by series of landmark measurements.
Definition:
SfmData.h:80
TEST
TEST(dataSet, sfmDataSerialization)
Definition:
testSerializationDataset.cpp:30
gtsam::SfmData
SfmData stores a bunch of SfmTracks.
Definition:
SfmData.h:39
gtsam::SfmTrack
Definition:
SfmTrack.h:125
main
int main()
Definition:
testSerializationDataset.cpp:56
dataset.h
utility functions for loading datasets
relicense.filename
filename
Definition:
relicense.py:57
serializationTestHelpers.h
TestResult
Definition:
TestResult.h:26
SfmData.h
Data structure for dealing with Structure from Motion data.
gtsam
traits
Definition:
SFMdata.h:40
std
Definition:
BFloat16.h:88
gtsam::findExampleDataFile
GTSAM_EXPORT std::string findExampleDataFile(const std::string &name)
Definition:
dataset.cpp:70
gtsam
Author(s):
autogenerated on Sat Nov 16 2024 04:08:24