From fdacba92c50ef81331d24962243d40dfa2ff23d1 Mon Sep 17 00:00:00 2001 From: Enrique Fernandez Date: Tue, 11 Aug 2015 15:25:35 -0400 Subject: [PATCH] Fix use model in file, in load2D --- gtsam/slam/dataset.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/gtsam/slam/dataset.cpp b/gtsam/slam/dataset.cpp index 04234bacc..68c27e76b 100644 --- a/gtsam/slam/dataset.cpp +++ b/gtsam/slam/dataset.cpp @@ -247,6 +247,7 @@ GraphAndValues load2D(const string& filename, SharedNoiseModel model, Key maxID, // Parse the pose constraints Key id1, id2; bool haveLandmark = false; + const bool useModelInFile = !model; while (!is.eof()) { if (!(is >> tag)) break; @@ -267,7 +268,7 @@ GraphAndValues load2D(const string& filename, SharedNoiseModel model, Key maxID, if (maxID && (id1 >= maxID || id2 >= maxID)) continue; - if (!model) + if (useModelInFile) model = modelInFile; if (addNoise)