From: kristjan.liiva1 <kri...@gm...> - 2012-04-22 20:23:36
|
Hi, Could anyone help me out with some basics. I've been researching for some time and still don't fully undestand it. I'm trying to get the exact position for my robot. For that I'm using a position2d interface which has a parameters: localization "gps" localization_origin [0 0 0 0] I'm using code: PlayerClient robot = new PlayerClient("localhost", 6669); Position2DInterface posi = robot.requestInterfacePosition2D(0, 1); posi.setSpeed(1, 0); Thread.sleep(5000); posi.setSpeed(0, 0); robot.readAll(); while(posi.isDataReady() == false){ if(posi.isDataReady()) { System.out.println("ready"); break; } Thread.sleep(1000); System.out.println("waiting"); } System.out.println(posi.getX()); System.out.println(posi.getY()); System.out.println(posi.getYaw()); And posi.getX() always returns -5 (starting point of the robot). What am I doing wrong? The other thing is that, if I use "odom" instead of "gps" then it sometimes returns results which differ from each other by a factor of 2. |