From: Hugo G. M. <hg...@es...> - 2005-04-26 16:06:20
|
Hi... I'm starting to make my way through Player Stage and I started by changing the Test.java in order to make clear in my mind how the Java Client works... 1. However I have some really strange results... If I run the code below I can manage to have the position of the agent updated in every step... However if I uncomment the apparently innocent LaserPlayerDevice line I only have the first position and it is not updated in the println... 2. I'll need in the future the blogfinderdevice which I didn't find in java... Does someone know if I can find it somewhere? 3. According with what I saw so far... In order to move you give parameters like speed and angles... Can I control the wheels individually... Instead of using this sort of higher-level functions? Thanks in advance... Hugo +++++++++++++++++++++++++++ Test.java +++++++++++++++++++ package JavaClient.src; public class test { public static void main(String[] args) { String hostToConnect = args[0]; int portToConnect = Integer.parseInt(args[1]); PlayerClient robot = new PlayerClient(hostToConnect,portToConnect); PositionPlayerDevice ppd = robot.requestPosition(0, 'a'); // LaserPlayerDevice lpd = robot.requestLaser(0, 'a'); robot.runThreaded(-1, -1); for(int i = 0; ; i++) { robot.readAll(); for(int j = 0; j < 100000000; j++){} ppd.setSpeed(100, 0); System.out.println(ppd.getX() + " " + ppd.getY()); } } } |