Skip to content
Snippets Groups Projects
Commit f8aa9e0d authored by Joaquim Casals Buñuel's avatar Joaquim Casals Buñuel
Browse files

Add dynamic state blocks check @CaptureBase::print

parent 5b62e2a1
No related branches found
No related tags found
1 merge request!348WIP: Resolve "Rework Problem::{check,print} into a recursive approach"
Pipeline #5219 failed
......@@ -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;
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment