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

Modify Wolf elements' labels in Problem::print()

parent 58e114a9
No related branches found
No related tags found
1 merge request!340Resolve "Problem::check() more exhaustive"
Pipeline #4990 passed
...@@ -885,7 +885,7 @@ void Problem::print(int depth, bool constr_by, bool metric, bool state_blocks) c ...@@ -885,7 +885,7 @@ void Problem::print(int depth, bool constr_by, bool metric, bool state_blocks) c
// Sensors ======================================================================================= // Sensors =======================================================================================
for (auto S : getHardware()->getSensorList()) for (auto S : getHardware()->getSensorList())
{ {
cout << " S" << S->id() << " " << S->getType() << " \"" << S->getName() << "\""; cout << " Sen" << S->id() << " " << S->getType() << " \"" << S->getName() << "\"";
if (depth < 2) if (depth < 2)
cout << " -- " << S->getProcessorList().size() << "p"; cout << " -- " << S->getProcessorList().size() << "p";
cout << endl; cout << endl;
...@@ -929,28 +929,28 @@ void Problem::print(int depth, bool constr_by, bool metric, bool state_blocks) c ...@@ -929,28 +929,28 @@ void Problem::print(int depth, bool constr_by, bool metric, bool state_blocks) c
{ {
if (p->isMotion()) if (p->isMotion())
{ {
std::cout << " pm" << p->id() << " " << p->getType() << " \"" << p->getName() << "\"" << endl; std::cout << " PrcM" << p->id() << " " << p->getType() << " \"" << p->getName() << "\"" << endl;
ProcessorMotionPtr pm = std::static_pointer_cast<ProcessorMotion>(p); ProcessorMotionPtr pm = std::static_pointer_cast<ProcessorMotion>(p);
if (pm->getOrigin()) if (pm->getOrigin())
cout << " o: C" << pm->getOrigin()->id() << " - " << (pm->getOrigin()->getFrame()->isKeyOrAux() ? (pm->getOrigin()->getFrame()->isKey() ? " KF" : " AuxF" ) : " F") cout << " o: C" << pm->getOrigin()->id() << " - " << (pm->getOrigin()->getFrame()->isKeyOrAux() ? (pm->getOrigin()->getFrame()->isKey() ? " KFrm" : " AFrm" ) : " Frm")
<< pm->getOrigin()->getFrame()->id() << endl; << pm->getOrigin()->getFrame()->id() << endl;
if (pm->getLast()) if (pm->getLast())
cout << " l: C" << pm->getLast()->id() << " - " << (pm->getLast()->getFrame()->isKeyOrAux() ? (pm->getLast()->getFrame()->isKey() ? " KF" : " AuxF") : " F") cout << " l: C" << pm->getLast()->id() << " - " << (pm->getLast()->getFrame()->isKeyOrAux() ? (pm->getLast()->getFrame()->isKey() ? " KFrm" : " AFrm") : " Frm")
<< pm->getLast()->getFrame()->id() << endl; << pm->getLast()->getFrame()->id() << endl;
if (pm->getIncoming()) if (pm->getIncoming())
cout << " i: C" << pm->getIncoming()->id() << endl; cout << " i: C" << pm->getIncoming()->id() << endl;
} }
else else
{ {
cout << " pt" << p->id() << " " << p->getType() << " \"" << p->getName() << "\"" << endl; cout << " PrcT" << p->id() << " " << p->getType() << " \"" << p->getName() << "\"" << endl;
ProcessorTrackerPtr pt = std::dynamic_pointer_cast<ProcessorTracker>(p); ProcessorTrackerPtr pt = std::dynamic_pointer_cast<ProcessorTracker>(p);
if (pt) if (pt)
{ {
if (pt->getOrigin()) if (pt->getOrigin())
cout << " o: C" << pt->getOrigin()->id() << " - " << (pt->getOrigin()->getFrame()->isKeyOrAux() ? (pt->getOrigin()->getFrame()->isKey() ? " KF" : " AuxF") : " F") cout << " o: C" << pt->getOrigin()->id() << " - " << (pt->getOrigin()->getFrame()->isKeyOrAux() ? (pt->getOrigin()->getFrame()->isKey() ? " KFrm" : " AFrm") : " Frm")
<< pt->getOrigin()->getFrame()->id() << endl; << pt->getOrigin()->getFrame()->id() << endl;
if (pt->getLast()) if (pt->getLast())
cout << " l: C" << pt->getLast()->id() << " - " << (pt->getLast()->getFrame()->isKeyOrAux() ? (pt->getLast()->getFrame()->isKey() ? " KF" : " AuxF") : " F") cout << " l: C" << pt->getLast()->id() << " - " << (pt->getLast()->getFrame()->isKeyOrAux() ? (pt->getLast()->getFrame()->isKey() ? " KFrm" : " AFrm") : " Frm")
<< pt->getLast()->getFrame()->id() << endl; << pt->getLast()->getFrame()->id() << endl;
if (pt->getIncoming()) if (pt->getIncoming())
cout << " i: C" << pt->getIncoming()->id() << endl; cout << " i: C" << pt->getIncoming()->id() << endl;
...@@ -966,12 +966,12 @@ void Problem::print(int depth, bool constr_by, bool metric, bool state_blocks) c ...@@ -966,12 +966,12 @@ void Problem::print(int depth, bool constr_by, bool metric, bool state_blocks) c
// Frames ======================================================================================= // Frames =======================================================================================
for (auto F : getTrajectory()->getFrameList()) for (auto F : getTrajectory()->getFrameList())
{ {
cout << (F->isKeyOrAux() ? (F->isKey() ? " KF" : " AuxF") : " F") << F->id() << ((depth < 2) ? " -- " + std::to_string(F->getCaptureList().size()) + "C " : ""); cout << (F->isKeyOrAux() ? (F->isKey() ? " KFrm" : " AFrm") : " Frm") << F->id() << ((depth < 2) ? " -- " + std::to_string(F->getCaptureList().size()) + "C " : "");
if (constr_by) if (constr_by)
{ {
cout << " <-- "; cout << " <-- ";
for (auto cby : F->getConstrainedByList()) for (auto cby : F->getConstrainedByList())
cout << "c" << cby->id() << " \t"; cout << "Fac" << cby->id() << " \t";
} }
cout << endl; cout << endl;
if (metric) if (metric)
...@@ -995,11 +995,11 @@ void Problem::print(int depth, bool constr_by, bool metric, bool state_blocks) c ...@@ -995,11 +995,11 @@ void Problem::print(int depth, bool constr_by, bool metric, bool state_blocks) c
// Captures ======================================================================================= // Captures =======================================================================================
for (auto C : F->getCaptureList()) for (auto C : F->getCaptureList())
{ {
cout << " C" << (C->isMotion() ? "M" : "") << C->id() << " " << C->getType(); cout << " Cap" << (C->isMotion() ? "M" : "") << C->id() << " " << C->getType();
if(C->getSensor() != nullptr) if(C->getSensor() != nullptr)
{ {
cout << " -> S" << C->getSensor()->id(); cout << " -> Sen" << C->getSensor()->id();
} }
else else
cout << " -> S-"; cout << " -> S-";
...@@ -1008,9 +1008,9 @@ void Problem::print(int depth, bool constr_by, bool metric, bool state_blocks) c ...@@ -1008,9 +1008,9 @@ void Problem::print(int depth, bool constr_by, bool metric, bool state_blocks) c
auto CM = std::static_pointer_cast<CaptureMotion>(C); auto CM = std::static_pointer_cast<CaptureMotion>(C);
if (auto OC = CM->getOriginCapture()) if (auto OC = CM->getOriginCapture())
{ {
cout << " -> OC" << OC->id(); cout << " -> OCap" << OC->id();
if (auto OF = OC->getFrame()) if (auto OF = OC->getFrame())
cout << " ; OF" << OF->id(); cout << " ; OFrm" << OF->id();
} }
} }
...@@ -1019,7 +1019,7 @@ void Problem::print(int depth, bool constr_by, bool metric, bool state_blocks) c ...@@ -1019,7 +1019,7 @@ void Problem::print(int depth, bool constr_by, bool metric, bool state_blocks) c
{ {
cout << " <-- "; cout << " <-- ";
for (auto cby : C->getConstrainedByList()) for (auto cby : C->getConstrainedByList())
cout << "c" << cby->id() << " \t"; cout << "Fac" << cby->id() << " \t";
} }
cout << endl; cout << endl;
...@@ -1058,12 +1058,12 @@ void Problem::print(int depth, bool constr_by, bool metric, bool state_blocks) c ...@@ -1058,12 +1058,12 @@ void Problem::print(int depth, bool constr_by, bool metric, bool state_blocks) c
// Features ======================================================================================= // Features =======================================================================================
for (auto f : C->getFeatureList()) for (auto f : C->getFeatureList())
{ {
cout << " f" << f->id() << " trk" << f->trackId() << " " << f->getType() << ((depth < 4) ? " -- " + std::to_string(f->getFactorList().size()) + "c " : ""); cout << " Ftr" << f->id() << " trk" << f->trackId() << " " << f->getType() << ((depth < 4) ? " -- " + std::to_string(f->getFactorList().size()) + "c " : "");
if (constr_by) if (constr_by)
{ {
cout << " <--\t"; cout << " <--\t";
for (auto cby : f->getConstrainedByList()) for (auto cby : f->getConstrainedByList())
cout << "c" << cby->id() << " \t"; cout << "Fac" << cby->id() << " \t";
} }
cout << endl; cout << endl;
if (metric) if (metric)
...@@ -1074,17 +1074,17 @@ void Problem::print(int depth, bool constr_by, bool metric, bool state_blocks) c ...@@ -1074,17 +1074,17 @@ void Problem::print(int depth, bool constr_by, bool metric, bool state_blocks) c
// Factors ======================================================================================= // Factors =======================================================================================
for (auto c : f->getFactorList()) for (auto c : f->getFactorList())
{ {
cout << " c" << c->id() << " " << c->getType() << " -->"; cout << " Fac" << c->id() << " " << c->getType() << " -->";
if (c->getFrameOther() == nullptr && c->getCaptureOther() == nullptr && c->getFeatureOther() == nullptr && c->getLandmarkOther() == nullptr) if (c->getFrameOther() == nullptr && c->getCaptureOther() == nullptr && c->getFeatureOther() == nullptr && c->getLandmarkOther() == nullptr)
cout << " A"; cout << " Abs";
if (c->getFrameOther() != nullptr) if (c->getFrameOther() != nullptr)
cout << " F" << c->getFrameOther()->id(); cout << " Frm" << c->getFrameOther()->id();
if (c->getCaptureOther() != nullptr) if (c->getCaptureOther() != nullptr)
cout << " C" << c->getCaptureOther()->id(); cout << " Cap" << c->getCaptureOther()->id();
if (c->getFeatureOther() != nullptr) if (c->getFeatureOther() != nullptr)
cout << " f" << c->getFeatureOther()->id(); cout << " Fac" << c->getFeatureOther()->id();
if (c->getLandmarkOther() != nullptr) if (c->getLandmarkOther() != nullptr)
cout << " L" << c->getLandmarkOther()->id(); cout << " Lmk" << c->getLandmarkOther()->id();
cout << endl; cout << endl;
} // for c } // for c
} }
...@@ -1100,12 +1100,12 @@ void Problem::print(int depth, bool constr_by, bool metric, bool state_blocks) c ...@@ -1100,12 +1100,12 @@ void Problem::print(int depth, bool constr_by, bool metric, bool state_blocks) c
// Landmarks ======================================================================================= // Landmarks =======================================================================================
for (auto L : getMap()->getLandmarkList()) for (auto L : getMap()->getLandmarkList())
{ {
cout << " L" << L->id() << " " << L->getType(); cout << " Lmk" << L->id() << " " << L->getType();
if (constr_by) if (constr_by)
{ {
cout << "\t<-- "; cout << "\t<-- ";
for (auto cby : L->getConstrainedByList()) for (auto cby : L->getConstrainedByList())
cout << "c" << cby->id() << " \t"; cout << "Fac" << cby->id() << " \t";
} }
cout << endl; cout << endl;
if (metric) if (metric)
......
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