From: Marques, H. G <hg...@es...> - 2006-03-03 23:29:52
|
Hi... I tried to track the problem... and I have some more stuff that you = might want to have a look. I manage to obtain the laser interface using: CODE ******************************************* robot =3D new PlayerClient (host,port); System.out.println (" Connecting too: "+host+" port: "+port+"..."); try { Thread.sleep(3000); } catch (InterruptedException e) { e.printStackTrace(); //To change body of catch statement use File | = Settings | File Templates. } laserInterface =3D robot.requestInterfaceLaser(0, = PlayerConstants.PLAYER_PLAYER_REQ_DEV); END CODE = *************************************************************** Although, this seems unstable since sometimes the laser interface is = null. When I manage to have the laserInterface!=3Dnull I obtain null = afterwards when I try to call laserInterface.getData(). And if I try to = check whether the data is ready (laserInterface.isDataReady()) it never = is... I hope this helps... and I also hope that is an easy bug since I really = need to finish an experiment using Player2/stage2 this weekend... Thank you very much... 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/ =20 -----Original Message----- From: jav...@li... on behalf of Radu = Bogdan Rusu Sent: Fri 03/03/2006 22:57 To: jav...@li... Subject: Re: [Java-player-users] Javaclient2 = java.lang.ClassCastException: javaclient2.LaserInterface =20 Hi Hugo, I'll try to see if I can duplicate the problem and will reply shortly=20 with an explanation or a patch. Thanks for the report! Radu. Marques, Hugo G wrote: >Hello... > >I just installed the javaclient2 in my computer and have a couple of = questions... > >1 - First without the position interface, which interface should I use = to move the robot now? > >2 - Is there a sample agent which uses javaclient2? > >3 - I receive an exception when trying to request the laser interface = (data below)... > >Thank you in advance... >Hugo > > > >CODE **********************: > >{ >... >robot =3D new PlayerClient (host,port); >System.out.println (" Connecting too: "+host+" port: "+port+"..."); >LaserInterface =3D robot.requestInterfaceLaser(0,'a'); >System.out.println (" Laser... ok"); >blobInterface =3D robot.requestInterfaceBlobfinder(0, 'a'); >System.out.println (" Blob ... ok"); >... >} > >THE OUTPUT ******************** : > >Player v.2.0.0 > Connecting too: localhost port: 6665... >errorrrrrrrr >Laser... ok >Exception in thread "AWT-EventQueue-0" java.lang.ClassCastException: = javaclient2.LaserInterface > at = javaclient2.PlayerClient.requestInterfaceBlobfinder(PlayerClient.java:146= 1) > at minimalfirstx.Agent.initRobot(Agent.java:283) > at minimalfirstx.Agent.initialize(Agent.java:128) > at = architecturebuilder.gui.ArchitectureBuilder.initializeWithUserObject(Arch= itectureBuilder.java:550) > at = architecturebuilder.gui.ArchitectureBuilder.initialize(ArchitectureBuilde= r.java:524) > at = architecturebuilder.gui.ArchitectureBuilder.access$800(ArchitectureBuilde= r.java:45) > at = architecturebuilder.gui.ArchitectureBuilder$25.actionPerformed(Architectu= reBuilder.java:1504) > at = javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:1849) > at = javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:21= 69) > at = javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.jav= a:420) > at = javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:258) > at = javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonListe= ner.java:234) > at java.awt.Component.processMouseEvent(Component.java:5488) > at javax.swing.JComponent.processMouseEvent(JComponent.java:3126) > at java.awt.Component.processEvent(Component.java:5253) > at java.awt.Container.processEvent(Container.java:1966) > at java.awt.Component.dispatchEventImpl(Component.java:3955) > at java.awt.Container.dispatchEventImpl(Container.java:2024) > at java.awt.Component.dispatchEvent(Component.java:3803) > at = java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4212) > at = java.awt.LightweightDispatcher.processMouseEvent(Container.java:3892) > at java.awt.LightweightDispatcher.dispatchEvent(Container.java:3822) > at java.awt.Container.dispatchEventImpl(Container.java:2010) > at java.awt.Window.dispatchEventImpl(Window.java:1774) > at java.awt.Component.dispatchEvent(Component.java:3803) > at java.awt.EventQueue.dispatchEvent(EventQueue.java:463) > at = java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread= .java:242) > at = java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.j= ava:163) > at = java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:157) > at = java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:149) > at java.awt.EventDispatchThread.run(EventDispatchThread.java:110) > > > > > > >---------------------------------------------------- >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/ > > > > >------------------------------------------------------- >This SF.Net email is sponsored by xPML, a groundbreaking scripting = language >that extends applications into web and mobile media. Attend the live = webcast >and join the prime developer group breaking into this new coding = territory! >http://sel.as-us.falkag.net/sel?cmd=3Dk&kid=110944&bid$1720&dat=121642 >_______________________________________________ >Java-player-users mailing list >Jav...@li... >https://lists.sourceforge.net/lists/listinfo/java-player-users > =20 > --=20 | Radu Bogdan Rusu | http://rbrusu.com/ | http://www9.cs.tum.edu/people/rusu/ | Intelligent Autonomous Systems | Technische Universitaet Muenchen |