diff --git a/hello_wolf/hello_wolf.cpp b/hello_wolf/hello_wolf.cpp index ac33da83c3fece5dce946e9c808869edd511e6f4..80f5288f1b8ab940a4be3305f0b346c598f940f7 100644 --- a/hello_wolf/hello_wolf.cpp +++ b/hello_wolf/hello_wolf.cpp @@ -260,7 +260,7 @@ int main() std::cout << std::endl; WOLF_TRACE("======== FINAL PRINT FOR INTERPRETATION =======") - problem->print(4,1,1,1); + problem->print(4,0,1,0); /* * ============= FIRST COMMENT ON THE RESULTS ================== diff --git a/src/capture/capture_base.cpp b/src/capture/capture_base.cpp index 62e602c549182f522ddc89c2f321e44421d11b21..2175b4ac2f92efadeecf8074bf36c8f4a76f4b40 100644 --- a/src/capture/capture_base.cpp +++ b/src/capture/capture_base.cpp @@ -297,18 +297,46 @@ void CaptureBase::printHeader(int _depth, std::ostream& _stream, bool _constr_by } _stream << std::endl; - if (_state_blocks) - for (const auto& sb : getStateBlockVec()) + + if (_metric && _state_blocks){ + for (const auto& key : getStructure()) { - if(sb != nullptr) - { - _stream << " sb: "; - _stream << (sb->isFixed() ? "Fix" : "Est"); - if (_metric) - _stream << std::setprecision(2) << " (" << sb->getState().transpose() << " )"; - _stream << std::endl; - } + auto sb = getStateBlock(key); + _stream << " " << key << "[" << (sb->isFixed() ? "Fix" : "Est") << "] = ( " << sb->getState().transpose() << " )" << 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()) + { + const auto& sb = getStateBlock(key); + _stream << " " << key << "[" << (sb->isFixed() ? "Fix" : "Est") << "]; "; + } + _stream << std::endl; + } + + + +// if (_state_blocks) +// for (const auto& sb : getStateBlockVec()) +// { +// if(sb != nullptr) +// { +// _stream << " sb: "; +// _stream << (sb->isFixed() ? "Fix" : "Est"); +// if (_metric) +// _stream << std::setprecision(2) << " (" << sb->getState().transpose() << " )"; +// _stream << std::endl; +// } +// } } void CaptureBase::print(int _depth, std::ostream& _stream, bool _constr_by, bool _metric, bool _state_blocks) const { diff --git a/src/frame/frame_base.cpp b/src/frame/frame_base.cpp index a341335d12c7a6d1b4dd4519901070805ef2492e..233ea4434a1739544af946c9680c61215e57eb72 100644 --- a/src/frame/frame_base.cpp +++ b/src/frame/frame_base.cpp @@ -374,7 +374,7 @@ void FrameBase::printHeader(int _depth, std::ostream& _stream, bool _constr_by, for (const auto& key : getStructure()) { auto sb = getStateBlock(key); - _stream << " " << key << "," << (sb->isFixed() ? "Fix: " : "Est: ") << sb->getState().transpose() << std::endl; + _stream << " " << key << "[" << (sb->isFixed() ? "Fix" : "Est") << "] = ( " << sb->getState().transpose() << " )" << std::endl; } } else if (_metric) @@ -387,9 +387,10 @@ void FrameBase::printHeader(int _depth, std::ostream& _stream, bool _constr_by, else if (_state_blocks) { _stream << " sb:"; - for (const auto& sb : getStateBlockVec()) + for (const auto& key : getStructure()) { - _stream << " " << (sb->isFixed() ? "Fix" : "Est"); + const auto& sb = getStateBlock(key); + _stream << " " << key << "[" << (sb->isFixed() ? "Fix" : "Est") << "]; "; } _stream << std::endl; } diff --git a/src/landmark/landmark_base.cpp b/src/landmark/landmark_base.cpp index 20df53bd0f9e2e5a1e58b974edd1988c55464e89..0750fa7aef8fb10d0b87325f0b4f3dbbc0212692 100644 --- a/src/landmark/landmark_base.cpp +++ b/src/landmark/landmark_base.cpp @@ -163,19 +163,27 @@ void LandmarkBase::printHeader(int _depth, std::ostream& _stream, bool _constr_b _stream << "Fac" << cby->id() << " \t"; } _stream << std::endl; - if (_metric) + + if (_metric && _state_blocks){ + for (const auto& key : getStructure()) + { + auto sb = getStateBlock(key); + _stream << " " << key << "[" << (sb->isFixed() ? "Fix" : "Est") << "] = ( " << sb->getState().transpose() << " )" << std::endl; + } + } + else if (_metric) { _stream << (isFixed() ? " Fix" : " Est"); _stream << ",\t x = ( " << std::setprecision(2) << getState().transpose() << " )"; _stream << std::endl; } - if (_state_blocks) + else if (_state_blocks) { _stream << " sb:"; - for (const auto& sb : getStateBlockVec()) + for (const auto& key : getStructure()) { - if (sb != nullptr) - _stream << (sb->isFixed() ? " Fix" : " Est"); + const auto& sb = getStateBlock(key); + _stream << " " << key << "[" << (sb->isFixed() ? "Fix" : "Est") << "]; "; } _stream << std::endl; } diff --git a/src/sensor/sensor_base.cpp b/src/sensor/sensor_base.cpp index 6ed95da19ade0a8fefd9d90609bc7111fcccce8d..525202369ffe0a711ad53606e77c760b447b4785 100644 --- a/src/sensor/sensor_base.cpp +++ b/src/sensor/sensor_base.cpp @@ -473,6 +473,7 @@ void SensorBase::printHeader(int _depth, std::ostream& _stream, bool _constr_by, if (_depth < 2) _stream << " -- " << getProcessorList().size() << "p"; _stream << std::endl; + if (_metric && _state_blocks) { _stream << " sb: ";