From: Daniel S. <dsc...@ht...> - 2008-05-10 00:59:42
|
Hi, thx for your answer, this works fine now but when I call robot.read(); for the second time I got an memory access error. Do you have any idea whats the Problem? //***********************Client to Test my Pointcloud Driver***************** int main(int argc, char **argv) { px = new double (64*16); py = new double (64*16); pz = new double (64*16); printf("Hello Client\n"); PlayerClient robot("localhost"); // SonarProxy sp(&robot,0); printf("Hello Client\n"); Pointcloud3dProxy tof(&robot,0); //player_pose3d_t p3d; for(;;) { printf("Waiting for new Data!\n"); // read from the proxies puts("Robot.READ"); robot.Read(); puts("Robot.READ success" ); if (!tof.IsValid()) { puts("DataNot Valid"); //cout<<"NOT VALID"<<endl; return 0; } if(tof.IsFresh()){ std::cout<<"New Cloud data"<<std::endl; puts("Data Valid"); printf("GetCount: %f",tof.GetCount()); tof.NotFresh(); for(uint i=0; i< tof.GetCount(); i++) { puts("Spring hier rein Wi...."); /*std::cout<<"x "<<tof.GetPoint(i).point.px <<" y "<<tof.GetPoint(i).point.py <<" z "<<tof.GetPoint(i).point.pz<<std::endl;* px[i] = tof.GetPoint(i).point.px; py[i] = tof.GetPoint(i).point.py; pz[i] = tof.GetPoint(i).point.pz; printf("PX, PY, PZ: %f, %f, %f",px[i], py[i], pz[i]); } } } } //****************END OF CODE*************************** Thanks for your support. Cheers Daniel |