Skip to content

Commit

Permalink
More "code cleaning" in Difodo class and apps
Browse files Browse the repository at this point in the history
  • Loading branch information
MarianoJT88 committed Jan 21, 2014
1 parent 075a21b commit 7dc0a97
Show file tree
Hide file tree
Showing 5 changed files with 4 additions and 15 deletions.
4 changes: 0 additions & 4 deletions apps/DifOdometry-Camera/DifOdometry_Camera.cpp
Expand Up @@ -147,9 +147,6 @@ void CDifodoCamera::loadFrame()
const openni::DepthPixel* pDepthRow = (const openni::DepthPixel*)framed.getData();
int rowSize = framed.getStrideInBytes() / sizeof(openni::DepthPixel);

//float x, y, z;
//const float inv_f = float(640/width)/525.0f; //********************mirar esto**********************

for (int yc = height-1; yc >= 0; --yc)
{
const openni::DepthPixel* pDepth = pDepthRow;
Expand Down Expand Up @@ -284,7 +281,6 @@ void CDifodoCamera::initializeScene()
//User-interface information
utils::CImage img_legend;
img_legend.loadFromXPM(legend_xpm);
//img_legend.loadFromFile("C:/Users/Mariano/Desktop/legend.jpg");
COpenGLViewportPtr legend = scene->createViewport("legend");
legend->setViewportPosition(20, 20, 348, 200);
legend->setImageView(img_legend);
Expand Down
1 change: 0 additions & 1 deletion apps/DifOdometry-Camera/DifOdometry_Camera_main.cpp
Expand Up @@ -137,7 +137,6 @@ int main(int num_arg, char *argv[])
odo.filterSpeedAndPoseUpdate();
cout << endl << "Difodo execution time(ms): " << odo.execution_time;
odo.updateScene();

break;

//Start and stop continous odometry
Expand Down
9 changes: 1 addition & 8 deletions apps/DifOdometry-Datasets/DifOdometry_Datasets.cpp
Expand Up @@ -8,8 +8,6 @@
+---------------------------------------------------------------------------+ */

#include "DifOdometry_Datasets.h"
#include <mrpt/opengl.h>
#include <mrpt/gui.h>

using namespace mrpt;
using namespace mrpt::opengl;
Expand Down Expand Up @@ -50,7 +48,6 @@ void CDifodoDatasets::loadConfiguration(const utils::CConfigFileBase &ini )
if (f_gt.fail())
throw std::runtime_error("\nError finding the groundtruth file: it should be contained in the same folder than the rawlog file");


char aux[100];
f_gt.getline(aux, 100);
f_gt.getline(aux, 100);
Expand Down Expand Up @@ -94,7 +91,7 @@ void CDifodoDatasets::loadConfiguration(const utils::CConfigFileBase &ini )
const int dz = floor(float(resv)/float(rows));
const int dy = floor(float(resh)/float(cols));

duv_threshold = 0.001*(dz + dy)*(cam_mode*downsample); //Faster with cam_mode=4, the filter should be adjusted if it changes
duv_threshold = 0.001*(dz + dy)*(cam_mode*downsample);
dt_threshold = 0.2*fps;
dif_threshold = 0.001*(dz + dy)*(cam_mode*downsample);
difuv_surroundings = 0.005*(dz + dy)*(cam_mode*downsample);
Expand Down Expand Up @@ -241,7 +238,6 @@ void CDifodoDatasets::initializeScene()
//User-interface information
utils::CImage img_legend;
img_legend.loadFromXPM(legend_xpm);
//img_legend.loadFromFile("C:/Users/Mariano/Desktop/legend.jpg");
COpenGLViewportPtr legend = scene->createViewport("legend");
legend->setViewportPosition(20, 20, 348, 200);
legend->setImageView(img_legend);
Expand Down Expand Up @@ -635,11 +631,8 @@ void CDifodoDatasets::writeToLogFile()

f_res << abs_error_tras << " ";
f_res << abs_error_rot << " ";

f_res << execution_time << " ";

f_res << num_valid_points << " ";

f_res << "\n";
}

Expand Down
2 changes: 1 addition & 1 deletion apps/DifOdometry-Datasets/DifOdometry_Datasets.h
Expand Up @@ -14,7 +14,7 @@
#include <mrpt/slam/CRawlog.h>
#include <mrpt/slam/CObservation3DRangeScan.h>
#include <mrpt/opengl.h>
#include <mrpt/gui/CDisplayWindow3D.h>
#include <mrpt/gui.h>
#include <iostream>
#include "legend.xpm"

Expand Down
3 changes: 2 additions & 1 deletion libs/vision/src/CDifodo.cpp
Expand Up @@ -227,7 +227,7 @@ void CDifodo::filterAndDownsample()
yy(y,x) = (iniy+y*dy - disp_y)*depth_wf(iniy+y*dy,inix+x*dx)*inv_f;
}

//cout << endl << "Tiempo del filtro + downsample (ms): " << 1000*clock.Tac();
//cout << endl << "Execution time - filter + downsample (ms): " << 1000*clock.Tac();
}

void CDifodo::findBorders()
Expand Down Expand Up @@ -324,6 +324,7 @@ void CDifodo::findValidPoints()
num_valid_points++;
}


void CDifodo::solveDepthSystem()
{
utils::CTicTac clock;
Expand Down

0 comments on commit 7dc0a97

Please sign in to comment.