[Jderobot-admin] jderobot-r989 - trunk/src/stable/components/openniServer

frivas en jderobot.org frivas en jderobot.org
Mie Sep 25 11:19:54 CEST 2013


Author: frivas
Date: 2013-09-25 11:18:53 +0200 (Wed, 25 Sep 2013)
New Revision: 989

Modified:
   trunk/src/stable/components/openniServer/openniServer.cfg
   trunk/src/stable/components/openniServer/openniServer.cpp
Log:
A?\195?\177adida la posibilidad de configurar el mirror de las c?\195?\161maras desde el fichero .cfg


Modified: trunk/src/stable/components/openniServer/openniServer.cfg
===================================================================
--- trunk/src/stable/components/openniServer/openniServer.cfg	2013-09-23 12:08:30 UTC (rev 988)
+++ trunk/src/stable/components/openniServer/openniServer.cfg	2013-09-25 09:18:53 UTC (rev 989)
@@ -5,7 +5,7 @@
 openniServer.NCameras=1
 openniServer.PlayerDetection=0
 openniServer.Mode=0
-openniServer.ImageRegistration=0
+openniServer.ImageRegistration=1
 
 
 #mode=0 -> fps: 30x: 320y 240
@@ -20,12 +20,14 @@
 openniServer.CameraRGB.Format=RGB8
 openniServer.CameraRGB.fps=10
 openniServer.CameraRGB.PlayerDetection=0
+openniServer.CameraRGB.Mirror=1
 
 #openniServer.calibration=./config/camRGB
 openniServer.CameraDEPTH.Name=cameraB
 openniServer.CameraDEPTH.Format=RGB8
 openniServer.CameraDEPTH.fps=10
 openniServer.CameraDEPTH.PlayerDetection=0
+openniServer.CameraDEPTH.Mirror=1
 
 
 

Modified: trunk/src/stable/components/openniServer/openniServer.cpp
===================================================================
--- trunk/src/stable/components/openniServer/openniServer.cpp	2013-09-23 12:08:30 UTC (rev 988)
+++ trunk/src/stable/components/openniServer/openniServer.cpp	2013-09-25 09:18:53 UTC (rev 989)
@@ -89,6 +89,7 @@
 //block to wait the device initialization
 IceUtil::Mutex controlMutex;
 IceUtil::Cond sem;
+int mirrorDepth, mirrorRGB;
 
 
 namespace openniServer{
@@ -106,6 +107,7 @@
 
 
 
+
 struct timeval a,b;
 
 int segmentationType; //0 ninguna, 1 NITE
@@ -164,6 +166,21 @@
 		{
 			std::cout << "OpenniServer: Couldn't find depth stream: " <<  openni::OpenNI::getExtendedError() << std::endl;
 		}
+
+		if (mirrorDepth){
+			rc=depth.setMirroringEnabled(true);
+			if (rc != openni::STATUS_OK)
+			{
+				std::cout << "OpenniServer: error at set depth mirror: " << openni::OpenNI::getExtendedError() << std::endl;
+			}
+		}
+		else{
+			rc=depth.setMirroringEnabled(false);
+			if (rc != openni::STATUS_OK)
+			{
+				std::cout << "OpenniServer: error at set depth mirror: " << openni::OpenNI::getExtendedError() << std::endl;
+			}
+		}
 	}
 
 	//color
@@ -182,6 +199,20 @@
 		{
 			std::cout << "OpenniServer: Couldn't find color stream: " << openni::OpenNI::getExtendedError() << std::endl;
 		}
+		if (mirrorRGB){
+			rc=color.setMirroringEnabled(true);
+			if (rc != openni::STATUS_OK)
+			{
+				std::cout << "OpenniServer: error at set color mirror: " << openni::OpenNI::getExtendedError() << std::endl;
+			}
+		}
+		else{
+			rc=color.setMirroringEnabled(false);
+			if (rc != openni::STATUS_OK)
+			{
+				std::cout << "OpenniServer: error at set color mirror: " << openni::OpenNI::getExtendedError() << std::endl;
+			}
+		}
 	}
 
 
@@ -195,7 +226,7 @@
 		rc= depth.setVideoMode(depthSensorInfo->getSupportedVideoModes()[deviceMode]);
 		if (rc != openni::STATUS_OK)
 		{
-			std::cout << "OpenniServer0000: error at set depth videoMode: " << openni::OpenNI::getExtendedError() << std::endl;
+			std::cout << "OpenniServer: error at set depth videoMode: " << openni::OpenNI::getExtendedError() << std::endl;
 		}
 		/*std::cout << "depth" << std::endl;
 		for(int i=0;i < depthSensorInfo->getSupportedVideoModes().getSize();i++)
@@ -1149,7 +1180,8 @@
 	int leds = prop->getPropertyAsIntWithDefault(componentPrefix + ".KinectLedsActive",0);
 	int pointCloud = prop->getPropertyAsIntWithDefault(componentPrefix + ".pointCloudActive",0);
 	openniServer::segmentationType= prop->getPropertyAsIntWithDefault(componentPrefix + ".PlayerDetection",0);
-
+	mirrorDepth = prop->getPropertyAsIntWithDefault(componentPrefix + ".CameraDEPTH.Mirror",0);
+	mirrorRGB = prop->getPropertyAsIntWithDefault(componentPrefix + ".CameraRGB.Mirror",0);
 	deviceMode=prop->getPropertyAsIntWithDefault(componentPrefix + ".Mode", 0);
 	std::string Endpoints = prop->getProperty(componentPrefix + ".Endpoints");
 	Ice::ObjectAdapterPtr adapter =ic->createObjectAdapterWithEndpoints(componentPrefix, Endpoints);



More information about the Jderobot-admin mailing list