From: Eyup C. <eyp...@gm...> - 2008-03-25 23:00:11
|
Hello, I have written the below C++ program in order to test and make an estimate about how much time does it take for my P3DX robot when reading via its laser sicklms sensor however when i run my client program although i see laser sensor starts activation it gives the following warning and errors warning:timeout warning:timeout warning:timeout warning:timeout error: unable to connect laser does anybody have any idea about where I am making mistake ? many thanks Eyup #include <libplayerc++/playerc++.h> #include <iostream> #include <ctime> #include "args.h" using namespace std; using namespace PlayerCc; double diffClock(clock_t clock1, clock_t clock2){ double diffticks=(double) clock1-clock2; double diffms=(diffticks*10)/CLOCKS_PER_SEC; return diffms; } int main(int argc, char **argv) { parse_args(argc,argv); PlayerClient robot (gHostname, gPort); LaserProxy lp(&robot, gIndex); robot.Read(); int laserCount=0; laserCount=lp.GetCount(); cout<<"laserCount: "<<laserCount<<endl; clock_t start=clock(); for(int i=0;i<laserCount;i++) { cout<<i<<"laser reading "<<lp[i]<<endl; } clock_t ends=clock(); cout << diffClock(ends, start)<<endl; return 0; } |