From: Toby C. <th...@us...> - 2007-12-02 20:29:44
|
Update of /cvsroot/playerstage/code/player/examples/libplayerc++ In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv28584/examples/libplayerc++ Modified Files: randomwalk.cc Log Message: stopped random walk seg faulting before sonar data arrived Index: randomwalk.cc =================================================================== RCS file: /cvsroot/playerstage/code/player/examples/libplayerc++/randomwalk.cc,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** randomwalk.cc 24 Oct 2007 22:32:03 -0000 1.4 --- randomwalk.cc 3 Dec 2007 04:29:45 -0000 1.5 *************** *** 32,38 **** --- 32,52 ---- if (gUseLaser) + { lp = new LaserProxy (&robot, gIndex); + // make sure we get some data + while(lp->GetCount() == 0) + { + robot.Read(); + } + } else + { sp = new SonarProxy (&robot, gIndex); + // make sure we get some data + while(sp->GetCount() == 0) + { + robot.Read(); + } + } std::cout << robot << std::endl; |