[Jderobot-admin] jderobot-r1131 - trunk/src/stable/libs/parallelIce
rocapal en jderobot.org
rocapal en jderobot.org
Jue Dic 26 16:52:04 CET 2013
Author: rocapal
Date: 2013-12-26 16:52:03 +0100 (Thu, 26 Dec 2013)
New Revision: 1131
Modified:
trunk/src/stable/libs/parallelIce/CMakeLists.txt
trunk/src/stable/libs/parallelIce/cameraClient.cpp
Log:
#123 fixed bug about sleep with unsigned int
Modified: trunk/src/stable/libs/parallelIce/CMakeLists.txt
===================================================================
--- trunk/src/stable/libs/parallelIce/CMakeLists.txt 2013-12-16 22:54:27 UTC (rev 1130)
+++ trunk/src/stable/libs/parallelIce/CMakeLists.txt 2013-12-26 15:52:03 UTC (rev 1131)
@@ -6,10 +6,10 @@
include_directories( ${LIBS_DIR}/)
add_library (parallelIce STATIC cameraClient.cpp cameraClient.h pointcloudClient.cpp pointcloudClient.h laserClient.cpp laserClient.h)
-TARGET_LINK_LIBRARIES(parallelIce colorspacesmm)
+TARGET_LINK_LIBRARIES(parallelIce colorspacesmm ${Boost_LIBRARIES})
add_library (parallelIceshare SHARED cameraClient.cpp cameraClient.h pointcloudClient.cpp pointcloudClient.h laserClient.cpp laserClient.h)
-TARGET_LINK_LIBRARIES(parallelIceshare colorspacesmmshare)
+TARGET_LINK_LIBRARIES(parallelIceshare colorspacesmmshare ${Boost_LIBRARIES})
set_target_properties(parallelIceshare PROPERTIES OUTPUT_NAME parallelIce)
Modified: trunk/src/stable/libs/parallelIce/cameraClient.cpp
===================================================================
--- trunk/src/stable/libs/parallelIce/cameraClient.cpp 2013-12-16 22:54:27 UTC (rev 1130)
+++ trunk/src/stable/libs/parallelIce/cameraClient.cpp 2013-12-26 15:52:03 UTC (rev 1131)
@@ -109,12 +109,19 @@
localData.copyTo(this->data);
this->controlMutex.unlock();
- if ((IceUtil::Time::now().toMicroSeconds() - last.toMicroSeconds()) > this->cycle ){
+ int delay = this->cycle - (IceUtil::Time::now().toMicroSeconds() - last.toMicroSeconds());
+
+ if (delay > this->cycle ){
if (this->debug)
std::cout<<"--------" << prefix << " adquisition timeout-" << std::endl;
}
else{
- usleep(this->cycle - (IceUtil::Time::now().toMicroSeconds() - last.toMicroSeconds()));
+
+ if (delay < 1 || delay > this->cycle)
+ delay = 1;
+
+ usleep(delay);
+
}
int rate =(int)(1000000/(IceUtil::Time::now().toMicroSeconds() - last.toMicroSeconds()));
More information about the Jderobot-admin
mailing list