[Jderobot-admin] jderobot-r887 - trunk/src/components/openniServer

frivas en jderobot.org frivas en jderobot.org
Jue Mar 14 16:58:14 CET 2013


Author: frivas
Date: 2013-03-14 16:57:14 +0100 (Thu, 14 Mar 2013)
New Revision: 887

Modified:
   trunk/src/components/openniServer/CMakeLists.txt
   trunk/src/components/openniServer/myprogeo.cpp
   trunk/src/components/openniServer/myprogeo.h
Log:
a?\195?\177adida ultima version myprogeo y actualizado el cmakelist


Modified: trunk/src/components/openniServer/CMakeLists.txt
===================================================================
--- trunk/src/components/openniServer/CMakeLists.txt	2013-03-13 08:15:52 UTC (rev 886)
+++ trunk/src/components/openniServer/CMakeLists.txt	2013-03-14 15:57:14 UTC (rev 887)
@@ -3,7 +3,7 @@
 	    SET( SOURCE_FILES openniServer.cpp myprogeo.cpp )
 	    add_definitions(-DGLADE_DIR="${gladedir}")
 
-	    set( CMAKE_CXX_FLAGS "-Wno-deprecated -lgsl -lgslcblas" ) # Opciones para el compilador-lgsl -lgslcblas -lGL -lGLU -lglut -lgazebo
+	    set( CMAKE_CXX_FLAGS "-Wno-deprecated" ) # Opciones para el compilador-lgsl -lgslcblas -lGL -lGLU -lglut -lgazebo
 
 	    include_directories(
             ${INTERFACES_CPP_DIR}
@@ -25,7 +25,8 @@
             ${INTERFACES_CPP_DIR}/jderobot/libJderobotInterfaces.so
             ${Gearbox_LIBRARIES}
 	        ${ZeroCIce_LIBRARIES}
-	        ${OpenNi_LIBRARY}
+	        ${openni_LIBRARIES}
+			${nite_LIBRARIES}
 	        ${pcl_LIBRARIES}
             ${opencv_LIBRARIES}
             ${gsl_LIBRARIES}

Modified: trunk/src/components/openniServer/myprogeo.cpp
===================================================================
--- trunk/src/components/openniServer/myprogeo.cpp	2013-03-13 08:15:52 UTC (rev 886)
+++ trunk/src/components/openniServer/myprogeo.cpp	2013-03-14 15:57:14 UTC (rev 887)
@@ -139,12 +139,30 @@
 }
 
 /* gets the calibration of the camera from a file */
-void myprogeo::load_cam(char *fich_in,int cam)
+void myprogeo::load_cam(char *fich_in,int cam, int w, int h)
 {
   FILE *entrada;
   int i;
+	if (strlen(fich_in) ==0 ){
+		std::cout << w << ", " << h << std::endl;
+		this->cameras[cam].fdistx=515;
+		this->cameras[cam].fdisty=515;
+		this->cameras[cam].u0=h/2;
+		this->cameras[cam].v0=w/2;
+		this->cameras[cam].position.X=0;
+		this->cameras[cam].position.Y=0;
+		this->cameras[cam].position.Z=0;
+		this->cameras[cam].foa.X=0;
+		this->cameras[cam].foa.Y=1;
+		this->cameras[cam].foa.Z=0;
+		update_camera_matrix(&cameras[cam]);
 
-	xmlReader(&(this->cameras[cam]), fich_in);
+		
+	}
+	else{
+		xmlReader(&(this->cameras[cam]), fich_in);
+		update_camera_matrix(&cameras[cam]);
+	}
 	/*this->cameras[cam].position.H=1;
 	this->cameras[cam].foa.H=1;*/
 
@@ -156,7 +174,7 @@
      do{i=load_cam_line(entrada,cam);}while(i!=EOF);
      fclose(entrada);
    } */
-  update_camera_matrix(&cameras[cam]);
+  
   display_camerainfo(cameras[cam]);
 }
 

Modified: trunk/src/components/openniServer/myprogeo.h
===================================================================
--- trunk/src/components/openniServer/myprogeo.h	2013-03-13 08:15:52 UTC (rev 886)
+++ trunk/src/components/openniServer/myprogeo.h	2013-03-14 15:57:14 UTC (rev 887)
@@ -45,7 +45,7 @@
 	myprogeo();
 	~myprogeo();
 	int load_cam_line(FILE *myfile,int cam);
-	void load_cam(char *fich_in,int cam);
+	void load_cam(char *fich_in,int cam, int w, int h);
 	void mybackproject(float x, float y, float* xp, float* yp, float* zp, float* camx, float* camy, float* camz, int cam);
 	void myproject(float x, float y, float z, float* xp, float* yp, int cam);
 	void mygetcameraposition(float *x, float *y, float *z, int cam);



More information about the Jderobot-admin mailing list