diff --git a/gtsam_unstable/examples/SmartRangeExample_plaza1.cpp b/gtsam_unstable/examples/SmartRangeExample_plaza1.cpp index 2fccf6b18..984637ef0 100644 --- a/gtsam_unstable/examples/SmartRangeExample_plaza1.cpp +++ b/gtsam_unstable/examples/SmartRangeExample_plaza1.cpp @@ -234,8 +234,11 @@ int main(int argc, char** argv) { } } countK = 0; - for (const auto& [key, point] : result.extract()) + for (const auto& key_point : result.extract()) { + auto key = key_point.first; + const Point2 point = key_point.second; os2 << key << "\t" << point.x() << "\t" << point.y() << "\t1" << endl; + } if (smart) { for(size_t jj: ids) { Point2 landmark = smartFactors[jj]->triangulate(result); @@ -256,8 +259,11 @@ int main(int argc, char** argv) { // Write result to file Values result = isam.calculateEstimate(); ofstream os("rangeResult.txt"); - for (const auto& [key, pose] : result.extract()) + for (const auto& key_pose : result.extract()) { + auto key = key_pose.first; + const Pose2 pose = key_pose.second; os << key << "\t" << pose.x() << "\t" << pose.y() << "\t" << pose.theta() << endl; + } exit(0); } diff --git a/gtsam_unstable/examples/SmartRangeExample_plaza2.cpp b/gtsam_unstable/examples/SmartRangeExample_plaza2.cpp index 1e6f77b31..b7f1fb1e3 100644 --- a/gtsam_unstable/examples/SmartRangeExample_plaza2.cpp +++ b/gtsam_unstable/examples/SmartRangeExample_plaza2.cpp @@ -202,11 +202,17 @@ int main(int argc, char** argv) { // Write result to file Values result = isam.calculateEstimate(); ofstream os2("rangeResultLM.txt"); - for (const auto& [key, point] : result.extract()) + for (const auto& key_point : result.extract()) { + auto key = key_point.first; + const Point2 point = key_point.second; os2 << key << "\t" << point.x() << "\t" << point.y() << "\t1" << endl; + } ofstream os("rangeResult.txt"); - for (const auto& [key, pose] : result.extract()) + for (const auto& key_pose : result.extract()) { + auto key = key_pose.first; + const Pose2 pose = key_pose.second; os << key << "\t" << pose.x() << "\t" << pose.y() << "\t" << pose.theta() << endl; + } exit(0); }