[Jderobot-admin] jderobot-r1098 - trunk/src/stable/libs/parallelIce

rocapal en jderobot.org rocapal en jderobot.org
Lun Nov 11 18:55:30 CET 2013


Author: rocapal
Date: 2013-11-11 18:55:30 +0100 (Mon, 11 Nov 2013)
New Revision: 1098

Modified:
   trunk/src/stable/libs/parallelIce/cameraClient.cpp
   trunk/src/stable/libs/parallelIce/pointcloudClient.cpp
Log:
#110 added average in framerate of images


Modified: trunk/src/stable/libs/parallelIce/cameraClient.cpp
===================================================================
--- trunk/src/stable/libs/parallelIce/cameraClient.cpp	2013-11-11 11:28:28 UTC (rev 1097)
+++ trunk/src/stable/libs/parallelIce/cameraClient.cpp	2013-11-11 17:55:30 UTC (rev 1098)
@@ -118,11 +118,8 @@
 		this->refreshRate= totalRefreshRate / iterIndex;		
 		last=IceUtil::Time::now();
 
-		if (iterIndex == INT_MAX) 
-		{
+		if (iterIndex == INT_MAX)
 			iterIndex = 0;
-			std::cout << "*** Reinicio contador" << std::endl;
-		}
 		
 	}
 }

Modified: trunk/src/stable/libs/parallelIce/pointcloudClient.cpp
===================================================================
--- trunk/src/stable/libs/parallelIce/pointcloudClient.cpp	2013-11-11 11:28:28 UTC (rev 1097)
+++ trunk/src/stable/libs/parallelIce/pointcloudClient.cpp	2013-11-11 17:55:30 UTC (rev 1098)
@@ -74,6 +74,8 @@
 void pointcloudClient::run(){
 
 	IceUtil::Time last;
+	int iterIndex = 0;
+	int totalRefreshRate = 0;
 
 	last=IceUtil::Time::now();
 
@@ -97,8 +99,17 @@
 		else{
 			usleep(this->cycle - (IceUtil::Time::now().toMicroSeconds() - last.toMicroSeconds()));
 		}
-		this->refreshRate=(int)(1000000/(IceUtil::Time::now().toMicroSeconds() - last.toMicroSeconds()));
+		//this->refreshRate=(int)(1000000/(IceUtil::Time::now().toMicroSeconds() - last.toMicroSeconds()));
+		//last=IceUtil::Time::now();
+
+		int rate =(int)(1000000/(IceUtil::Time::now().toMicroSeconds() - last.toMicroSeconds()));
+		totalRefreshRate =  totalRefreshRate + rate;
+		this->refreshRate= totalRefreshRate / iterIndex;
 		last=IceUtil::Time::now();
+
+		if (iterIndex == INT_MAX)
+			iterIndex = 0;
+
 	}
 }
 



More information about the Jderobot-admin mailing list