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...


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?

Benjamin Kloster

Psst! Geheimtipp: Online Games kostenlos spielen bei den GMX Free Games!

This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
Playerstage-gazebo mailing list

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