[Jderobot-admin] jderobot-r919 - in trunk: . src/components src/components/kinectViewer src/components/kinectViewer/build-independent src/components/replayController src/components/replayController/build src/components/replayController/build-independent src/libs/parallelIce

frivas en jderobot.org frivas en jderobot.org
Lun Mayo 27 17:21:58 CEST 2013


Author: frivas
Date: 2013-05-27 17:20:58 +0200 (Mon, 27 May 2013)
New Revision: 919

Added:
   trunk/src/components/replayController/
   trunk/src/components/replayController/CMakeLists.txt
   trunk/src/components/replayController/build-independent/
   trunk/src/components/replayController/build-independent/CMakeLists.txt
   trunk/src/components/replayController/build/
   trunk/src/components/replayController/build/CMakeLists.txt
   trunk/src/components/replayController/build/cmake_uninstall.cmake.in
   trunk/src/components/replayController/replayController.cfg
   trunk/src/components/replayController/replayController.cpp
   trunk/src/components/replayController/replayControllerGui.cpp
   trunk/src/components/replayController/replayControllerGui.glade
   trunk/src/components/replayController/replayControllerGui.h
Removed:
   trunk/src/components/kinectViewer/controllers/
   trunk/src/components/kinectViewer/gui-modules/
Modified:
   trunk/CMakeLists.txt
   trunk/src/components/kinectViewer/CMakeLists.txt
   trunk/src/components/kinectViewer/build-independent/CMakeLists.txt
   trunk/src/components/kinectViewer/drawarea.cpp
   trunk/src/components/kinectViewer/kinectViewer.cpp
   trunk/src/components/kinectViewer/kinectViewergui.cpp
   trunk/src/components/kinectViewer/kinectViewergui.h
   trunk/src/components/kinectViewer/myprogeo.cpp
   trunk/src/components/kinectViewer/myprogeo.h
   trunk/src/components/kinectViewer/util3d.cpp
   trunk/src/components/kinectViewer/util3d.h
   trunk/src/libs/parallelIce/CMakeLists.txt
Log:
a?\195?\177adido componente replayController y subida la ultima version de kinectViewer con parallelIce


Modified: trunk/CMakeLists.txt
===================================================================
--- trunk/CMakeLists.txt	2013-05-27 14:54:12 UTC (rev 918)
+++ trunk/CMakeLists.txt	2013-05-27 15:20:58 UTC (rev 919)
@@ -8,7 +8,7 @@
 SET( INTERFACES_CPP_DIR ${CMAKE_CURRENT_SOURCE_DIR}/src/interfaces/cpp) # Directorio con las interfaces ICE en C++
 SET( LIBS_DIR ${CMAKE_CURRENT_SOURCE_DIR}/src/libs) # Directorio donde se encuentran las librerias propias de jderobot
 SET( SLICE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/src/interfaces/slice) # Directorio donde se encuentran las interfaces ICE
-SET( LIBS_NEEDED   bgfgsegmentation jderobotice colorspaces jderobotutil progeo pioneer fuzzylib visionlib paralellIce ) # Librerias de las que depende el componente
+SET( LIBS_NEEDED   bgfgsegmentation jderobotice colorspaces jderobotutil progeo pioneer fuzzylib visionlib parallelIce ) # Librerias de las que depende el componente
 
 SET( DEPS_DIR ${CMAKE_CURRENT_SOURCE_DIR}/Deps) # Directorio donde se encuentran las dependencias
 SET( COMPONENTS calibrator  calibratorKinect openniServer-kinect naooperator         basic_component		         
@@ -17,7 +17,7 @@
 		cameraview			recorder
 		cameraview_icestorm  kinectViewer        replayer
 		wiimoteClient
-		wiimoteServer       colortuner openniServer
+		wiimoteServer       colortuner openniServer replayController
 		
 ) #Componentes que forman JDErobot
 

Modified: trunk/src/components/kinectViewer/CMakeLists.txt
===================================================================
--- trunk/src/components/kinectViewer/CMakeLists.txt	2013-05-27 14:54:12 UTC (rev 918)
+++ trunk/src/components/kinectViewer/CMakeLists.txt	2013-05-27 15:20:58 UTC (rev 919)
@@ -1,4 +1,4 @@
-SET(SOURCE_FILES kinectViewer.cpp drawarea.cpp kinectViewergui.cpp myprogeo.cpp util3d.cpp controllers/leds-controller.cpp controllers/pointCloud-controller.cpp controllers/Pose3DMotors-controller.cpp gui-modules/ledsGui.cpp gui-modules/Pose3DMotorsGui.cpp)
+SET(SOURCE_FILES kinectViewer.cpp drawarea.cpp kinectViewergui.cpp myprogeo.cpp util3d.cpp)
 
 add_definitions(-DGLADE_DIR="${gladedir}")
 
@@ -26,5 +26,6 @@
     ${LIBS_DIR}/jderobotutil/libjderobotutil.so
     ${LIBS_DIR}/progeo/libprogeo.so
     ${LIBS_DIR}/pioneer/libpioneer.so
+    ${LIBS_DIR}/parallelIce/libparallelIce.so
     ${ZeroCIce_LIBRARIES}
 )

Modified: trunk/src/components/kinectViewer/build-independent/CMakeLists.txt
===================================================================
--- trunk/src/components/kinectViewer/build-independent/CMakeLists.txt	2013-05-27 14:54:12 UTC (rev 918)
+++ trunk/src/components/kinectViewer/build-independent/CMakeLists.txt	2013-05-27 15:20:58 UTC (rev 919)
@@ -1,5 +1,5 @@
  cmake_minimum_required(VERSION 2.8)
-SET( SOURCE_FILES ../kinectViewer.cpp ../drawarea.cpp ../kinectViewergui.cpp ../myprogeo.cpp ../util3d.cpp ../controllers/leds-controller.cpp ../controllers/pointCloud-controller.cpp ../controllers/Pose3DMotors-controller.cpp ../gui-modules/ledsGui.cpp ../gui-modules/Pose3DMotorsGui.cpp)
+SET( SOURCE_FILES ../kinectViewer.cpp ../drawarea.cpp ../kinectViewergui.cpp ../myprogeo.cpp ../util3d.cpp )
 SET( LIBS_DIR /usr/local/lib/jderobot/)
 
 
@@ -73,4 +73,5 @@
   ${LIBS_DIR}/libjderobotice.so
   ${LIBS_DIR}/libjderobotutil.so
   ${LIBS_DIR}/libprogeo.so
+  ${LIBS_DIR}/libparallelIce.so
 )

Modified: trunk/src/components/kinectViewer/drawarea.cpp
===================================================================
--- trunk/src/components/kinectViewer/drawarea.cpp	2013-05-27 14:54:12 UTC (rev 918)
+++ trunk/src/components/kinectViewer/drawarea.cpp	2013-05-27 15:20:58 UTC (rev 919)
@@ -190,6 +190,7 @@
 	}
 
 	bool DrawArea::on_expose_event(GdkEventExpose* event) {
+		return true;
 	}
 
 	bool DrawArea::my_expose_event(){
@@ -443,6 +444,7 @@
 
 		old_x=x;
 		old_y=y;
+		return true;
 	}
 
 	bool DrawArea::on_drawarea_scroll(GdkEventScroll * event) {
@@ -471,6 +473,7 @@
 			this->glcam_pos.Y = this->glcam_pos.Y - vy;
 			this->glcam_pos.Z = this->glcam_pos.Z - vz;
 		}
+		return true;
 	}
 
 int

Modified: trunk/src/components/kinectViewer/kinectViewer.cpp
===================================================================
--- trunk/src/components/kinectViewer/kinectViewer.cpp	2013-05-27 14:54:12 UTC (rev 918)
+++ trunk/src/components/kinectViewer/kinectViewer.cpp	2013-05-27 15:20:58 UTC (rev 919)
@@ -1,5 +1,5 @@
 /*
- *  Copyright (C) 1997-2010 JDE Developers TeamkinectViewer.camRGB
+ *  Copyright (C) 1997-2013 JDE Developers TeamkinectViewer.camRGB
  *
  *  This program is free software: you can redistribute it and/or modify
  *  it under the terms of the GNU General Public License as published by
@@ -14,106 +14,84 @@
  *  You should have received a copy of the GNU General Public License
  *  along with this program.  If not, see http://www.gnu.org/licenses/.
  *
- *  Authors : Jose María Cañas <jmplaza en gsyc.es>
-			Francisco Miguel Rivas Montero <fm.rivas en alumnos.urjc.es>
-			
- */
+ *  Author : Jose María Cañas <jmplaza en gsyc.es>
+			Francisco Miguel Rivas Montero <franciscomiguel.rivas en urjc.es>
 
-/** \file kinectViewer.cpp
- * \brief kinectViewer component master file
  */
 
-/**
-   \mainpage kinectViewer teleoperador JDE Component 5.0 for humanoid robots
-   \author Francisco Miguel Rivas Montero
-   \author Jose Maria Cañas Plaza
-   \date 2010, December
-	\version 5.0
 
-   \par Readme:
-	JDE-5.0 and Naobody component are nedeed to run this component
 
-   \htmlonly
-   <marquee scrollamount="5" scrolldelay="25"><font color=red>
-    kinectViewer.</font></marquee>
-   \endhtmlonly
-   </ul>
-*/
 
 
-
-
-
-
 #include <iostream>
 #include <Ice/Ice.h>
 #include <IceUtil/IceUtil.h>
-#include <jderobot/camera.h>
-#include <jderobot/kinectleds.h>
 #include <jderobot/pointcloud.h>
-#include <colorspaces/colorspacesmm.h>
 #include "kinectViewergui.h"
 #include "pthread.h"
-#include "controllers/Pose3DMotors-controller.h"
-#include "controllers/leds-controller.h"
+#include "parallelIce/cameraClient.h"
+#include "parallelIce/pointcloudClient.h"
 
 
 
 #define MAX_COMPONENTS 20	
 
 kinectViewer::kinectViewergui* kinectViewergui_ptx;
-Ice::ObjectPrx baseCameraRGB;
-Ice::ObjectPrx baseCameraDEPTH;
-jderobot::CameraPrx cDEPTHprx;
-jderobot::CameraPrx cRGBprx;
 
+jderobot::cameraClient* camRGB=NULL;
+jderobot::cameraClient* camDEPTH=NULL;
+jderobot::pointcloudClient* pcClient=NULL;
 
