Merged in enriquefernandezperdomo/gtsam/fix_load2D_modelInFile (pull request #179)

Fix use model in file, in load2D
release/4.3a0
Chris Beall 2015-08-11 21:17:37 -04:00
commit 2146eb1b45
1 changed files with 2 additions and 1 deletions

View File

@ -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)