I believe you need to pass that struct for GetProperty to store its result in and then convert the output of the struct to a double yourself...however it should not segfault, a patch for some memory bounds checking there would be good...

Toby

On 05/03/2008, Benjamin Kloster <ben-kloster@gmx.de> wrote:
Hello everyone,
I am creating the interface between Player and the control software of my workgroup. Manipulating an ActArray works, but when I try to use the SimulationProxy to ask for the sim_time property, I get a segfault. Asking for the 3D pose works, though. I have attached the config file for Player I use. The code I use to request the property looks roughly like this:

double simtime = 0;
simulation->GetProperty("sim_time", "world", &sim_time, sizeof(double));

Where "simulation" is of the type simulation proxy that I can ask for the pose of my robot without problems, so it seems to be properly initialized.

When digging in the Player code, I can narrow the problem down to line 233 of dev_simulation.c in libplayerc:
memcpy(value, resp->value, value_len);

In my case, "value" is the pointer to simtime, "value_len" is sizeof(double) and from what I understand of the code, "resp" is a struct where the response of Gazebo is saved.

Am I doing something wrong? Is it an error of Gazebo, Player or something entirely different?

Regards,
Benjamin Kloster

--
Psst! Geheimtipp: Online Games kostenlos spielen bei den GMX Free Games!
http://games.entertainment.web.de/de/entertainment/games/free

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Playerstage-gazebo mailing list
Playerstage-gazebo@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/playerstage-gazebo





--
This email is intended for the addressee only and may contain privileged and/or confidential information