From b0e859486bf5f7263e2e412a7832001999b5f1e3 Mon Sep 17 00:00:00 2001 From: Hyon Lim Date: Fri, 19 Dec 2014 11:53:56 +0900 Subject: [PATCH] I suggest to use stderr as debugging output. It's because some useful softwares are utilziing stdio as pipelined I/O. --- include/config/debug.hpp | 2 +- src/helpers/stereo_homography.cpp | 2 +- src/visensor_impl.cpp | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/include/config/debug.hpp b/include/config/debug.hpp index 93beb6a..5a11913 100644 --- a/include/config/debug.hpp +++ b/include/config/debug.hpp @@ -48,7 +48,7 @@ struct Sink { template Sink(Args const& ... ) {} }; #if DEBUG_TEST #define VISENSOR_DEBUG(...) \ - do { printf("[libvisensor]: "); printf(__VA_ARGS__); } while (0) + do { fprintf(stderr,"[libvisensor]: "); fprintf(stderr,__VA_ARGS__); } while (0) #else #define VISENSOR_DEBUG(...) Sink { __VA_ARGS__ } #endif diff --git a/src/helpers/stereo_homography.cpp b/src/helpers/stereo_homography.cpp index a4e821a..06089d5 100644 --- a/src/helpers/stereo_homography.cpp +++ b/src/helpers/stereo_homography.cpp @@ -145,7 +145,7 @@ void StereoHomography::getHomography(Eigen::Matrix3d& H0, Eigen::Matrix3d& H1, d Eigen::Matrix4d T_rel = Eigen::Matrix4d::Zero(); T_rel = T1 * T0.inverse(); - std::cout << "T_rel " << T_rel << std::endl; + std::cerr << "T_rel " << T_rel << std::endl; Eigen::Matrix3d R = T_rel.block<3, 3>(0, 0); Eigen::Vector3d T = T_rel.block<3, 1>(0, 3); diff --git a/src/visensor_impl.cpp b/src/visensor_impl.cpp index 86a502d..5e05f48 100644 --- a/src/visensor_impl.cpp +++ b/src/visensor_impl.cpp @@ -108,7 +108,7 @@ void ViSensorDriver::Impl::init(std::string hostname) { setCameraCalibrationSlot(0); } catch (visensor::exceptions const &ex) { -// std::cout << ex.what() << "\n"; + std::cerr << ex.what() << "\n"; } //flip images if necessary