diff --git a/src/capture/capture_base.cpp b/src/capture/capture_base.cpp index b3c88e1595cd7ff38439e227c2c8c3faa70f6955..7a5b646163e17365fc91b0f24e33f838b6a986f1 100644 --- a/src/capture/capture_base.cpp +++ b/src/capture/capture_base.cpp @@ -297,30 +297,32 @@ void CaptureBase::printHeader(int _depth, std::ostream& _stream, bool _constr_by } _stream << std::endl; - - if (_metric && _state_blocks){ - for (const auto& key : getStructure()) + if(getStateBlockMap().size() > 0) + { + if (_metric && _state_blocks){ + for (const auto& key : getStructure()) + { + auto sb = getStateBlock(key); + _stream << _tabs << key << "[" << (sb->isFixed() ? "Fix" : "Est") << "] = ( " << sb->getState().transpose() << " )" << std::endl; + } + } + else if (_metric) { - auto sb = getStateBlock(key); - _stream << _tabs << key << "[" << (sb->isFixed() ? "Fix" : "Est") << "] = ( " << sb->getState().transpose() << " )" << std::endl; + _stream << _tabs << (isFixed() ? "Fix" : "Est") << ", ts=" << std::setprecision(5) + << getTimeStamp(); + _stream << ",\t x= ( " << std::setprecision(2) << getState().transpose() << " )"; + _stream << std::endl; } - } - else if (_metric) - { - _stream << (isFixed() ? " Fix" : " Est") << ", ts=" << std::setprecision(5) - << getTimeStamp(); - _stream << ",\t x = ( " << std::setprecision(2) << getState().transpose() << " )"; - _stream << std::endl; - } - else if (_state_blocks) - { - _stream << " sb:"; - for (const auto& key : getStructure()) + else if (_state_blocks) { - const auto& sb = getStateBlock(key); - _stream << " " << key << "[" << (sb->isFixed() ? "Fix" : "Est") << "]; "; + _stream << " sb:"; + for (const auto& key : getStructure()) + { + const auto& sb = getStateBlock(key); + _stream << " " << key << "[" << (sb->isFixed() ? "Fix" : "Est") << "]; "; + } + _stream << std::endl; } - _stream << std::endl; }