From: Vitalijs K. <vit...@gm...> - 2015-11-29 12:02:45
|
Hi! Could you please describe in details what exactly you understand with successful and unsuccessful code execution. Where exactly your code stops or does something unexpected? I have used something very similar to your code [1], with only difference that I had small delay between subsequent data readiness checks. There is one feature worth to mention about. >From source code of Ranger (and most others) interface: ... public boolean isDataReady () { if (readyPrdata) { readyPrdata = false; return true; } return false; } ... This function returns true only once per data reading cycle. In that sense your code is a bit redundant System.out.println(rngi.isDataReady ()); // if this will return true while (!rngi.isDataReady ()); // then this will wait till next data exchange tick. [1] https://github.com/Vitaljok/mrs-optimization/blob/master/robot-sim/rkv/rkv_1/src/rkv_1/Main.java Vitālijs 2015-11-27 18:18 GMT+02:00 Vikas Chauhan <vik...@gm...>: > Hi, > I am executing a Player Stage program in java using javaclient3 on > eclipse. I have attached the java sample program .On my ubuntu system > somtimes this code executes and manytimes not( like if i try 9 times it > executes only one time) > I think The main problem is with > while (!rngi.isDataReady ()); > method , for sonar it is not able to executes but it executes successfully > for laser. > by luck it gets values of sonar sometime (once in 9 time) , I want to know > the reason why it is happening. I think isDataReady() method has some > problem or javaclient3 jar has some problem. > while (!rngi.isDataReady ()); > sonarValues = rngi.getData ().getRanges (); > Kindly suggests the solution because this code is excuting successfully > everytime on my friend's ubuntu system with same configuration but on my > system it is not executing. We have invested 4 days to know the reason why > it is happening that it is executing randomly very few time on my system > but on my friend's system is is executng successfully. > > > Thanks and regards > vikas chauhan > > > > > ------------------------------------------------------------------------------ > > _______________________________________________ > Java-player-users mailing list > Jav...@li... > https://lists.sourceforge.net/lists/listinfo/java-player-users > > |