formatting changes

release/4.3a0
akrishnan86 2021-03-05 00:06:30 -08:00
parent a2f99ac71c
commit 759dcaa1dd
2 changed files with 13 additions and 14 deletions

View File

@ -104,8 +104,8 @@ Values TranslationRecovery::initalizeRandomly() const {
insert(edge.key2()); insert(edge.key2());
} }
// If there are no valid edges, but zero-distance edges exist, initialize one of // If there are no valid edges, but zero-distance edges exist, initialize one
// the nodes in a connected component of zero-distance edges. // of the nodes in a connected component of zero-distance edges.
if (initial.empty() && !sameTranslationNodes_.empty()) { if (initial.empty() && !sameTranslationNodes_.empty()) {
for (const auto &optimizedAndDuplicateKeys : sameTranslationNodes_) { for (const auto &optimizedAndDuplicateKeys : sameTranslationNodes_) {
Key optimizedKey = optimizedAndDuplicateKeys.first; Key optimizedKey = optimizedAndDuplicateKeys.first;

View File

@ -17,7 +17,6 @@
*/ */
#include <CppUnitLite/TestHarness.h> #include <CppUnitLite/TestHarness.h>
#include <gtsam/sfm/TranslationRecovery.h> #include <gtsam/sfm/TranslationRecovery.h>
#include <gtsam/slam/dataset.h> #include <gtsam/slam/dataset.h>
@ -244,7 +243,8 @@ TEST(TranslationRecovery, ThreePosesWithZeroTranslation) {
poses.insert<Pose3>(1, Pose3(Rot3(), Point3(0, 0, 0))); poses.insert<Pose3>(1, Pose3(Rot3(), Point3(0, 0, 0)));
poses.insert<Pose3>(2, Pose3(Rot3::RzRyRx(M_PI / 6, 0, 0), Point3(0, 0, 0))); poses.insert<Pose3>(2, Pose3(Rot3::RzRyRx(M_PI / 6, 0, 0), Point3(0, 0, 0)));
auto relativeTranslations = TranslationRecovery::SimulateMeasurements(poses, {{0, 1}, {1, 2}, {2, 0}}); auto relativeTranslations = TranslationRecovery::SimulateMeasurements(
poses, {{0, 1}, {1, 2}, {2, 0}});
// Check simulated measurements. // Check simulated measurements.
for (auto& unitTranslation : relativeTranslations) { for (auto& unitTranslation : relativeTranslations) {
@ -266,7 +266,6 @@ TEST(TranslationRecovery, ThreePosesWithZeroTranslation) {
EXPECT(assert_equal(Point3(0, 0, 0), result.at<Point3>(2))); EXPECT(assert_equal(Point3(0, 0, 0), result.at<Point3>(2)));
} }
/* ************************************************************************* */ /* ************************************************************************* */
int main() { int main() {
TestResult tr; TestResult tr;