Sorry for multiple request about this topic, but there was a mistake in the mailing lit and it was posted a question with my subject but with another question in the body of the message.
My question was:
I am startirg using JavaClient for Player Stage.
I have downloaded the Javaclient 2.0.1 version and I am trying to run the examples (space wanderer, wall follower, etc.) but it seems like something is wrong.
When I try to debug the application, the PlayerClient object is created succesfully, so I suppose the connection to player server is ok, and the requestInterfacePosition2D method is ok also.
however, when the PlayerClient object tries to call requestInterfaceSonar method, it returns a null reference. The same happens with laser and other devices.
I changed the method invocation order, so I call first the requestInterfaceSonar(0, PlayerConstants.PLAYER_OPEN_MODE) method, and after I call the requestInterfacePosition2D (0, PlayerConstants.PLAYER_OPEN_MODE) method. In this case, the PlayerClient returns an interface for the sonar.
Nevertheles, the robot does't move in spite of it sets a velocity of 0.2 en each step. I am printing out the position of the robot and this is always the same, it is not updated, so it get always the same sonar readings. I have set the MotorPower method to enabe anyway. I am using a Player Stage simulation, not a real-world robot.
Summarizing, I have these questions.
- The method invocation has an specific order? why does in the examples always call first the requestInterfacePosition2D method and it doesn't work in my simulation (I have to call first the request for the sonar interface)?
- Why my robot doesn't move? I have seen the C++ examples and always put the line setMotorEnable(true), so I did the same in java: setMotorPower(1), but it doesn't work neither.
Thank you very much for your help!
Disfruta antes que nadie del nuevo Windows Live Messenger
Anímate y disfruta con los mejores juegos de Messenger, ¡descúbrelos!