1 #include "header/prints.h" 3 int PRT::printRotMatrix_tf(tf::Transform transform){
5 std::cout <<
"\n\n"<< transform.getBasis().getColumn(0).getX() <<
"\t" 6 << transform.getBasis().getColumn(1).getX() <<
"\t" 7 << transform.getBasis().getColumn(2).getX() <<
"\n" 8 << transform.getBasis().getColumn(0).getY() <<
"\t" 9 << transform.getBasis().getColumn(1).getY() <<
"\t" 10 << transform.getBasis().getColumn(2).getY() <<
"\n" 11 << transform.getBasis().getColumn(0).getZ() <<
"\t" 12 << transform.getBasis().getColumn(1).getZ() <<
"\t" 13 << transform.getBasis().getColumn(2).getZ() <<
"\n\n";
18 int PRT::printMatrix3x3_tf(tf::Matrix3x3 matrix){
20 std::cout <<
"\n\n"<< matrix.getColumn(0).getX() <<
"\t" 21 << matrix.getColumn(1).getX() <<
"\t" 22 << matrix.getColumn(2).getX() <<
"\n" 23 << matrix.getColumn(0).getY() <<
"\t" 24 << matrix.getColumn(1).getY() <<
"\t" 25 << matrix.getColumn(2).getY() <<
"\n" 26 << matrix.getColumn(0).getZ() <<
"\t" 27 << matrix.getColumn(1).getZ() <<
"\t" 28 << matrix.getColumn(2).getZ() <<
"\n\n";
34 int PRT::createDirectory(std::string pathDirectory) {
36 boost::filesystem::path path(pathDirectory);
37 if(boost::filesystem::create_directories(path)){
38 std::cout <<
"[PRT] folder created : " << path <<
"\n";
42 int PRT::matrixCmat2file(std::string pathName, CMAT::Matrix mat){
44 file.open(pathName, std::ios_base::app);
46 for (
int j=1; j<=mat.GetNumRows(); ++j){
48 for (
int i = 1; i<=mat.GetNumColumns(); ++i){
49 file << mat(j,i) <<
" ";
58 int PRT::matrixEigen2file(std::string pathName, Eigen::MatrixXd mat){
60 file.open(pathName, std::ios_base::app);
62 for (
int j=0; j<mat.rows(); ++j){
64 for (
int i = 0; i<mat.cols(); ++i){
65 file << mat(j,i) <<
" ";
77 int PRT::vectorStd2file(std::string path, std::vector<double> vect){
80 file.open(path, std::ios_base::app);
82 for(
int i=0; i<vect.size(); i++){
83 file << vect.at(i) << std::endl;
93 void PRT::double2file(std::string path,
double scalar){
95 file.open(path, std::ios_base::app);
97 file << scalar << std::endl;
106 std::string PRT::getCurrentDateFormatted() {
107 std::time_t t = std::time(NULL);
109 std::strftime(mbstr,
sizeof(mbstr),
"%Y-%m-%d_%H-%M-%S", std::localtime(&t));
110 std::string currentDate(mbstr);