From d30d86ad1c6ba40b2e4796a1582f6a327901792d Mon Sep 17 00:00:00 2001 From: Joan Sola <jsola@iri.upc.edu> Date: Wed, 9 Mar 2016 19:44:36 +0100 Subject: [PATCH] Remove all instances of print() and related functions from Wolf nodes These had been commented out some time ago already. --- src/ceres_wrapper/ceres_manager.cpp | 2 - src/constraint_analytic.cpp | 13 ---- src/constraint_analytic.h | 2 - src/constraint_sparse.h | 35 --------- src/examples/test_autodiff.cpp | 2 - src/examples/test_ceres_2_lasers.cpp | 2 - src/examples/test_gps_wolf.cpp | 1 - src/examples/test_node_linked.cpp | 4 -- src/examples/test_virtual_hierarchy.cpp | 1 - src/node_linked.h | 94 +------------------------ src/wolf_manager.cpp | 1 - src/wolf_manager_gps.cpp | 1 - 12 files changed, 1 insertion(+), 157 deletions(-) diff --git a/src/ceres_wrapper/ceres_manager.cpp b/src/ceres_wrapper/ceres_manager.cpp index e2616867b..9395251d9 100644 --- a/src/ceres_wrapper/ceres_manager.cpp +++ b/src/ceres_wrapper/ceres_manager.cpp @@ -226,7 +226,6 @@ void CeresManager::removeConstraint(const unsigned int& _corr_id) void CeresManager::addStateBlock(StateBlock* _st_ptr) { //std::cout << "Adding State Unit with size: " << _st_ptr->getSize() << std::endl; - //_st_ptr->print(); if (_st_ptr->hasLocalParametrization()) { @@ -270,7 +269,6 @@ void CeresManager::updateStateBlockStatus(StateBlock* _st_ptr) ceres::CostFunction* CeresManager::createCostFunction(ConstraintBase* _corrPtr, const bool _self_auto_diff) { //std::cout << "adding ctr " << _corrPtr->nodeId() << std::endl; - //_corrPtr->print(); if (_corrPtr->getJacobianMethod() == ANALYTIC) return new CostFunctionWrapper((ConstraintAnalytic*)_corrPtr); diff --git a/src/constraint_analytic.cpp b/src/constraint_analytic.cpp index 511c464df..e8bf6053d 100644 --- a/src/constraint_analytic.cpp +++ b/src/constraint_analytic.cpp @@ -160,19 +160,6 @@ JacobianMethod ConstraintAnalytic::getJacobianMethod() const return ANALYTIC; } -//void ConstraintAnalytic::print(unsigned int _ntabs, std::ostream& _ost) const -//{ -// NodeLinked::printSelf(_ntabs, _ost); -// for (unsigned int ii = 0; ii<state_block_sizes_vector_.size(); ii++) -// { -// printTabs(_ntabs); -// _ost << "block " << ii << ": "; -// for (unsigned int jj = 0; jj<state_block_sizes_vector_.at(ii); jj++) -// _ost << *(state_ptr_vector_.at(ii)->getPtr()+jj) << " "; -// _ost << std::endl; -// } -//} - void ConstraintAnalytic::resizeVectors() { for (unsigned int ii = 1; ii<state_ptr_vector_.size(); ii++) diff --git a/src/constraint_analytic.h b/src/constraint_analytic.h index 5384a8324..2b6e36938 100644 --- a/src/constraint_analytic.h +++ b/src/constraint_analytic.h @@ -153,8 +153,6 @@ class ConstraintAnalytic: public ConstraintBase **/ virtual JacobianMethod getJacobianMethod() const; -// virtual void print(unsigned int _ntabs = 0, std::ostream& _ost = std::cout) const; - private: void resizeVectors(); }; diff --git a/src/constraint_sparse.h b/src/constraint_sparse.h index df2a4ec3d..5a03a341c 100644 --- a/src/constraint_sparse.h +++ b/src/constraint_sparse.h @@ -135,8 +135,6 @@ class ConstraintSparse: public ConstraintBase **/ virtual unsigned int getSize() const; -// virtual void print(unsigned int _ntabs = 0, std::ostream& _ost = std::cout) const; - private: void resizeVectors(); }; @@ -496,39 +494,6 @@ unsigned int ConstraintSparse<MEASUREMENT_SIZE, return MEASUREMENT_SIZE; } -//template <const unsigned int MEASUREMENT_SIZE, -// unsigned int BLOCK_0_SIZE, -// unsigned int BLOCK_1_SIZE, -// unsigned int BLOCK_2_SIZE, -// unsigned int BLOCK_3_SIZE, -// unsigned int BLOCK_4_SIZE, -// unsigned int BLOCK_5_SIZE, -// unsigned int BLOCK_6_SIZE, -// unsigned int BLOCK_7_SIZE, -// unsigned int BLOCK_8_SIZE, -// unsigned int BLOCK_9_SIZE> -//void ConstraintSparse<MEASUREMENT_SIZE, -// BLOCK_0_SIZE, -// BLOCK_1_SIZE, -// BLOCK_2_SIZE, -// BLOCK_3_SIZE, -// BLOCK_4_SIZE, -// BLOCK_5_SIZE, -// BLOCK_6_SIZE, -// BLOCK_7_SIZE, -// BLOCK_8_SIZE, -// BLOCK_9_SIZE>::print(unsigned int _ntabs, std::ostream& _ost) const -//{ -// NodeLinked::printSelf(_ntabs, _ost); -// for (unsigned int ii = 0; ii<state_block_sizes_vector_.size(); ii++) -// { -// printTabs(_ntabs); -// _ost << "block " << ii << ": "; -// for (unsigned int jj = 0; jj<state_block_sizes_vector_.at(ii); jj++) -// _ost << *(state_ptr_vector_.at(ii)->getPtr()+jj) << " "; -// _ost << std::endl; -// } -//} template <const unsigned int MEASUREMENT_SIZE, unsigned int BLOCK_0_SIZE, diff --git a/src/examples/test_autodiff.cpp b/src/examples/test_autodiff.cpp index 69fbaac1a..20a13307f 100644 --- a/src/examples/test_autodiff.cpp +++ b/src/examples/test_autodiff.cpp @@ -325,7 +325,6 @@ int main(int argc, char** argv) usleep(100000 - 1e6 * dt); // std::cout << "\nTree after step..." << std::endl; -// wolf_manager->getProblemPtr()->print(); } // DISPLAY RESULTS ============================================================================================ @@ -340,7 +339,6 @@ int main(int argc, char** argv) std::cout << " loop time: " << mean_times(6) << std::endl; // std::cout << "\nTree before deleting..." << std::endl; -// wolf_manager->getProblemPtr()->print(); // // Draw Final result ------------------------- // std::vector<double> landmark_vector; diff --git a/src/examples/test_ceres_2_lasers.cpp b/src/examples/test_ceres_2_lasers.cpp index e3431fd54..6f448de29 100644 --- a/src/examples/test_ceres_2_lasers.cpp +++ b/src/examples/test_ceres_2_lasers.cpp @@ -278,7 +278,6 @@ int main(int argc, char** argv) usleep(100000 - 1e6 * dt); // std::cout << "\nTree after step..." << std::endl; -// wolf_manager->getProblemPtr()->print(); } // DISPLAY RESULTS ============================================================================================ @@ -293,7 +292,6 @@ int main(int argc, char** argv) std::cout << " loop time: " << mean_times(6) << std::endl; // std::cout << "\nTree before deleting..." << std::endl; -// wolf_manager->getProblemPtr()->print(); // Draw Final result ------------------------- std::vector<double> landmark_vector; diff --git a/src/examples/test_gps_wolf.cpp b/src/examples/test_gps_wolf.cpp index a7a2232b7..06ac7d12f 100644 --- a/src/examples/test_gps_wolf.cpp +++ b/src/examples/test_gps_wolf.cpp @@ -120,7 +120,6 @@ int main(int argc, char** argv) cout << summary.FullReport() << endl; } - //wolf_manager_->getProblemPtr()->print(2); // std::cout << setprecision(12); std::cout << "\n~~~~ RESULTS ~~~~\n"; diff --git a/src/examples/test_node_linked.cpp b/src/examples/test_node_linked.cpp index 0b3341f52..5ee578afc 100644 --- a/src/examples/test_node_linked.cpp +++ b/src/examples/test_node_linked.cpp @@ -107,7 +107,6 @@ int main() MeasurementN* sensor_data_laser_(new MeasurementN(180)); MeasurementN* sensor_data_cam_2_(new MeasurementN(480)); MeasurementN* sensor_data_radar_(new MeasurementN(90)); -// trajectory_->print(); cout << "========================================================" << endl; cout << endl << "TEST 2. Build tree dependencies" << endl; @@ -117,12 +116,10 @@ int main() trajectory_->addDownNode(frame_1_); trajectory_->addDownNode(frame_2_); trajectory_->linkToUpperNode(problem_); -// trajectory_->print(); cout << "========================================================" << endl; cout << endl << "TEST 3. Modify one of the nodes (add new node), once tree has been constructed" << endl; frame_2_->addDownNode(sensor_data_radar_); -// trajectory_->print(); cout << "========================================================" << endl; cout << endl << "TEST 4. Remove nodes" << endl; @@ -132,7 +129,6 @@ int main() sensor_data_cam_1_ = nullptr; sensor_data_laser_ = nullptr;; trajectory_->removeDownNode(f1_id_); -// trajectory_->print(); cout << "========================================================" << endl; cout << endl << "TEST 5. getTop()" << endl; diff --git a/src/examples/test_virtual_hierarchy.cpp b/src/examples/test_virtual_hierarchy.cpp index 32372ee90..2d2e4848e 100644 --- a/src/examples/test_virtual_hierarchy.cpp +++ b/src/examples/test_virtual_hierarchy.cpp @@ -216,7 +216,6 @@ class CorNode : public Cor, public ChildOf<FeaNode>, public Bot//, public Explor public: CorNode(FeaNode* _fea_ptr) : ChildOf<FeaNode>(_fea_ptr) { } virtual ~CorNode() { } -// void print(); }; //class TrSNode : public virtual N //{ diff --git a/src/node_linked.h b/src/node_linked.h index fc0655be7..955265ca2 100644 --- a/src/node_linked.h +++ b/src/node_linked.h @@ -135,41 +135,9 @@ class NodeLinked : public NodeBase **/ virtual WolfProblem* getTop(); -// /** \brief Prints node information -// * -// * Prints node information. -// * \param _ntabs number of tabulations to print at the left of the printed information -// * \param _ost output stream -// * -// * Overload this function in derived classes to adapt the printed output to each object's relevant info. -// * -// */ -// virtual void print(unsigned int _ntabs = 0, std::ostream& _ost = std::cout) const; protected: -// /** \brief Prints tabulated information about this node. -// * -// * Prints information about this node. It adds a number of tabs given by _ntabs. -// *\param _ntabs the number of tabs. -// *\param _ost the stream it prints to -// * -// */ -// virtual void printSelf(unsigned int _ntabs = 0, std::ostream& _ost = std::cout) const; - -// /** \brief Prints upper node info -// * -// * Prints upper node info -// * -// **/ -// void printUpper(unsigned int _ntabs = 0, std::ostream& _ost = std::cout) const; - -// /** \brief Prints recursively lower node info -// * -// * Prints recursively lower node info -// * -// **/ -// void printLower(unsigned int _ntabs = 0, std::ostream& _ost = std::cout) const; }; ////////////////////////////////////////// @@ -346,66 +314,6 @@ WolfProblem* NodeLinked<UpperType, LowerType>::getTop() return nullptr; } -//template<class UpperType, class LowerType> -//void NodeLinked<UpperType, LowerType>::print(unsigned int _ntabs, std::ostream& _ost) const -//{ -// printSelf(_ntabs, _ost); //one line -// -// if ((location_ != TOP) && (up_node_ptr_ != nullptr)) -// { -// printUpper(_ntabs, _ost); -// } -// if (location_ != BOTTOM) -// { -// printLower(_ntabs, _ost); -// } -//} - -//template<class UpperType, class LowerType> -//void NodeLinked<UpperType, LowerType>::printSelf(unsigned int _ntabs, std::ostream& _ost) const -//{ -// printTabs(_ntabs); -// _ost << nodeLabel() << " " << nodeId() << " : "; -// switch (location_) -// { -// case TOP: -// _ost << "TOP" << std::endl; -// break; -// case MID: -// _ost << "MID" << std::endl; -// break; -// case BOTTOM: -// _ost << "BOT" << std::endl; -// break; -// default: -// _ost << "*" << std::endl; -// break; -// } -//} - -//template<class UpperType, class LowerType> -//void NodeLinked<UpperType, LowerType>::printUpper(unsigned int _ntabs, std::ostream& _ost) const -//{ -// printTabs(_ntabs); -// _ost << "\tUpper Node --> " << up_node_ptr_->nodeId() << std::endl; -//} - - -//template<class UpperType, class LowerType> -//void NodeLinked<UpperType, LowerType>::printLower(unsigned int _ntabs, std::ostream& _ost) const -//{ -// printTabs(_ntabs); -// _ost << "\tLower Nodes ==> [ "; -// for (auto const & down_node_sh_ptr : down_node_list_) -// { -// _ost << down_node_sh_ptr->nodeId() << " "; -// } -// _ost << "]" << std::endl; -// _ntabs++; -// for (auto const & down_node_ptr : down_node_list_) -// { -// down_node_ptr->print(_ntabs, _ost); -// } -//} + #endif /* NODE_LINKED_H_ */ diff --git a/src/wolf_manager.cpp b/src/wolf_manager.cpp index 650d1934a..0322bc110 100644 --- a/src/wolf_manager.cpp +++ b/src/wolf_manager.cpp @@ -116,7 +116,6 @@ void WolfManager::addCapture(CaptureBase* _capture) { new_captures_.push(_capture); //std::cout << "added new capture: " << _capture->nodeId() << " stamp: "; - //_capture->getTimeStamp().print(); //std::cout << std::endl; } diff --git a/src/wolf_manager_gps.cpp b/src/wolf_manager_gps.cpp index a7237ccde..200c528a3 100644 --- a/src/wolf_manager_gps.cpp +++ b/src/wolf_manager_gps.cpp @@ -110,7 +110,6 @@ void WolfManagerGPS::addCapture(CaptureBase* _capture) { new_captures_.push(_capture); //std::cout << "added new capture: " << _capture->nodeId() << " stamp: "; - //_capture->getTimeStamp().print(); //std::cout << std::endl; } -- GitLab