From 311517e83011c25ceeb1d8efaf1fdc3ea7a14589 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Joan=20Sol=C3=A0?= <jsola@iri.upc.edu>
Date: Thu, 2 Apr 2020 14:03:00 +0200
Subject: [PATCH] Only perturb frames if they are estimated

---
 src/problem/problem.cpp | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/src/problem/problem.cpp b/src/problem/problem.cpp
index 51c3ccd8e..b35ae1a86 100644
--- a/src/problem/problem.cpp
+++ b/src/problem/problem.cpp
@@ -1830,9 +1830,12 @@ void Problem::perturb(double amplitude)
     // Frames and Captures
     for (auto& F : getTrajectory()->getFrameList())
     {
-        F->perturb(amplitude);
-        for (auto& C : F->getCaptureList())
-            C->perturb(amplitude);
+        if (F->isKeyOrAux())
+        {
+            F->perturb(amplitude);
+            for (auto& C : F->getCaptureList())
+                C->perturb(amplitude);
+        }
     }
 
     // Landmarks
-- 
GitLab