From 1921929896a9a4687419abc6e4730ffd0a691b5d Mon Sep 17 00:00:00 2001
From: joanvallve <jvallve@iri.upc.edu>
Date: Mon, 28 Sep 2020 17:58:41 +0200
Subject: [PATCH] hotfix: check dynamic sb instead of is in capture

---
 src/sensor/sensor_base.cpp | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/src/sensor/sensor_base.cpp b/src/sensor/sensor_base.cpp
index 696061983..b1742c5ae 100644
--- a/src/sensor/sensor_base.cpp
+++ b/src/sensor/sensor_base.cpp
@@ -198,7 +198,7 @@ void SensorBase::registerNewStateBlocks() const
             auto key = pair_key_sbp.first;
             auto sbp = pair_key_sbp.second;
 
-            if (sbp && !isStateBlockInCapture(key))
+            if (sbp and not isStateBlockDynamic(key))//!isStateBlockInCapture(key))
                 getProblem()->notifyStateBlock(sbp, ADD);
         }
     }
@@ -481,6 +481,8 @@ void SensorBase::printHeader(int _depth, bool _constr_by, bool _metric, bool _st
             auto sb = getStateBlockDynamic(key);
             if (sb)
                 _stream << key << "[" << (isStateBlockDynamic(key) ? "Dyn" : "Sta") << "," << (sb->isFixed() ? "Fix" : "Est") << "] = ( " << sb->getState().transpose() << " ); ";
+            else
+                _stream << "NULLPTR ";
         }
         _stream << std::endl;
     }
@@ -492,6 +494,8 @@ void SensorBase::printHeader(int _depth, bool _constr_by, bool _metric, bool _st
             auto sb = getStateBlockDynamic(key);
             if (sb)
                 _stream << sb->getState().transpose() << " ";
+            else
+                _stream << "NULLPTR ";
         }
         _stream << ")" << std::endl;
     }
@@ -503,6 +507,8 @@ void SensorBase::printHeader(int _depth, bool _constr_by, bool _metric, bool _st
             auto sb = getStateBlockDynamic(key);
             if (sb)
                 _stream << key << "[" << (isStateBlockDynamic(key) ? "Dyn" : "Sta") << "," << (sb->isFixed() ? "Fix" : "Est") << "]; ";
+            else
+                _stream << "NULLPTR ";
         }
         _stream << std::endl;
     }
-- 
GitLab