Hi Hugo,
You are *quick*! :) But okay, I got this one covered...
The simulation interface has a data (and a command for that matter)
placeholder indeed, but they are not used. If you want to get/set the
Pose, you need to do something like this:
public static void testSimulation (SimulationInterface simi) {
simi.get2DPose("p0");
if (simi.isPose2DReady ()) {
PlayerSimulationPose2dReq pose =
simi.getSimulationPose2D ();
System.err.println (writePose (pose));
}
PlayerPose pp = new PlayerPose ();
pp.setPx(1);
pp.setPy(1);
pp.setPa(1);
simi.set2DPose("p0", pp);
}
...For example.... (writePose is just a method that parses the values
nicely).
So isDataReady() is useless in this case, since Stage will never send
Simulation data (for now).
If you let me drink my morning coffee, I will commit the changes, and
upload three of the previous Javaclient1.6.5 examples that I modified
last night for 2.x, as well as some general test routines for 13 interfaces.
Radu.
Hugo Marques wrote:
>Hi again...
>
>I was trying to understand how can I extract the position of the agent from
>the simulation interface but my code gets stuck in the line:
>
>while (!simulationInterface.isDataReady());
>
>since the method isDataReady() returns allways false. (the method
>simulationInterface.isPose2DReady() also returns always false).
>
>In my configuration file I have
>
>driver
>(
> name "stage"
> provides ["6666:simulation:0"]
> plugin "libstageplugin"
> worldfile "everything.world"
>)
>
>and stage accepts the driver since the the method
>robot.requestInterfaceSimulation(0, 1) is different from null;
>
>How can I put the simulation interface working?
>
>cheers,
>Hugo
>
>
>
>
>-------------------------------------------------------
>This SF.Net email is sponsored by xPML, a groundbreaking scripting language
>that extends applications into web and mobile media. Attend the live webcast
>and join the prime developer group breaking into this new coding territory!
>http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642
>_______________________________________________
>Playerstage-users mailing list
>Pla...@li...
>https://lists.sourceforge.net/lists/listinfo/playerstage-users
>
>
--
| Radu Bogdan Rusu | http://rbrusu.com/
| http://www9.cs.tum.edu/people/rusu/
| Intelligent Autonomous Systems
| Technische Universitaet Muenchen
|