Hi
I'm quite a newbie and I have a newbie's question about Position2Dinterface.
I'm using player-2.0.3 on wbr914 robot and I encountered some problems using
Position2dinterface.
I use the javaclient-2.0.1.jar
The problem is that I can't see position2D updates while reading the
position data in the infinite loop.
playerv works just fine...
I'm trying to do this way:
................
robot = new PlayerClient(ROBOT_IP, ROBOT_PORT);
p2di = robot.requestInterfacePosition2D(0, PlayerConstants.PLAYER_OPEN_MODE
);
robot.requestDataDeliveryMode(PlayerConstants.PLAYER_DATAMODE_PUSH);
robot.setNotThreaded();
p2di.setMotorPower(1);
while (runTest) {
robot.readAll();
positionTest(p2di); // this prints the position2d data on screen
Thread.sleep(1000);
System.out.println("=======================================");
}
Whats interesing that when I
run the playerv, subscribe to see the position data on playerv screen
and AFTER THAT run my simple program - I Do receive the updated data.
However when I make my robot move, the data reading fails (irrelevant data
is printed). I saw the code from the example (actually my code is c/p from
there... but it doesn't work...).
So could anyone please point me on my problem or provide some working code?
Any help is highly appreciated :)
Thanks in advance
Mark Bramnik
|