From: Radu B. R. <ru...@cs...> - 2006-03-05 21:45:33
|
Hi Hugo, First of all, MANY THANKS for the bug reports! I managed to fix both bugs, but the CVS at SF doesn't work for me right now. I will try to commit the changes in the morning. I also found a bug in the SonarInterface, and fixed that one too. Cheers, Radu. Marques, Hugo G wrote: >Hi... > > I found the reason why it was given the exception. the reason was that in the method readAll of PlayerClient when the test is.available was being made some times there was nothing. Since I'm really in a hurry I made a sort of dirty fix that you might want to have a look: > >********************* code > > public void readAll () { > > if (isThreaded) return; > try { > int i=0; // Added by HGM > while(is.available() == 0){ // Added by HGM > if (i>10000) break; // Added by HGM > i++; // Added by HGM > } // Added by HGM > > while (is.available() != 0){ > if (read () == PLAYER_MSGTYPE_SYNCH){ > break; > } > } > } catch (IOException e) { > throw new PlayerException ("[PlayerClient]: Error reading data",e); > } >// while (read () != PLAYER_MSGTYPE_SYNCH); > } > >****************************** end code > >regards... >Hugo > >---------------------------------------------------- >Hugo Gravato Marques, University of Essex, PhD Student >PHONE: +44 (0)7854917241, England or +351 962482416, Portugal >ADDRESS: University of Essex, Department of Computer Science, >Wivenhoe Park, Colchester Essex, CO4 3SQ, UK >WEB: http://privatewww.essex.ac.uk/~hgmarq/ > > > > > > > >-----Original Message----- >From: jav...@li... on behalf of Marques, Hugo G >Sent: Sat 04/03/2006 18:17 >To: jav...@li... >Subject: RE: [Java-player-users] InterfacePosition2D > > >Hello... > >thanks for the reply... I've double checked my code and there is no refences (not even in the classpath) to javaclient1.6.5. I already manage to control the robot's movement but the method setSpeed(int,int) is in my code of javaclient2: > > public void setSpeed (int speed, int turnrate) { > PlayerPose pp = new PlayerPose (); > pp.setPx (speed); > pp.setPa (turnrate); > setVelocity (pp, 1); > } > >I agree with you that it should not be there has it looks compliant with the previous version but in fact the speed and turnrate are different now... > >I also tried to investigate a bit further the ClassCastException and I believe that the mistake is on the player (or stage) side. It seems to me that there are variables not properly instantiated and that is somteimes it works and sometimes don't... the PlayerClient code looks fine to me... > >actually the error only happens when I receive only this message from stage: >Player v.2.0.0 > >Rather than: > >Player v.2.0.0 >selected devices [localhost:6666]: > 6666:position2d:0 (stage) > 6666:sonar:0 (stage) > 6666:laser:0 (stage) > 6666:blobfinder:0 (stage) > 6666:fiducial:0 (stage) > >I hope this helps... once again thanks... >Hugo > > > > > > >---------------------------------------------------- >Hugo Gravato Marques, University of Essex, PhD Student >PHONE: +44 (0)7854917241, England or +351 962482416, Portugal >ADDRESS: University of Essex, Department of Computer Science, >Wivenhoe Park, Colchester Essex, CO4 3SQ, UK >WEB: http://privatewww.essex.ac.uk/~hgmarq/ > > > > > > > >-----Original Message----- >From: jav...@li... on behalf of Radu Bogdan Rusu >Sent: Sat 04/03/2006 09:30 >To: jav...@li... >Subject: Re: [Java-player-users] InterfacePosition2D > >Hi Hugo, > > >Marques, Hugo G wrote: > > > >>Hi... >> >> >> >> >I just woke up, so I didn't have a chance to look at the problem yet >(will do soon), but... > > > >>Apart from this error I was wondering how can I make the robot move smoother and slower since even with setSpeed(1,1) it drives too fast... At the moment I can't actually control the direction of the movement... How can I solve this? >> >> >> >> >This is not good... setSpeed was removed in Javaclient2 completely! >Instead we have setVelocity (PlayerPose,int). PlayerPose has float >structures so no need to send integers. Are you using a mix between >Javaclient 1.6.5 and Javaclient2 ? > > > >>Cheers, >>Hugo >> >> >> >> >Cheers back :) >Radu. > > > -- | Radu Bogdan Rusu | http://rbrusu.com/ | http://www9.cs.tum.edu/people/rusu/ | Intelligent Autonomous Systems | Technische Universitaet Muenchen |