-
Notifications
You must be signed in to change notification settings - Fork 767
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Adding serialization support to be used for GT-SFM #650
Merged
Merged
Changes from 5 commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
b5db391
adding serialization and other functions to enable testing
ayushbaid df4419b
adding track serialization and testable trait
ayushbaid 9d61e5b
improving formatting
ayushbaid f88b456
fixing variable names and comments
ayushbaid c46e3db
adding serialization functions to wrapper
ayushbaid e0cda60
fixing xml serialization issues
ayushbaid 2e86921
reverting SfmTrack to struct
ayushbaid 0ce1db2
printing out the 3d point
ayushbaid 915b439
adding equals function to wrapper
ayushbaid 1d41754
adding inline comment for round trip
ayushbaid File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
/* ---------------------------------------------------------------------------- | ||
|
||
* GTSAM Copyright 2010, Georgia Tech Research Corporation, | ||
* Atlanta, Georgia 30332-0415 | ||
* All Rights Reserved | ||
* Authors: Frank Dellaert, et al. (see THANKS for the full author list) | ||
|
||
* See LICENSE for the license information | ||
|
||
* -------------------------------------------------------------------------- */ | ||
|
||
/** | ||
* @file testSerializationDataset.cpp | ||
* @brief serialization tests for dataset.cpp | ||
* @author Ayush Baid | ||
* @date Jan 1, 2021 | ||
*/ | ||
|
||
#include <gtsam/slam/dataset.h> | ||
|
||
#include <gtsam/base/serializationTestHelpers.h> | ||
#include <CppUnitLite/TestHarness.h> | ||
|
||
using namespace std; | ||
using namespace gtsam; | ||
using namespace gtsam::serializationTestHelpers; | ||
|
||
/* ************************************************************************* */ | ||
TEST(dataSet, sfmDataSerialization){ | ||
// Test the serialization of SfmData | ||
const string filename = findExampleDataFile("dubrovnik-3-7-pre"); | ||
SfmData mydata; | ||
CHECK(readBAL(filename, mydata)); | ||
|
||
EXPECT(equalsObj(mydata)); | ||
johnwlambert marked this conversation as resolved.
Show resolved
Hide resolved
|
||
// EXPECT(equalsXML(mydata)); | ||
ayushbaid marked this conversation as resolved.
Show resolved
Hide resolved
|
||
// EXPECT(equalsBinary(mydata)); | ||
} | ||
|
||
/* ************************************************************************* */ | ||
TEST(dataSet, sfmTrackSerialization){ | ||
// Test the serialization of SfmTrack | ||
const string filename = findExampleDataFile("dubrovnik-3-7-pre"); | ||
SfmData mydata; | ||
CHECK(readBAL(filename, mydata)); | ||
|
||
SfmTrack track = mydata.track(0); | ||
|
||
EXPECT(equalsObj(track)); | ||
ayushbaid marked this conversation as resolved.
Show resolved
Hide resolved
|
||
// EXPECT(equalsXML(track)); | ||
ayushbaid marked this conversation as resolved.
Show resolved
Hide resolved
|
||
// EXPECT(equalsBinary(track)); | ||
} | ||
|
||
/* ************************************************************************* */ | ||
int main() { TestResult tr; return TestRegistry::runAllTests(tr); } | ||
/* ************************************************************************* */ |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is used to serialize vectors