Hi,
=20
> import javaclient.*;
> import java.io.*;
>=20
> public class Test
> {
> public static void main(String[] args) {
>=20
> PlayerClient robot =3D new PlayerClient("localhost",6665);
> PositionInterface ppd =3D robot.requestInterfacePosition(0, =
"w");
> LaserInterface lpd =3D robot.requestInterfaceLaser(0, "a");
>=20
> =20
> robot.runThreaded(-1, -1);
> =20
> ppd.resetOdometry();
> =20
> ppd.setSpeed(0, 70);
> for(;;)
> {
> =09
> ppd.readData();
=20
You don"t need to call readData if you"re running in the threaded mode. =
Try
removing "ppd.readData();" and add just add a small delay in front of =
your
println:
try {
Thread.sleep (100);
} catch (Exception e) {}
=20
> System.out.println("[x:"+ppd.getX()+", y:"+ppd.getY()+",
> yaw:"+ppd.getYaw()+"]");=20
>=20
> } =20
> }
> }
>=20
When I remove ppd.readData(); all I get is zeros for x, y and yaw. Also, =
whether or not I run in the threaded mode doesn't have any influence on =
the position data. What else could be the problem?
Thanks for any help,
Steffen
|