-/**
- * \brief Thread that performs the camera upgrade
- * \param arg: variable where any needed argument can be set (not used).
- */
-void *camera_server(void* arg){
-	int camRGB=0;
-	int camDEPTH=0;
+
+
+
+void *gui_thread(void* arg){
 	try{
+		//local data
+		std::vector<jderobot::RGBPoint> cloud;
+		cv::Mat rgb,depth;
+
+		struct timeval post;
+		long long int totalpre=0;
+		long long int totalpost=0;
+
+		//std::cout << "******************************** entro" << std::endl;
 		while(kinectViewergui_ptx->isVisible() && ! kinectViewergui_ptx->isClosed()){
-			jderobot::ImageDataPtr dataRGB;
-			jderobot::ImageDataPtr dataDEPTH;
-			colorspaces::Image::FormatPtr fmtRGB;
-			colorspaces::Image::FormatPtr fmtDEPTH;
-			if (0!=cRGBprx){
-				camRGB=1;
-				dataRGB = cRGBprx->getImageData();
-				fmtRGB = colorspaces::Image::Format::searchFormat(dataRGB->description->format);
-				if (!fmtRGB)
-					throw "Format not supported";
-			}
-			if (0!=cDEPTHprx){
-				camDEPTH=1;
-				dataDEPTH = cDEPTHprx->getImageData();
-				fmtDEPTH = colorspaces::Image::Format::searchFormat(dataDEPTH->description->format);
-				if (!fmtDEPTH)
-					throw "Format not supported";
-			}
+			//std::cout << "******************************** entro1" << std::endl;
+			gettimeofday(&post,NULL);
+			totalpost=post.tv_sec*1000000+post.tv_usec;
 
+			if (camRGB!=NULL)
+				rgb=camRGB->getImage();
+			if (camDEPTH!=NULL)
+				depth=camDEPTH->getImage();
+			if (pcClient!=NULL)
+				cloud=pcClient->getData();
 
-			if ((camRGB)&&(camDEPTH)){
-				colorspaces::Image imageRGB(dataRGB->description->width,dataRGB->description->height,fmtRGB,&(dataRGB->pixelData[0]));
-				colorspaces::Image imageDEPTH(dataDEPTH->description->width,dataDEPTH->description->height,fmtDEPTH,&(dataDEPTH->pixelData[0]));
-				kinectViewergui_ptx->updateAll(imageRGB,imageDEPTH);
+
+			if ((rgb.rows!=0)&&(depth.rows!=0)){
+				kinectViewergui_ptx->updateAll(rgb,depth, cloud);
 			}
-			else if (camRGB){
-				colorspaces::Image imageRGB(dataRGB->description->width,dataRGB->description->height,fmtRGB,&(dataRGB->pixelData[0]));
-				kinectViewergui_ptx->updateRGB(imageRGB);
+			else if (rgb.rows!=0){
+				kinectViewergui_ptx->updateRGB(rgb);
 			}
-			else if (camDEPTH){
-				colorspaces::Image imageDEPTH(dataDEPTH->description->width,dataDEPTH->description->height,fmtDEPTH,&(dataDEPTH->pixelData[0]));
-				kinectViewergui_ptx->updateDEPTH(imageDEPTH);
+			else if (depth.rows!=0){
+				kinectViewergui_ptx->updateDEPTH(depth);
 			}
 			else{	
-				kinectViewergui_ptx->updatePointCloud();
+				kinectViewergui_ptx->updatePointCloud(cloud);
 			}
-			usleep(1000);
+			if (totalpre !=0){
+				if ((totalpost - totalpre) > kinectViewergui_ptx->getCycle() ){
+					std::cout<<"-------- kinectViewer: timeout-" << std::endl;
+				}
+				else{
+					usleep(kinectViewergui_ptx->getCycle() - (totalpost - totalpre));
+				}
+			}
+			totalpre=totalpost;
+
+
 		}
 	}catch (const Ice::Exception& ex) {
 		std::cerr << ex << std::endl;
@@ -136,19 +114,16 @@
 	pthread_t threads[MAX_COMPONENTS];
 	pthread_attr_t attr;
 	Ice::PropertiesPtr prop;
-	int camera_active=0;
-	jderobot::Pose3DMotorsPrx mprx;
-	jderobot::KinectLedsPrx lprx;
-	jderobot::pointCloudPrx pointCloudprx;
-	std::string path;
-	kinectViewerController::Pose3DMotorsController *Pose3DMotors_ctr=NULL;
-	kinectViewerController::LedsController *leds_ctr=NULL;
-	kinectViewerController::PointCloudController *pointCloud_ctr=NULL;
-	int rgbCamSelected=0;
-	int depthCamSelected=0;
-	int globalWidth=0;
-	int globalHeight=0;
+	bool create_gui=false;
 
+
+
+	bool rgbCamSelected=false;
+	bool depthCamSelected=false;
+	bool pointCloudSelected=false;
+	int globalWidth;
+	int globalHeight;
+
 	
 
 	pthread_attr_init(&attr);
@@ -165,153 +140,63 @@
 		return 1;
 	}
 	if (prop->getPropertyAsIntWithDefault("kinectViewer.CameraRGBActive",0)){
-		try{
-			baseCameraRGB = ic->propertyToProxy("kinectViewer.CameraRGB.Proxy");
-			if (0==baseCameraRGB){
-				throw "kinectViewer: Could not create proxy with Camera";
-			}
-			else {
-				cRGBprx= jderobot::CameraPrx::checkedCast(baseCameraRGB);
-				if (0==cRGBprx)
-					throw "Invalid proxy kinectViewer.CameraRGB.Proxy";
-				camera_active=1;
-				rgbCamSelected=1;
-			}
-		}catch (const Ice::Exception& ex) {
-			std::cerr << ex << std::endl;
-			status = 1;
+		camRGB = new jderobot::cameraClient(ic,"kinectViewer.CameraRGB.");
+		if (camRGB != NULL){
+			rgbCamSelected=true;
+			camRGB->start();
+			create_gui=true;
 		}
-		catch (const char* msg) {
-			std::cerr << msg << std::endl;
-			std::cout << "kinectViewer: Not camera provided" << std::endl;
-			status = 1;
-		}
+
 	}
 	if (prop->getPropertyAsIntWithDefault("kinectViewer.CameraDEPTHActive",0)){
-		try{
-			baseCameraDEPTH = ic->propertyToProxy("kinectViewer.CameraDEPTH.Proxy");
-			if (0==baseCameraDEPTH){
-				throw "kinectViewer: Could not create proxy with Camera";
-			}
-			else {
-				cDEPTHprx = jderobot::CameraPrx::checkedCast(baseCameraDEPTH);
-				if (0==cDEPTHprx)
-					throw "Invalid proxy kinectViewer.CameraDEPTH.Proxy";
-				camera_active=1;
-				depthCamSelected=1;
-			}
-		}catch (const Ice::Exception& ex) {
-			std::cerr << ex << std::endl;
-			status = 1;
+		camDEPTH = new jderobot::cameraClient(ic,"kinectViewer.CameraDEPTH.");
+		if (camDEPTH != NULL){
+			depthCamSelected=true;
+			camDEPTH->start();
+			create_gui=true;
 		}
-		catch (const char* msg) {
-			std::cerr << msg << std::endl;
-			std::cout << "kinectViewer: Not camera provided" << std::endl;
-			status = 1;
-		}
 	}
 
+
 	if (prop->getPropertyAsIntWithDefault("kinectViewer.pointCloudActive",0)){
-		try{
-			Ice::ObjectPrx basePointCloud = ic->propertyToProxy("kinectViewer.pointCloud.Proxy");
-			if (0==basePointCloud){
-				throw "kinectViewer: Could not create proxy with Camera";
-			}
-			else {
-				pointCloudprx = jderobot::pointCloudPrx::checkedCast(basePointCloud);
-				if (0==pointCloudprx)
-					throw "Invalid proxy kinectViewer.pointCloud.Proxy";
-				camera_active=1;
-				pointCloud_ctr = new kinectViewerController::PointCloudController(pointCloudprx);
-			}
-		}catch (const Ice::Exception& ex) {
-			std::cerr << ex << std::endl;
-			status = 1;
+		pcClient = new jderobot::pointcloudClient(ic,"kinectViewer.pointCloud.");
+		if (pcClient!= NULL){
+			pcClient->start();
+			pointCloudSelected=true;
+			create_gui=true;
 		}
-		catch (const char* msg) {
-			std::cerr << msg << std::endl;
-			std::cout << "kinectViewer: Not camera provided" << std::endl;
-			status = 1;
-		}
 	}
 
-	if (prop->getPropertyAsIntWithDefault("kinectViewer.Pose3DMotorsActive",0)){
-		try{
-			/*Contact to Pose3DMotors proxy */
-		    Ice::ObjectPrx basePose3DMotors = ic->propertyToProxy("kinectViewer.Pose3DMotors.Proxy");
-		    if (0==basePose3DMotors)
-				throw "kinectViewer: Could not create proxy with Pose3DMotors";
-		    /*cast to Pose3DMotorsPrx*/
-		    mprx = jderobot::Pose3DMotorsPrx::checkedCast(basePose3DMotors);
-		    if (0==mprx)
-				throw "kinectViewer: Invalid proxy kinectViewer.Pose3DMotors.Proxy";
-			/*creating all the devices controllers*/
-			Pose3DMotors_ctr = new kinectViewerController::Pose3DMotorsController(mprx);
-		}catch (const Ice::Exception& ex) {
-			std::cerr << ex << std::endl;
-			return 1;
-		}
-		catch (const char* msg) {
-			std::cerr << msg << std::endl;
-			return 1;
-		}
-	}
-	if (prop->getPropertyAsIntWithDefault("kinectViewer.KinectLedsActive",0)){
-		try{
-			/*Contact to KinectLeds proxy */
-		    Ice::ObjectPrx baseKinectLeds = ic->propertyToProxy("kinectViewer.KinectLeds.Proxy");
-		    if (0==baseKinectLeds)
-				throw "kinectViewer: Could not create proxy with KinectLeds";
-		    /*cast to KinectLedsPrx*/
-		    lprx = jderobot::KinectLedsPrx::checkedCast(baseKinectLeds);
-		    if (0==lprx)
-				throw "kinectViewer: Invalid proxy kinectViewer.KinectLeds.Proxy";
-			/*creating all the devices controllers*/
-			leds_ctr = new kinectViewerController::LedsController(lprx);
-		}catch (const Ice::Exception& ex) {
-			std::cerr << ex << std::endl;
-			return 1;
-		}
-		catch (const char* msg) {
-			std::cerr << msg << std::endl;
-			return 1;
-		}
-	}
-	if ((rgbCamSelected)&&(depthCamSelected)){
-		if ((cRGBprx->getImageData()->description->width!=cDEPTHprx->getImageData()->description->width)||(cRGBprx->getImageData()->description->height!=cDEPTHprx->getImageData()->description->height)){
-			throw "kinectViewer: DEPTH and RGB images are not compatibles";
-		}
-		else{
-			globalWidth=cRGBprx->getImageData()->description->width;
-			globalHeight=cRGBprx->getImageData()->description->height;
-		}
-	}
-	else if (rgbCamSelected){
-		globalWidth=cRGBprx->getImageData()->description->width;
-		globalHeight=cRGBprx->getImageData()->description->height;
-	}
-	else if (depthCamSelected){
-		globalWidth=cDEPTHprx->getImageData()->description->width;
-		globalHeight=cDEPTHprx->getImageData()->description->height;
-	}
-	else{
-		globalWidth=0;
-		globalHeight=0;
-	}
+	globalHeight=prop->getPropertyAsIntWithDefault("kinectViewer.Height",240);
+	globalWidth=prop->getPropertyAsIntWithDefault("kinectViewer.Width",320);
+	int fps=prop->getPropertyAsIntWithDefault("kinectViewer.Fps",10);
+	float cycle=(float)(1/(float)fps)*1000000;
 
 
+	std::cout << rgbCamSelected <<", " << depthCamSelected << ", " << pointCloudSelected << std::endl;
 
-	kinectViewergui_ptx = new kinectViewer::kinectViewergui(cRGBprx,cDEPTHprx, pointCloud_ctr ,Pose3DMotors_ctr, leds_ctr, prop->getProperty("kinectViewer.WorldFile"), prop->getProperty("kinectViewer.camRGB"), prop->getProperty("kinectViewer.camIR"),globalWidth,globalHeight);
+	kinectViewergui_ptx = new kinectViewer::kinectViewergui(rgbCamSelected,depthCamSelected, pointCloudSelected, prop->getProperty("kinectViewer.WorldFile"), prop->getProperty("kinectViewer.camRGB"), prop->getProperty("kinectViewer.camIR"),globalWidth,globalHeight, cycle);
 	
-	n_components++;
-	if (camera_active){
-		pthread_create(&threads[0], &attr, camera_server,NULL);
+	if (create_gui){
+		pthread_create(&threads[n_components], &attr, gui_thread,NULL);
+		n_components++;
 	}
+
+
 	if (kinectViewergui_ptx == NULL)
 		throw "kinectViewer: Could not create the grafic interface";
 	for (i = 0; i < n_components; i++) {
 		pthread_join(threads[i], NULL);
 	}
+
+	if (camRGB!=NULL)
+		delete camRGB;
+	if (camDEPTH!=NULL)
+		delete camDEPTH;
+	if (pcClient!=NULL)
+		delete pcClient;
+
+
 	if (ic)
 		ic->destroy();
 	return status;

Modified: trunk/src/components/kinectViewer/kinectViewergui.cpp
===================================================================
--- trunk/src/components/kinectViewer/kinectViewergui.cpp	2013-05-27 14:54:12 UTC (rev 918)
+++ trunk/src/components/kinectViewer/kinectViewergui.cpp	2013-05-27 15:20:58 UTC (rev 919)
@@ -1,38 +1,58 @@
+/*
+ *  Copyright (C) 1997-2013 JDE Developers TeamkinectViewer.camRGB
+ *
+ *  This program is free software: you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation, either version 3 of the License, or
+ *  (at your option) any later version.
+ *
+ *  This program is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *  GNU General Public License for more details.
+ *
+ *  You should have received a copy of the GNU General Public License
+ *  along with this program.  If not, see http://www.gnu.org/licenses/.
+ *
+ *  Author : Jose María Cañas <jmplaza en gsyc.es>
+			Francisco Miguel Rivas Montero <franciscomiguel.rivas en urjc.es>
 
+ */
 
 #include "kinectViewergui.h"
 #include <jderobot/pointcloud.h>
 
 namespace kinectViewer {
-	kinectViewergui::kinectViewergui(jderobot::CameraPrx rgb,jderobot::CameraPrx depth,kinectViewerController::PointCloudController* pointCloud_ctr,kinectViewerController::Pose3DMotorsController* ptmc_in, kinectViewerController::LedsController* lc_in, std::string path, std::string path_rgb, std::string path_ir, int width, int height): gtkmain(0,0) {	
+	kinectViewergui::kinectViewergui(bool rgb, bool depth,bool pointCloud , std::string path, std::string path_rgb, std::string path_ir, int width, int height, float cycle): gtkmain(0,0) {
+
 		/*Init OpenGL*/
 		if(!Gtk::GL::init_check(NULL, NULL))	{
 			std::cerr << "Couldn't initialize GL\n";
 			std::exit(1);
 		}
-	cam_rgb=rgb;
-	cam_depth=depth;
-	if (cam_rgb==0)
+		this->cycle=cycle;
+
+	if (rgb)
 		cam_rgb_active=1;
 	else
 		cam_rgb_active=0;
-	if (cam_depth==0)
+	if (depth)
 		cam_depth_active=1;
 	else
 		cam_depth_active=0;
 	modesAvalables=0;
-	if (pointCloud_ctr != NULL){
-		if ((cam_rgb==0)||(cam_depth==0)){
+	if (pointCloud){
+		if ((rgb)&&(depth)){
 			reconstructMode=1;
-			modesAvalables=1; //only one mode
+			modesAvalables=2; //only one mode
 		}
 		else{
 			reconstructMode=1;
-			modesAvalables=2; //both modes
+			modesAvalables=1; //both modes
 		}
 	}
 	else{
-		if ((cam_rgb!=0)&&(cam_depth!=0)){
+		if ((rgb)&&(depth)){
 			reconstructMode=1;
 			modesAvalables=1; //only point cloud mode 
 		}
@@ -49,17 +69,7 @@
 	refXml = Gnome::Glade::Xml::create("./kinectViewergui.glade");
 	cWidth=width;
 	cHeight=height;
-	
-	/*Create controller*/
-	if (ptmc_in != NULL){
-		ptmGui = new kinectViewerGuiModules::Pose3DMotorsGui(ptmc_in, refXml);
-	}
-	if (lc_in){
-		lGui = new kinectViewerGuiModules::ledsGui(lc_in,refXml);
-	}
 
-	/*ojo controlar si existe */
-	pointCloud=pointCloud_ctr;
 
 	
 
@@ -88,10 +98,10 @@
 	refXml->get_widget("tg_gl",w_tg_gl);
 	refXml->get_widget("vbox_gl",w_vbox_gl);
 		
-	if (cam_rgb_active){
+	if (!cam_rgb_active){
 		w_toggle_rgb->hide();
 	}
-	if (cam_depth_active){
+	if (!cam_depth_active){
 		w_toggle_depth->hide();
 	}
 	
@@ -136,33 +146,28 @@
 
 
 void 
-kinectViewergui::updateAll( const colorspaces::Image& imageRGB, const colorspaces::Image& imageDEPTH )
+kinectViewergui::updateAll( cv::Mat imageRGB, cv::Mat imageDEPTH, std::vector<jderobot::RGBPoint> cloud )
 {
 		cv::Mat distance(imageRGB.rows, imageRGB.cols, CV_32FC1);
 		CvPoint pt1,pt2;
 			if (w_toggle_rgb->get_active()){
-				colorspaces::ImageRGB8 img_rgb888(imageRGB);//conversion will happen if needed
-				Glib::RefPtr<Gdk::Pixbuf> imgBuff =  Gdk::Pixbuf::create_from_data((const guint8*) img_rgb888.data,Gdk::COLORSPACE_RGB,false,8,img_rgb888.width,img_rgb888.height,img_rgb888.step);    
+				Glib::RefPtr<Gdk::Pixbuf> imgBuff =  Gdk::Pixbuf::create_from_data((const guint8*) imageRGB.data,Gdk::COLORSPACE_RGB,false,8,imageRGB.cols,imageRGB.rows,imageRGB.step);
 	    		w_imageRGB->clear();
 				/*si queremos pintar las lineas*/
 				if (lines_rgb_active){
-					cv::Mat src = cv::Mat(cvSize(img_rgb888.width,img_rgb888.height), CV_8UC3, img_rgb888.data);
-					memcpy((unsigned char *) src.data, &(img_rgb888.data[0]),img_rgb888.width*img_rgb888.height * 3);
-					util->draw_room(src,0, world->lines, world->numlines);
-					memmove(&(img_rgb888.data[0]),(unsigned char *) src.data,img_rgb888.width*img_rgb888.height * 3);
-					
+					util->draw_room(imageRGB,0, world->lines, world->numlines);
 				}
 	    		w_imageRGB->set(imgBuff);
 			}
 			if (w_toggle_depth->get_active()||((reconstruct_depth_activate)&&(reconstructMode==0))){
 	
-				colorspaces::ImageRGB8 img_rgb888(imageDEPTH);//conversion will happen if needed
-				cv::Mat srcDEPTH = cv::Mat(cvSize(img_rgb888.width,img_rgb888.height), CV_8UC3, img_rgb888.data);
 				/*split channels to separate distance from image*/
 				std::vector<cv::Mat> layers;
-				cv::split(srcDEPTH, layers);
-				cv::Mat colorDepth(srcDEPTH.size(),srcDEPTH.type());
+				cv::split(imageDEPTH, layers);
+				cv::Mat colorDepth(imageDEPTH.size(),imageDEPTH.type());
 				cv::cvtColor(layers[0],colorDepth,CV_GRAY2RGB);
+				/*cv::imshow("color", colorDepth);
+				cv::waitKey(1);*/
 
 				for (int x=0; x< layers[1].cols ; x++){
 					for (int y=0; y<layers[1].rows; y++){
@@ -170,22 +175,22 @@
 				}
 
 				if (w_toggle_depth->get_active()){
-					Glib::RefPtr<Gdk::Pixbuf> imgBuff =  Gdk::Pixbuf::create_from_data((const guint8*) img_rgb888.data,Gdk::COLORSPACE_RGB,false,8,img_rgb888.width,img_rgb888.height,img_rgb888.step);
+					Glib::RefPtr<Gdk::Pixbuf> imgBuff =  Gdk::Pixbuf::create_from_data((const guint8*) colorDepth.data,Gdk::COLORSPACE_RGB,false,8,colorDepth.cols,colorDepth.rows,colorDepth.step);
 					w_imageDEPTH->clear();
 					if (lines_depth_active){
 						util->draw_room(colorDepth,1, world->lines, world->numlines);
 					}
-					memmove(&(img_rgb888.data[0]),(unsigned char *) colorDepth.data,img_rgb888.width*img_rgb888.height * 3);
-
 					w_imageDEPTH->set(imgBuff);
 				}
+				while (gtkmain.events_pending())
+				      	gtkmain.iteration();
 			}
 			if (reconstruct_depth_activate){
 				if (reconstructMode==0){
 					add_depth_pointsImage(imageRGB, distance);
 				}
 				else
-					add_depth_pointsCloud();
+					add_depth_pointsCloud(cloud);
 			}
 		world->my_expose_event();
     	while (gtkmain.events_pending())
@@ -193,19 +198,15 @@
   	}
 
 void 
-kinectViewergui::updateRGB( const colorspaces::Image& imageRGB)
+kinectViewergui::updateRGB( cv::Mat imageRGB)
 {
 		CvPoint pt1,pt2;
 			if (w_toggle_rgb->get_active()){
-				colorspaces::ImageRGB8 img_rgb888(imageRGB);//conversion will happen if needed
-				Glib::RefPtr<Gdk::Pixbuf> imgBuff =  Gdk::Pixbuf::create_from_data((const guint8*) img_rgb888.data,Gdk::COLORSPACE_RGB,false,8,img_rgb888.width,img_rgb888.height,img_rgb888.step);    
+				Glib::RefPtr<Gdk::Pixbuf> imgBuff =  Gdk::Pixbuf::create_from_data((const guint8*) imageRGB.data,Gdk::COLORSPACE_RGB,false,8,imageRGB.cols,imageRGB.rows,imageRGB.step);
 	    		w_imageRGB->clear();
 				/*si queremos pintar las lineas*/
 				if (lines_rgb_active){
-					IplImage* src = cvCreateImage(cvSize(img_rgb888.width,img_rgb888.height), IPL_DEPTH_8U, 3);
-					memcpy((unsigned char *) src->imageData, &(img_rgb888.data[0]),img_rgb888.width*img_rgb888.height * 3);
-					util->draw_room(src,0, world->lines, world->numlines);
-					memmove(&(img_rgb888.data[0]),(unsigned char *) src->imageData,img_rgb888.width*img_rgb888.height * 3);
+					util->draw_room(imageRGB,0, world->lines, world->numlines);
 					
 				}
 	    		w_imageRGB->set(imgBuff);
@@ -214,8 +215,9 @@
 	      		gtkmain.iteration();
 			}
 			if (reconstruct_depth_activate){
-				if (reconstructMode!=0)
-					add_depth_pointsCloud();
+				if (reconstructMode!=0){
+					//add_depth_pointsCloud();
+				}
 			}
 		world->my_expose_event();
     	while (gtkmain.events_pending())
@@ -223,19 +225,14 @@
   	}
 
 void 
-kinectViewergui::updateDEPTH(const colorspaces::Image& imageDEPTH )
+kinectViewergui::updateDEPTH(cv::Mat imageDEPTH )
 {
 		CvPoint pt1,pt2;
 			if (w_toggle_depth->get_active()){
-	
-				colorspaces::ImageRGB8 img_rgb888(imageDEPTH);//conversion will happen if needed
-				Glib::RefPtr<Gdk::Pixbuf> imgBuff =  Gdk::Pixbuf::create_from_data((const guint8*) img_rgb888.data,Gdk::COLORSPACE_RGB,false,8,img_rgb888.width,img_rgb888.height,img_rgb888.step);    
+					Glib::RefPtr<Gdk::Pixbuf> imgBuff =  Gdk::Pixbuf::create_from_data((const guint8*) imageDEPTH.data,Gdk::COLORSPACE_RGB,false,8,imageDEPTH.cols,imageDEPTH.rows,imageDEPTH.step);
 	    		w_imageDEPTH->clear();
 				if (lines_depth_active){
-					IplImage* src = cvCreateImage(cvSize(img_rgb888.width,img_rgb888.height), IPL_DEPTH_8U, 3);
-					memcpy((unsigned char *) src->imageData, &(img_rgb888.data[0]),img_rgb888.width*img_rgb888.height * 3);
-					util->draw_room(src,1, world->lines, world->numlines);
-					memmove(&(img_rgb888.data[0]),(unsigned char *) src->imageData,img_rgb888.width*img_rgb888.height * 3);
+					util->draw_room(imageDEPTH,1, world->lines, world->numlines);
 					
 				}
 	    		w_imageDEPTH->set(imgBuff);
@@ -245,7 +242,7 @@
 			}
 			if (reconstruct_depth_activate){
 				if (reconstructMode!=0){
-					add_depth_pointsCloud();
+					//add_depth_pointsCloud();
 				}
 			}
 		world->my_expose_event();
@@ -254,14 +251,14 @@
   	}
 
 void 
-kinectViewergui::updatePointCloud( )
+kinectViewergui::updatePointCloud(std::vector<jderobot::RGBPoint> cloud )
 {
 	displayFrameRate();
 	    		while (gtkmain.events_pending())
 	      		gtkmain.iteration();
 			if (reconstruct_depth_activate){
 				if (reconstructMode==1){
-					add_depth_pointsCloud();
+					add_depth_pointsCloud(cloud);
 				}
 			}
 		world->my_expose_event();
@@ -370,7 +367,7 @@
 }
 
 void 
-kinectViewergui::add_depth_pointsImage(const colorspaces::Image& imageRGB, cv::Mat distance){
+kinectViewergui::add_depth_pointsImage(cv::Mat imageRGB, cv::Mat distance){
 	float d;
 		//std::cout << "point image" << std::endl;
 
@@ -439,10 +436,8 @@
 }
 
 void 
-kinectViewergui::add_depth_pointsCloud(){
+kinectViewergui::add_depth_pointsCloud(std::vector<jderobot::RGBPoint> cloud){
 	world->clear_points();
-	std::vector<jderobot::RGBPoint> cloud;
-	cloud=pointCloud->getCloud();
 	for (std::vector<jderobot::RGBPoint>::iterator it = cloud.begin(); it != cloud.end(); ++it){
 		world->add_kinect_point(it->x,it->y,it->z,(int)it->r,(int)it->g,(int)it->b);
 	}
@@ -575,5 +570,9 @@
 	}
 }
 
+float
+kinectViewergui::getCycle(){
+	return this->cycle;
+}
 
 } // namespace

Modified: trunk/src/components/kinectViewer/kinectViewergui.h
===================================================================
--- trunk/src/components/kinectViewer/kinectViewergui.h	2013-05-27 14:54:12 UTC (rev 918)
+++ trunk/src/components/kinectViewer/kinectViewergui.h	2013-05-27 15:20:58 UTC (rev 919)
@@ -1,3 +1,24 @@
+/*
+ *  Copyright (C) 1997-2013 JDE Developers TeamkinectViewer.camRGB
+ *
+ *  This program is free software: you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation, either version 3 of the License, or
+ *  (at your option) any later version.
+ *
+ *  This program is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *  GNU General Public License for more details.
+ *
+ *  You should have received a copy of the GNU General Public License
+ *  along with this program.  If not, see http://www.gnu.org/licenses/.
+ *
+ *  Author : Jose María Cañas <jmplaza en gsyc.es>
+			Francisco Miguel Rivas Montero <franciscomiguel.rivas en urjc.es>
+
+ */
+
 #ifndef kinectViewer_VIEW_H
 #define kinectViewer_VIEW_H
 
@@ -14,17 +35,12 @@
 #include <cv.h>
 #include <highgui.h>
 #include "util3d.h"
-#include "controllers/Pose3DMotors-controller.h"
-#include "gui-modules/Pose3DMotorsGui.h"
-#include "controllers/leds-controller.h"
-#include "gui-modules/ledsGui.h"
-#include "controllers/pointCloud-controller.h"
 
 namespace kinectViewer {
   class kinectViewergui {
 		public:
 
-		  kinectViewergui(jderobot::CameraPrx rgb,jderobot::CameraPrx depth,kinectViewerController::PointCloudController* pointCloud_ctr ,kinectViewerController::Pose3DMotorsController* ptmc_in, kinectViewerController::LedsController* lc_in, std::string path, std::string path_rgb, std::string path_ir, int width, int height);
+		  kinectViewergui(bool rgb, bool depth,bool pointCloud , std::string path, std::string path_rgb, std::string path_ir, int width, int height, float cycle);
 		  virtual ~kinectViewergui();
 
 			/*Return true if the windows is visible*/
@@ -32,15 +48,15 @@
 
 
 		  /*Display window*/
-		  void updateAll( const colorspaces::Image& imageRGB, const colorspaces::Image& imageDEPTH );
-		void updateRGB( const colorspaces::Image& imageRGB);
-		void updateDEPTH(const colorspaces::Image& imageDEPTH );
-		void updatePointCloud();
+		  void updateAll( cv::Mat imageRGB, cv::Mat imageDEPTH, std::vector<jderobot::RGBPoint> cloud );
+		void updateRGB( cv::Mat imageRGB);
+		void updateDEPTH(cv::Mat imageDEPTH );
+		void updatePointCloud(std::vector<jderobot::RGBPoint> cloud);
 		bool isClosed();
+		float getCycle();
 
 		private:
-			
-			kinectViewerController::PointCloudController* pointCloud;
+			float cycle;
 
 	
 			Glib::RefPtr<Gnome::Glade::Xml> refXml;
@@ -70,8 +86,6 @@
 			Gtk::Button *w_button_clear_lines;
 			util3d* util;
 			DrawArea* world;
-			kinectViewerGuiModules::Pose3DMotorsGui* ptmGui;
-			kinectViewerGuiModules::ledsGui* lGui;
 			int cWidth, cHeight;
 			int reconstructMode;
 			int modesAvalables;
@@ -82,9 +96,7 @@
 			IceUtil::Time currentFrameTime,oldFrameTime;
     		double fps;
     		int frameCount;
-			jderobot::CameraPrx cam_rgb;
-			jderobot::CameraPrx cam_depth;
-			jderobot::KinectLedsPrx leds;
+
 			myprogeo *mypro;
 			bool lines_depth_active;
 			bool lines_rgb_active;
@@ -93,8 +105,8 @@
 			bool on_clicked_event_depth(GdkEventButton* event);
 			bool reconstruct_depth_activate;
 			void on_reconstruct_depth();
-			void add_depth_pointsImage(const colorspaces::Image& imageRGB, cv::Mat distance);
-			void add_depth_pointsCloud();
+			void add_depth_pointsImage(cv::Mat imageRGB, cv::Mat distance);
+			void add_depth_pointsCloud(std::vector<jderobot::RGBPoint> cloud);
 			void add_cameras_position();
 			void add_camera_position();
 			void on_w_lines_rgb_toggled();

Modified: trunk/src/components/kinectViewer/myprogeo.cpp
===================================================================
--- trunk/src/components/kinectViewer/myprogeo.cpp	2013-05-27 14:54:12 UTC (rev 918)
+++ trunk/src/components/kinectViewer/myprogeo.cpp	2013-05-27 15:20:58 UTC (rev 919)
@@ -1,23 +1,22 @@
 /*
-*  Copyright (C) 1997-2011 JDERobot Developers Team
+ *  Copyright (C) 1997-2013 JDE Developers TeamkinectViewer.camRGB
  *
- *  This program is free software; you can redistribute it and/or modify
+ *  This program is free software: you can redistribute it and/or modify
  *  it under the terms of the GNU General Public License as published by
- *  the Free Software Foundation; either version 2 of the License, or
+ *  the Free Software Foundation, either version 3 of the License, or
  *  (at your option) any later version.
  *
  *  This program is distributed in the hope that it will be useful,
  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- *  GNU Library General Public License for more details.
+ *  GNU General Public License for more details.
  *
  *  You should have received a copy of the GNU General Public License
- *  along with this program; if not, write to the Free Software
- *  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ *  along with this program.  If not, see http://www.gnu.org/licenses/.
  *
- *   Authors : Francisco Miguel Rivas Montero <franciscomiguel.rivas en urjc.es>
- *             Jose María Cañas Plaza <jmplaza en gsyc.es>
- *
+ *  Author : Jose María Cañas <jmplaza en gsyc.es>
+			Francisco Miguel Rivas Montero <franciscomiguel.rivas en urjc.es>
+
  */
 
 #include "myprogeo.h"

Modified: trunk/src/components/kinectViewer/myprogeo.h
===================================================================
--- trunk/src/components/kinectViewer/myprogeo.h	2013-05-27 14:54:12 UTC (rev 918)
+++ trunk/src/components/kinectViewer/myprogeo.h	2013-05-27 15:20:58 UTC (rev 919)
@@ -1,23 +1,22 @@
 /*
-*  Copyright (C) 1997-2011 JDERobot Developers Team
+ *  Copyright (C) 1997-2013 JDE Developers TeamkinectViewer.camRGB
  *
- *  This program is free software; you can redistribute it and/or modify
+ *  This program is free software: you can redistribute it and/or modify
  *  it under the terms of the GNU General Public License as published by
- *  the Free Software Foundation; either version 2 of the License, or
+ *  the Free Software Foundation, either version 3 of the License, or
  *  (at your option) any later version.
  *
  *  This program is distributed in the hope that it will be useful,
  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- *  GNU Library General Public License for more details.
+ *  GNU General Public License for more details.
  *
  *  You should have received a copy of the GNU General Public License
- *  along with this program; if not, write to the Free Software
- *  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ *  along with this program.  If not, see http://www.gnu.org/licenses/.
  *
- *   Authors : Francisco Miguel Rivas Montero <franciscomiguel.rivas en urjc.es>
- *             Jose María Cañas Plaza <jmplaza en gsyc.es>
- *
+ *  Author : Jose María Cañas <jmplaza en gsyc.es>
+			Francisco Miguel Rivas Montero <franciscomiguel.rivas en urjc.es>
+
  */
 
 #ifndef KINECTVIEWER_MYPROGEO_H

Modified: trunk/src/components/kinectViewer/util3d.cpp
===================================================================
--- trunk/src/components/kinectViewer/util3d.cpp	2013-05-27 14:54:12 UTC (rev 918)
+++ trunk/src/components/kinectViewer/util3d.cpp	2013-05-27 15:20:58 UTC (rev 919)
@@ -1,23 +1,22 @@
 /*
-*  Copyright (C) 1997-2011 JDERobot Developers Team
+ *  Copyright (C) 1997-2013 JDE Developers TeamkinectViewer.camRGB
  *
- *  This program is free software; you can redistribute it and/or modify
+ *  This program is free software: you can redistribute it and/or modify
  *  it under the terms of the GNU General Public License as published by
- *  the Free Software Foundation; either version 2 of the License, or
+ *  the Free Software Foundation, either version 3 of the License, or
  *  (at your option) any later version.
  *
  *  This program is distributed in the hope that it will be useful,
  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- *  GNU Library General Public License for more details.
+ *  GNU General Public License for more details.
  *
  *  You should have received a copy of the GNU General Public License
- *  along with this program; if not, write to the Free Software
- *  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ *  along with this program.  If not, see http://www.gnu.org/licenses/.
  *
- *   Authors : Francisco Miguel Rivas Montero <franciscomiguel.rivas en urjc.es>
- *             Jose María Cañas Plaza <jmplaza en gsyc.es>
- *
+ *  Author : Jose María Cañas <jmplaza en gsyc.es>
+			Francisco Miguel Rivas Montero <franciscomiguel.rivas en urjc.es>
+
  */
 
 #include "util3d.h"

Modified: trunk/src/components/kinectViewer/util3d.h
===================================================================
--- trunk/src/components/kinectViewer/util3d.h	2013-05-27 14:54:12 UTC (rev 918)
+++ trunk/src/components/kinectViewer/util3d.h	2013-05-27 15:20:58 UTC (rev 919)
@@ -1,23 +1,22 @@
 /*
-*  Copyright (C) 1997-2011 JDERobot Developers Team
+ *  Copyright (C) 1997-2013 JDE Developers TeamkinectViewer.camRGB
  *
- *  This program is free software; you can redistribute it and/or modify
+ *  This program is free software: you can redistribute it and/or modify
  *  it under the terms of the GNU General Public License as published by
- *  the Free Software Foundation; either version 2 of the License, or
+ *  the Free Software Foundation, either version 3 of the License, or
  *  (at your option) any later version.
  *
  *  This program is distributed in the hope that it will be useful,
  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- *  GNU Library General Public License for more details.
+ *  GNU General Public License for more details.
  *
  *  You should have received a copy of the GNU General Public License
- *  along with this program; if not, write to the Free Software
- *  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ *  along with this program.  If not, see http://www.gnu.org/licenses/.
  *
- *   Authors : Francisco Miguel Rivas Montero <franciscomiguel.rivas en urjc.es>
- *             Jose María Cañas Plaza <jmplaza en gsyc.es>
- *
+ *  Author : Jose María Cañas <jmplaza en gsyc.es>
+			Francisco Miguel Rivas Montero <franciscomiguel.rivas en urjc.es>
+
  */
 
 #ifndef KINECTVIEWER_UTIL3D_H

Added: trunk/src/components/replayController/CMakeLists.txt
===================================================================
--- trunk/src/components/replayController/CMakeLists.txt	                        (rev 0)
+++ trunk/src/components/replayController/CMakeLists.txt	2013-05-27 15:20:58 UTC (rev 919)
@@ -0,0 +1,34 @@
+ cmake_minimum_required(VERSION 2.8)
+
+
+SET( SOURCE_FILES replayController.cpp replayControllerGui.cpp)
+
+
+add_definitions(-DGLADE_DIR="${gladedir}")
+
+set( CMAKE_CXX_FLAGS "-Wno-deprecated" ) # Opciones para el compilador-lgsl -lgslcblas -lGL -lGLU -lglut -lgazebo
+
+include_directories(
+    ${INTERFACES_CPP_DIR}
+    ${LIBS_DIR}/
+    ${CMAKE_CURRENT_SOURCE_DIR}
+)
+
+add_executable (replayController ${SOURCE_FILES})
+
+
+TARGET_LINK_LIBRARIES(replayController 
+	${GLUT_LIBRARIES}
+   	${OpenCV_LIBRARIES}
+   	${gtkmm_LIBRARIES}
+    ${libglademm_LIBRARIES}
+    ${gtkglextmm_LIBRARIES}
+    ${LIBS_DIR}/colorspaces/libcolorspacesmm.so
+    ${INTERFACES_CPP_DIR}/jderobot/libJderobotInterfaces.so
+    ${LIBS_DIR}/jderobotice/libjderobotice.so
+    ${LIBS_DIR}/jderobotutil/libjderobotutil.so
+    ${LIBS_DIR}/progeo/libprogeo.so
+    ${LIBS_DIR}/pioneer/libpioneer.so
+    ${LIBS_DIR}/parallelIce/libparallelIce.so
+    ${ZeroCIce_LIBRARIES}
+)

Added: trunk/src/components/replayController/build/CMakeLists.txt
===================================================================
--- trunk/src/components/replayController/build/CMakeLists.txt	                        (rev 0)
+++ trunk/src/components/replayController/build/CMakeLists.txt	2013-05-27 15:20:58 UTC (rev 919)
@@ -0,0 +1,133 @@
+project (JDEROBOT_REPLAYCONTROLLER)
+
+cmake_minimum_required(VERSION 2.8)
+
+# ENV VARS
+SET(gladedir ./)
+
+SET( INTERFACES_CPP_DIR ${CMAKE_CURRENT_SOURCE_DIR}/../../../interfaces/cpp) # Directorio con las interfaces ICE en C++
+SET( LIBS_DIR ${CMAKE_CURRENT_SOURCE_DIR}/../../../libs) # Directorio donde se encuentran las librerias propias de jderobot
+SET( SLICE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/../../../interfaces/slice) # Directorio donde se encuentran las interfaces ICE
+SET( LIBS_NEEDED   bgfgsegmentation jderobotice colorspaces jderobotutil progeo pioneer fuzzylib visionlib ) # Librerias de las que depende el componente
+SET( DEPS_DIR ${CMAKE_CURRENT_SOURCE_DIR}/../../../../Deps) # Directorio donde se encuentran las dependencias
+
+###################
+#                 #
+#  CHECK SYSTEM   #
+#                 #
+###################
+
+  # FIND & CHECK PRINCIPAL LIBRARIES
+
+include(FindPkgConfig)
+
+PKG_CHECK_MODULES(opencv REQUIRED opencv)
+include_directories(${opencv_INCLUDE_DIRS})
+link_directories(${opencv_LIBRARY_DIRS})
+
+#PKG_CHECK_MODULES(gtk20 REQUIRED gtk+-2.0)
+#include_directories(${gtk20_INCLUDE_DIRS})
+#link_directories(${gtk20_LIBRARY_DIRS})
+
+#PKG_CHECK_MODULES(gtkgl20 REQUIRED gtkgl-2.0)
+#include_directories(${gtkgl20_INCLUDE_DIRS})
+#link_directories(${gtkgl20_LIBRARY_DIRS})
+
+PKG_CHECK_MODULES(gtkmm REQUIRED gtkmm-2.4)
+include_directories(${gtkmm_INCLUDE_DIRS})
+link_directories(${gtkmm_LIBRARY_DIRS})
+
+PKG_CHECK_MODULES(libglademm REQUIRED libglademm-2.4)
+include_directories(${libglademm_INCLUDE_DIRS})
+link_directories(${libglademm_LIBRARY_DIRS})
+
+#PKG_CHECK_MODULES(gthread REQUIRED gthread-2.0)
+#include_directories(${gthread_INCLUDE_DIRS})
+#link_directories(${gthread_LIBRARY_DIRS})
+
+#PKG_CHECK_MODULES(libgnomecanvas REQUIRED libgnomecanvas-2.0)
+#include_directories(${libgnomecanvas_INCLUDE_DIRS})
+#link_directories(${libgnomecanvas_LIBRARY_DIRS})
+
+#PKG_CHECK_MODULES(libgnomecanvasmm REQUIRED libgnomecanvasmm-2.6)
+#include_directories(${libgnomecanvasmm_INCLUDE_DIRS})
+#link_directories(${libgnomecanvasmm_LIBRARY_DIRS})
+
+PKG_CHECK_MODULES(gtkglextmm REQUIRED gtkglextmm-1.2)
+include_directories(${gtkglextmm_INCLUDE_DIRS})
+link_directories(${gtkglextmm_LIBRARY_DIRS})
+
+#PKG_CHECK_MODULES(gsl REQUIRED gsl)
+#include_directories(${gsl_INCLUDE_DIRS})
+#link_directories(${gsl_LIBRARIES_DIRS})
+
+# FIND AND CHECK OTHER DEPENDENCES
+include(${DEPS_DIR}/gearbox/CMakeLists.txt)
+#include(${DEPS_DIR}/fireware/CMakeLists.txt)
+#include(${DEPS_DIR}/pcl/CMakeLists.txt)
+#include(${DEPS_DIR}/player/CMakeLists.txt)
+#include(${DEPS_DIR}/xerces/CMakeLists.txt)
+include(${DEPS_DIR}/ice/CMakeLists.txt)
+include(${DEPS_DIR}/opencv/CMakeLists.txt)
+include(${DEPS_DIR}/opengl/CMakeLists.txt)
+
+# START RECURSIVE
+add_subdirectory (${CMAKE_CURRENT_SOURCE_DIR}/../../.. ${CMAKE_CURRENT_SOURCE_DIR}/../../..)
+add_subdirectory (${CMAKE_CURRENT_SOURCE_DIR}/.. ${CMAKE_CURRENT_SOURCE_DIR}/..)
+
+###################
+#                 #
+#    INSTALL      #
+#                 #
+###################
+
+# Install libraries
+INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/../../../../src/interfaces/cpp/jderobot/libJderobotInterfaces.so DESTINATION /usr/local/lib/jderobot)
+
+FOREACH(currentLibFile ${LIBS_NEEDED})
+    SET (new_lib "lib${currentLibFile}.so")
+    MESSAGE("${new_lib}")    
+    INSTALL (FILES ${CMAKE_CURRENT_SOURCE_DIR}/../../../../src/libs/${currentLibFile}/${new_lib} DESTINATION /usr/local/lib/jderobot)
+ENDFOREACH(currentLibFile)
+
+# Install libraries headers
+FILE(GLOB_RECURSE HEADERS_FILES ${CMAKE_CURRENT_SOURCE_DIR}/../../../../src/libs/*.h)
+FOREACH(currentSourceFile ${HEADERS_FILES})
+    string(REGEX REPLACE ".*/(.*/).*.h" "\\1" new_source1 ${currentSourceFile})
+    INSTALL (FILES ${currentSourceFile} DESTINATION /usr/local/include/jderobot/${new_source1})
+ENDFOREACH(currentSourceFile)
+
+# Install Executables
+FILE(GLOB_RECURSE BIN_FILES ${CMAKE_CURRENT_SOURCE_DIR}/../*cfg)
+    string(REGEX REPLACE ".*/(.*).cfg" "\\1" new_source1 ${BIN_FILES})
+INSTALL (FILES ../${new_source1}  DESTINATION /usr/local/bin PERMISSIONS OWNER_EXECUTE GROUP_EXECUTE WORLD_EXECUTE)
+
+# Install interfaces headers
+FILE(GLOB HEADER_INTERFACE_FILES ${CMAKE_CURRENT_SOURCE_DIR}/../../../../src/interfaces/cpp/jderobot/*.h)
+INSTALL (FILES ${HEADER_INTERFACE_FILES} DESTINATION /usr/local/include/jderobot/jderobot)
+
+# Install slice
+FILE(GLOB SLICE_FILES ${CMAKE_CURRENT_SOURCE_DIR}/../../../../src/interfaces/slice/jderobot/*.ice)
+INSTALL (FILES ${SLICE_FILES} DESTINATION /usr/local/include/jderobot/slice)
+
+# Install CONF
+FILE(GLOB_RECURSE CONF_FILES  ${CMAKE_CURRENT_SOURCE_DIR}/../*cfg)
+INSTALL (FILES ${CONF_FILES} DESTINATION /usr/local/share/jderobot/conf)
+
+# Install Glade
+FILE(GLOB_RECURSE GLADE_FILES ${CMAKE_CURRENT_SOURCE_DIR}/../*.glade)
+INSTALL (FILES ${GLADE_FILES} DESTINATION /usr/local/share/jderobot/glade)
+
+###################
+#                 #
+#    UNINSTALL    #
+#                 #
+###################
+
+configure_file(
+    "${CMAKE_CURRENT_SOURCE_DIR}/cmake_uninstall.cmake.in"
+    "${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake"
+    IMMEDIATE @ONLY)
+
+add_custom_target(uninstall
+    COMMAND ${CMAKE_COMMAND} -P ${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake)

Added: trunk/src/components/replayController/build/cmake_uninstall.cmake.in
===================================================================
--- trunk/src/components/replayController/build/cmake_uninstall.cmake.in	                        (rev 0)
+++ trunk/src/components/replayController/build/cmake_uninstall.cmake.in	2013-05-27 15:20:58 UTC (rev 919)
@@ -0,0 +1,22 @@
+if (NOT EXISTS "@CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt")
+    message(FATAL_ERROR "Cannot find install manifest: \"@CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt\"")
+endif(NOT EXISTS "@CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt")
+
+file(READ "@CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt" files)
+string(REGEX REPLACE "\n" ";" files "${files}")
+list(REVERSE files)
+foreach (file ${files})
+    message(STATUS "Uninstalling \"$ENV{DESTDIR}${file}\"")
+    if (EXISTS "$ENV{DESTDIR}${file}")
+        execute_process(
+            COMMAND @CMAKE_COMMAND@ -E remove "$ENV{DESTDIR}${file}"
+            OUTPUT_VARIABLE rm_out
+            RESULT_VARIABLE rm_retval
+        )
+        if(NOT ${rm_retval} EQUAL 0)
+            message(FATAL_ERROR "Problem when removing \"$ENV{DESTDIR}${file}\"")
+        endif (NOT ${rm_retval} EQUAL 0)
+    else (EXISTS "$ENV{DESTDIR}${file}")
+        message(STATUS "File \"$ENV{DESTDIR}${file}\" does not exist.")
+    endif (EXISTS "$ENV{DESTDIR}${file}")
+endforeach(file)
\ No newline at end of file

Added: trunk/src/components/replayController/build-independent/CMakeLists.txt
===================================================================
--- trunk/src/components/replayController/build-independent/CMakeLists.txt	                        (rev 0)
+++ trunk/src/components/replayController/build-independent/CMakeLists.txt	2013-05-27 15:20:58 UTC (rev 919)
@@ -0,0 +1,72 @@
+ cmake_minimum_required(VERSION 2.8)
+
+
+SET( SOURCE_FILES ../replayController.cpp ../replayControllerGui.cpp)
+SET( LIBS_DIR /usr/local/lib/jderobot/)
+
+
+
+include_directories(
+	  /usr/local/include/jderobot
+)
+
+PROJECT(replayControllerProject)
+add_executable (replayController  ${SOURCE_FILES})
+
+#automated opencv
+include(FindPkgConfig)
+PKG_CHECK_MODULES(opencv REQUIRED opencv)
+include_directories(${opencv_INCLUDE_DIRS})
+link_directories(${opencv_LIBRARY_DIRS})
+
+
+
+#manual ICE
+FIND_PATH( Ice_INCLUDE_DIR NAMES Ice/Ice.h  PATHS ENV C++LIB ENV)
+ 
+IF( Ice_INCLUDE_DIR )
+    FIND_LIBRARY( Ice_LIBRARY1 NAMES Ice PATHS ENV C++LIB ENV PATH PATH_SUFFIXES lib lib64 )
+    FIND_LIBRARY( Ice_LIBRARY2 NAMES IceUtil PATHS ENV C++LIB ENV PATH PATH_SUFFIXES lib lib64)
+    SET (Ice_LIBRARIES ${Ice_LIBRARY1} ${Ice_LIBRARY2})
+    IF( Ice_LIBRARIES )
+		MESSAGE ("-- Ice found at ${Ice_LIBRARIES}")
+		include_directories(${Ice_INCLUDE_DIR})
+		link_directories(${Ice_LIBRARIES})
+    ENDIF( Ice_LIBRARIES )
+ENDIF(Ice_INCLUDE_DIR)
+
+IF(NOT Ice_LIBRARIES)
+		MESSAGE ("*** Ice not found")
+ENDIF()
+
+
+#automated gtk
+PKG_CHECK_MODULES(gtkmm REQUIRED gtkmm-2.4)
+include_directories(${gtkmm_INCLUDE_DIRS})
+link_directories(${gtkmm_LIBRARY_DIRS})
+#automated gtkmm
+PKG_CHECK_MODULES(libglademm REQUIRED libglademm-2.4)
+include_directories(${libglademm_INCLUDE_DIRS})
+link_directories(${libglademm_LIBRARY_DIRS})
+#automated gtkglextmm
+PKG_CHECK_MODULES(gtkglextmm REQUIRED gtkglextmm-x11-1.2)
+include_directories(${gtkglextmm_INCLUDE_DIRS})
+link_directories(${gtkglextmm_LIBRARY_DIRS})
+
+
+
+set( CMAKE_CXX_FLAGS "-Wno-deprecated" ) # Opciones para el compilador
+
+
+
+TARGET_LINK_LIBRARIES(replayController
+  ${opencv_LIBRARIES}
+  ${Ice_LIBRARIES}
+  ${gtkglextmm_LIBRARIES}
+  ${libglademm_LIBRARIES}
+  ${gtkmm_LIBRARIES}
+  ${LIBS_DIR}/libcolorspacesmm.so
+  ${LIBS_DIR}/libJderobotInterfaces.so
+  ${LIBS_DIR}/libjderobotice.so
+  ${LIBS_DIR}/libjderobotutil.so
+)

Added: trunk/src/components/replayController/replayController.cfg
===================================================================
--- trunk/src/components/replayController/replayController.cfg	                        (rev 0)
+++ trunk/src/components/replayController/replayController.cfg	2013-05-27 15:20:58 UTC (rev 919)
@@ -0,0 +1,3 @@
+replayController.control.Proxy=replayControllerA:tcp -h localhost -p 9999
+replayController.IPS=20
+

Added: trunk/src/components/replayController/replayController.cpp
===================================================================
--- trunk/src/components/replayController/replayController.cpp	                        (rev 0)
+++ trunk/src/components/replayController/replayController.cpp	2013-05-27 15:20:58 UTC (rev 919)
@@ -0,0 +1,90 @@
+/*
+ *  Copyright (C) 1997-2013 JDE Developers TeamkinectViewer.camRGB
+ *
+ *  This program is free software: you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation, either version 3 of the License, or
+ *  (at your option) any later version.
+ *
+ *  This program is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *  GNU General Public License for more details.
+ *
+ *  You should have received a copy of the GNU General Public License
+ *  along with this program.  If not, see http://www.gnu.org/licenses/.
+ *
+ *  Author : Jose María Cañas <jmplaza en gsyc.es>
+			Francisco Miguel Rivas Montero <franciscomiguel.rivas en urjc.es>
+
+ */
+
+#include <jderobot/replayControl.h>
+#include "replayControllerGui.h"
+
+#include <pthread.h>
+#include <Ice/Ice.h>
+#include <IceUtil/IceUtil.h>
+
+int main(int argc, char** argv){
+	Ice::CommunicatorPtr ic;
+	Ice::PropertiesPtr prop;
+	std::string prefix("replayController.");
+	jderobot::replayControlPrx prx;
+
+	try{
+		ic = Ice::initialize(argc,argv);
+		prop = ic->getProperties();
+	}catch (const Ice::Exception& ex) {
+		std::cerr << ex << std::endl;
+		return 1;
+	}
+	catch (const char* msg) {
+		std::cerr <<"Error :" << msg << std::endl;
+		return 1;
+	}
+
+
+	try{
+		Ice::ObjectPrx base = ic->propertyToProxy(prefix+"control.Proxy");
+		if (0==base){
+			throw "replayController: Could not create proxy with replayControl";
+		}
+		else {
+			prx= jderobot::replayControlPrx::checkedCast(base);
+			if (0==prx)
+				throw "Invalid " + prefix + ".Proxy";
+		}
+	}catch (const Ice::Exception& ex) {
+		std::cerr << ex << std::endl;
+	}
+	catch (const char* msg) {
+		std::cerr << msg << std::endl;
+		std::cout << "replayController: Not camera provided" << std::endl;
+	}
+
+	int ips=prop->getPropertyAsIntWithDefault(prefix+"IPS",10);
+	float cycle=(float)(1/(float)ips)*1000000;
+
+	replayController::replayControllergui* gui = new replayController::replayControllergui(prx);
+	struct timeval post;
+	long long int totalpre=0;
+	long long int totalpost=0;
+
+	while (gui->update()){
+		gettimeofday(&post,NULL);
+		totalpost=post.tv_sec*1000000+post.tv_usec;
+		if (totalpre !=0){
+			if ((totalpost - totalpre) > cycle ){
+				std::cout<<"-------- replayController: camera adquisition timeout-" << std::endl;
+			}
+			else{
+				usleep(cycle - (totalpost - totalpre));
+			}
+		}
+		totalpre=totalpost;
+
+	}
+
+
+}

Added: trunk/src/components/replayController/replayControllerGui.cpp
===================================================================
--- trunk/src/components/replayController/replayControllerGui.cpp	                        (rev 0)
+++ trunk/src/components/replayController/replayControllerGui.cpp	2013-05-27 15:20:58 UTC (rev 919)
@@ -0,0 +1,74 @@
+/*
+ * recordergui.cpp
+ *
+ *  Created on: 14/05/2013
+ *      Author: frivas
+ */
+
+#include "replayControllerGui.h"
+
+
+namespace replayController {
+
+replayControllergui::replayControllergui(jderobot::replayControlPrx c): gtkmain(0,0) {
+	// TODO Auto-generated constructor stub
+
+	this->controller=c;
+	this->exit=false;
+	std::cout << "Loading glade\n";
+	refXml = Gnome::Glade::Xml::create("./replayControllerGui.glade");
+
+		/*Get widgets*/
+	refXml->get_widget("window1",mainwindow);
+	refXml->get_widget("button1", w_stop);
+	refXml->get_widget("button2", w_resume);
+	refXml->get_widget("button3", w_step);
+	refXml->get_widget("button4", w_exit);
+	refXml->get_widget("togglebutton1", w_repeat);
+
+	w_repeat->set_active(true);
+
+	w_stop->signal_clicked().connect(sigc::mem_fun(this,&replayControllergui::on_clicked_stop));
+	w_resume->signal_clicked().connect(sigc::mem_fun(this,&replayControllergui::on_clicked_resume));
+	w_repeat->signal_clicked().connect(sigc::mem_fun(this,&replayControllergui::on_change_repeat));
+	w_step->signal_clicked().connect(sigc::mem_fun(this,&replayControllergui::on_clicked_step));
+	w_exit->signal_clicked().connect(sigc::mem_fun(this,&replayControllergui::on_clicked_exit));
+
+
+	mainwindow->show();
+
+}
+
+replayControllergui::~replayControllergui() {
+	// TODO Auto-generated destructor stub
+}
+
+bool replayControllergui::update(){
+	while (gtkmain.events_pending())
+		gtkmain.iteration();
+	return !(this->exit);
+}
+
+void replayControllergui::on_clicked_stop(){
+	this->controller->pause();
+}
+
+void replayControllergui::on_clicked_resume(){
+	this->controller->resume();
+}
+
+void replayControllergui::on_change_repeat(){
+	this->controller->setReplay(this->w_repeat->get_active());
+}
+
+void replayControllergui::on_clicked_step(){
+	this->controller->setStep(100);
+}
+
+void replayControllergui::on_clicked_exit(){
+	this->exit=true;
+}
+
+
+} /* namespace recorder */
+

Added: trunk/src/components/replayController/replayControllerGui.glade
===================================================================
--- trunk/src/components/replayController/replayControllerGui.glade	                        (rev 0)
+++ trunk/src/components/replayController/replayControllerGui.glade	2013-05-27 15:20:58 UTC (rev 919)
@@ -0,0 +1,297 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!DOCTYPE glade-interface SYSTEM "glade-2.0.dtd">
+<!--Generated with glade3 3.4.2 on Mon May 27 19:15:09 2013 -->
+<glade-interface>
+  <widget class="GtkWindow" id="window1">
+    <property name="width_request">640</property>
+    <property name="height_request">200</property>
+    <property name="title" translatable="yes">Replayer</property>
+    <child>
+      <widget class="GtkVBox" id="vbox1">
+        <property name="visible">True</property>
+        <child>
+          <widget class="GtkMenuBar" id="menubar1">
+            <property name="visible">True</property>
+            <child>
+              <widget class="GtkMenuItem" id="menuitem1">
+                <property name="visible">True</property>
+                <property name="use_action_appearance">False</property>
+                <property name="label" translatable="yes">_Archivo</property>
+                <property name="use_underline">True</property>
+                <child>
+                  <widget class="GtkMenu" id="menu1">
+                    <property name="visible">True</property>
+                    <child>
+                      <widget class="GtkImageMenuItem" id="imagemenuitem1">
+                        <property name="visible">True</property>
+                        <property name="use_action_appearance">False</property>
+                        <property name="label">gtk-new</property>
+                        <property name="use_underline">True</property>
+                        <property name="use_action_appearance">False</property>
+                        <property name="use_stock">True</property>
+                      </widget>
+                    </child>
+                    <child>
+                      <widget class="GtkImageMenuItem" id="imagemenuitem2">
+                        <property name="visible">True</property>
+                        <property name="use_action_appearance">False</property>
+                        <property name="label">gtk-open</property>
+                        <property name="use_underline">True</property>
+                        <property name="use_action_appearance">False</property>
+                        <property name="use_stock">True</property>
+                      </widget>
+                    </child>
+                    <child>
+                      <widget class="GtkImageMenuItem" id="imagemenuitem3">
+                        <property name="visible">True</property>
+                        <property name="use_action_appearance">False</property>
+                        <property name="label">gtk-save</property>
+                        <property name="use_underline">True</property>
+                        <property name="use_action_appearance">False</property>
+                        <property name="use_stock">True</property>
+                      </widget>
+                    </child>
+                    <child>
+                      <widget class="GtkImageMenuItem" id="imagemenuitem4">
+                        <property name="visible">True</property>
+                        <property name="use_action_appearance">False</property>
+                        <property name="label">gtk-save-as</property>
+                        <property name="use_underline">True</property>
+                        <property name="use_action_appearance">False</property>
+                        <property name="use_stock">True</property>
+                      </widget>
+                    </child>
+                    <child>
+                      <widget class="GtkSeparatorMenuItem" id="separatormenuitem1">
+                        <property name="visible">True</property>
+                        <property name="use_action_appearance">False</property>
+                        <property name="use_action_appearance">False</property>
+                      </widget>
+                    </child>
+                    <child>
+                      <widget class="GtkImageMenuItem" id="imagemenuitem5">
+                        <property name="visible">True</property>
+                        <property name="use_action_appearance">False</property>
+                        <property name="label">gtk-quit</property>
+                        <property name="use_underline">True</property>
+                        <property name="use_action_appearance">False</property>
+                        <property name="use_stock">True</property>
+                      </widget>
+                    </child>
+                  </widget>
+                </child>
+              </widget>
+            </child>
+            <child>
+              <widget class="GtkMenuItem" id="menuitem2">
+                <property name="visible">True</property>
+                <property name="use_action_appearance">False</property>
+                <property name="label" translatable="yes">_Editar</property>
+                <property name="use_underline">True</property>
+                <child>
+                  <widget class="GtkMenu" id="menu2">
+                    <property name="visible">True</property>
+                    <child>
+                      <widget class="GtkImageMenuItem" id="imagemenuitem6">
+                        <property name="visible">True</property>
+                        <property name="use_action_appearance">False</property>
+                        <property name="label">gtk-cut</property>
+                        <property name="use_underline">True</property>
+                        <property name="use_action_appearance">False</property>
+                        <property name="use_stock">True</property>
+                      </widget>
+                    </child>
+                    <child>
+                      <widget class="GtkImageMenuItem" id="imagemenuitem7">
+                        <property name="visible">True</property>
+                        <property name="use_action_appearance">False</property>
+                        <property name="label">gtk-copy</property>
+                        <property name="use_underline">True</property>
+                        <property name="use_action_appearance">False</property>
+                        <property name="use_stock">True</property>
+                      </widget>
+                    </child>
+                    <child>
+                      <widget class="GtkImageMenuItem" id="imagemenuitem8">
+                        <property name="visible">True</property>
+                        <property name="use_action_appearance">False</property>
+                        <property name="label">gtk-paste</property>
+                        <property name="use_underline">True</property>
+                        <property name="use_action_appearance">False</property>
+                        <property name="use_stock">True</property>
+                      </widget>
+                    </child>
+                    <child>
+                      <widget class="GtkImageMenuItem" id="imagemenuitem9">
+                        <property name="visible">True</property>
+                        <property name="use_action_appearance">False</property>
+                        <property name="label">gtk-delete</property>
+                        <property name="use_underline">True</property>
+                        <property name="use_action_appearance">False</property>
+                        <property name="use_stock">True</property>
+                      </widget>
+                    </child>
+                  </widget>
+                </child>
+              </widget>
+            </child>
+            <child>
+              <widget class="GtkMenuItem" id="menuitem3">
+                <property name="visible">True</property>
+                <property name="use_action_appearance">False</property>
+                <property name="label" translatable="yes">_Ver</property>
+                <property name="use_underline">True</property>
+              </widget>
+            </child>
+            <child>
+              <widget class="GtkMenuItem" id="menuitem4">
+                <property name="visible">True</property>
+                <property name="use_action_appearance">False</property>
+                <property name="label" translatable="yes">Ay_uda</property>
+                <property name="use_underline">True</property>
+                <child>
+                  <widget class="GtkMenu" id="menu3">
+                    <property name="visible">True</property>
+                    <child>
+                      <widget class="GtkImageMenuItem" id="imagemenuitem10">
+                        <property name="visible">True</property>
+                        <property name="use_action_appearance">False</property>
+                        <property name="label">gtk-about</property>
+                        <property name="use_underline">True</property>
+                        <property name="use_action_appearance">False</property>
+                        <property name="use_stock">True</property>
+                      </widget>
+                    </child>
+                  </widget>
+                </child>
+              </widget>
+            </child>
+          </widget>
+          <packing>
+            <property name="expand">False</property>
+          </packing>
+        </child>
+        <child>
+          <widget class="GtkHSeparator" id="hseparator1">
+            <property name="visible">True</property>
+          </widget>
+          <packing>
+            <property name="expand">False</property>
+            <property name="position">1</property>
+          </packing>
+        </child>
+        <child>
+          <widget class="GtkHScale" id="hscale1">
+            <property name="visible">True</property>
+            <property name="can_focus">True</property>
+            <property name="round_digits">1</property>
+          </widget>
+          <packing>
+            <property name="position">2</property>
+          </packing>
+        </child>
+        <child>
+          <widget class="GtkHSeparator" id="hseparator2">
+            <property name="visible">True</property>
+          </widget>
+          <packing>
+            <property name="expand">False</property>
+            <property name="position">3</property>
+          </packing>
+        </child>
+        <child>
+          <widget class="GtkHBox" id="hbox1">
+            <property name="visible">True</property>
+            <child>
+              <widget class="GtkButton" id="button1">
+                <property name="visible">True</property>
+                <property name="can_focus">True</property>
+                <property name="receives_default">True</property>
+                <property name="use_action_appearance">False</property>
+                <property name="label" translatable="yes">STOP</property>
+                <property name="response_id">0</property>
+              </widget>
+            </child>
+            <child>
+              <widget class="GtkButton" id="button2">
+                <property name="visible">True</property>
+                <property name="can_focus">True</property>
+                <property name="receives_default">True</property>
+                <property name="use_action_appearance">False</property>
+                <property name="label" translatable="yes">RESUME</property>
+                <property name="response_id">0</property>
+              </widget>
+              <packing>
+                <property name="position">1</property>
+              </packing>
+            </child>
+            <child>
+              <widget class="GtkButton" id="button3">
+                <property name="visible">True</property>
+                <property name="can_focus">True</property>
+                <property name="receives_default">True</property>
+                <property name="use_action_appearance">False</property>
+                <property name="label" translatable="yes">Step</property>
+                <property name="response_id">0</property>
+              </widget>
+              <packing>
+                <property name="position">2</property>
+              </packing>
+            </child>
+            <child>
+              <placeholder/>
+            </child>
+            <child>
+              <placeholder/>
+            </child>
+            <child>
+              <placeholder/>
+            </child>
+            <child>
+              <placeholder/>
+            </child>
+            <child>
+              <widget class="GtkToggleButton" id="togglebutton1">
+                <property name="visible">True</property>
+                <property name="can_focus">True</property>
+                <property name="receives_default">True</property>
+                <property name="use_action_appearance">False</property>
+                <property name="label" translatable="yes">Repeat</property>
+                <property name="response_id">0</property>
+                <property name="use_action_appearance">False</property>
+              </widget>
+              <packing>
+                <property name="position">7</property>
+              </packing>
+            </child>
+            <child>
+              <widget class="GtkVSeparator" id="vseparator1">
+                <property name="visible">True</property>
+                <property name="orientation">GTK_ORIENTATION_VERTICAL</property>
+              </widget>
+              <packing>
+                <property name="expand">False</property>
+                <property name="position">8</property>
+              </packing>
+            </child>
+            <child>
+              <widget class="GtkButton" id="button4">
+                <property name="visible">True</property>
+                <property name="can_focus">True</property>
+                <property name="receives_default">True</property>
+                <property name="label" translatable="yes">Exit</property>
+                <property name="response_id">0</property>
+              </widget>
+              <packing>
+                <property name="position">9</property>
+              </packing>
+            </child>
+          </widget>
+          <packing>
+            <property name="position">4</property>
+          </packing>
+        </child>
+      </widget>
+    </child>
+  </widget>
+</glade-interface>

Added: trunk/src/components/replayController/replayControllerGui.h
===================================================================
--- trunk/src/components/replayController/replayControllerGui.h	                        (rev 0)
+++ trunk/src/components/replayController/replayControllerGui.h	2013-05-27 15:20:58 UTC (rev 919)
@@ -0,0 +1,53 @@
+/*
+ * recordergui.h
+ *
+ *  Created on: 14/05/2013
+ *      Author: frivas
+ */
+
+#ifndef RECORDERGUI_H_
+#define RECORDERGUI_H_
+
+#include <string>
+#include <iostream>
+#include <gtkmm.h>
+#include <libglademm.h>
+#include <IceUtil/Thread.h>
+#include <IceUtil/Time.h>
+#include <jderobot/replayControl.h>
+
+namespace replayController {
+
+class replayControllergui {
+public:
+	replayControllergui(jderobot::replayControlPrx c);
+	virtual ~replayControllergui();
+	bool update();
+
+private:
+	Glib::RefPtr<Gnome::Glade::Xml> refXml;
+	Gtk::Main gtkmain;
+	Gtk::Window* mainwindow;
+	Gtk::Button* w_stop;
+	Gtk::Button* w_resume;
+	Gtk::Button* w_step;
+	Gtk::Button* w_exit;
+	Gtk::ToggleButton* w_repeat;
+
+	jderobot::replayControlPrx controller;
+	bool exit;
+
+	//gtk functions
+	void on_clicked_stop();
+	void on_clicked_resume();
+	void on_change_repeat();
+	void on_clicked_step();
+	void on_clicked_exit();
+
+
+
+};
+
+} /* namespace recorder */
+#endif /* RECORDERGUI_H_ */
+

Modified: trunk/src/libs/parallelIce/CMakeLists.txt
===================================================================
--- trunk/src/libs/parallelIce/CMakeLists.txt	2013-05-27 14:54:12 UTC (rev 918)
+++ trunk/src/libs/parallelIce/CMakeLists.txt	2013-05-27 15:20:58 UTC (rev 919)
@@ -6,14 +6,14 @@
 )
 
 add_library (parallelIce STATIC cameraClient.cpp  cameraClient.h  pointcloudClient.cpp  pointcloudClient.h)
-TARGET_LINK_LIBRARIES(paralellIce 
+TARGET_LINK_LIBRARIES(parallelIce 
    	${OpenCV_LIBRARIES}
     ${LIBS_DIR}/colorspaces/libcolorspacesmm.so
     ${ZeroCIce_LIBRARIES}
 )
 
 add_library (parallelIceshare SHARED cameraClient.cpp  cameraClient.h  pointcloudClient.cpp  pointcloudClient.h)
-TARGET_LINK_LIBRARIES(paralellIceshare 
+TARGET_LINK_LIBRARIES(parallelIceshare 
    	${OpenCV_LIBRARIES}
     ${LIBS_DIR}/colorspaces/libcolorspacesmm.so
     ${ZeroCIce_LIBRARIES}



More information about the Jderobot-admin mailing list