|
From: Maria S. <mar...@go...> - 2008-04-22 12:38:40
|
Hi,
I think I've read similar questions on the list but no answers to them
so I try again:
I understood that P/S 2.1 and Javaclient are to some extend but not
fully compatible, right!?
So with these software versions I simply try to control a pan-tilt-unit.
My problem is that I can read from the ptz once, then move it to a
desired position and then I can never read from it again, it loops
forever... surely this can't be a version problem!?
Here's the (very simple) code:
/ // read actual position data
System.out.println(robot.readAll());
while (!head.isDataReady()) {
robot.readAll();
}
PlayerPtzData data = head.getData();
float acttilt = data.getTilt();
float actpan = data.getPan();
System.out.println("actual pos ["+actpan+","+acttilt+"]");
System.out.println("moving to ["+pangoal+","+tiltgoal+"]");
// create a data structure that contains new position data and
pass to ptz-interface
PlayerPtzCmd direction = new PlayerPtzCmd();
direction.setPan(pangoal);
direction.setTilt(tiltgoal);
head.setPTZ(direction);
// now read new/actual position data
System.out.println(robot.readAll());
while (!head.isDataReady()) {
robot.readAll();
}
PlayerPtzData nextData = head.getData();
actpan = nextData.getPan();
acttilt = nextData.getTilt();
System.out.println("final pos ["+actpan+","+acttilt+"]");
/
If anyone can help me here, that would be great.
Thanks,
Maria
|