Nate Koenig wrote:
> Hello,
>
> Gazebo will set the model_name to and empty string once it has
> processed your request. So you should send your request, wait until
> the model_name is "", and then read the response.
>
> -nate
>   
On a related matter, there are race conditions if two clients try to use 
the simulation interface at the same time.
Client1: writes a request
Client2: wants to make a request, but lets say its clever, detects that 
model_name is not empty, and does nothing.
Server: fill in pose data, set model_name to 0
Client2: ah, model_name is now 0, so I fill my own request in...
Client1: oh noes, where did my anwser go?


All other interfaces don't have this problem, as it's the only one that 
process requests which require an anwser.
> On Thu, Apr 17, 2008 at 11:53 AM, Maciej Gabka <[EMAIL PROTECTED]> wrote:
>   
>>  hello
>>  I have got a little problem working with gazebo::SimulationIface, I have
>>  seen an example in the source directory
>>  simiface.cc. everything working with one robot , but I have a question how
>>  get positions from for example 2 robots.
>>  I try simply send 2 messages to the SimulationIface sth like that:
>>                 uint8_t name[512] = "hmt_test1";
>>                 uint8_t cmd[32] = "get_pose";
>>                simIface0->Lock(1);
>>                 client0->Query(0);
>>                 memcpy((simIface0)->data->model_name, name, 512);
>>                 memcpy((simIface0)->data->model_req,cmd, 32);
>>                 videoData.data[0]->pos.x = 
>> (simIface0)->data->model_pose.pos.x; //x
>>                 videoData.data[0]->pos.y = 
>> (simIface0)->data->model_pose.pos.y; //y
>>                 videoData.data[0]->rot = (simIface0)->data->model_pose.yaw;
>>                 simIface0->Unlock();
>>  This piece of code is in the while loop where I change uint8_t name[512] =
>>  "hmt_test1" into uint8_t name[512] = "hmt_test2" where hmt_test2 is the name
>>  of my second robot model.
>>  but changing the name in memcpy doesnt work...in all cases I recieve the
>>  same robot positions but sometimes  this is first robot position and
>>  sometimes second robot...its looks like client is not synchronized with the
>>  server..
>>
>>  Anybody can help me?
>>
>>  Thank you!
>>  maciek
>>  --
>>  View this message in context: 
>> http://www.nabble.com/gazebo-0.9-pre2-tp16750979p16750979.html
>>  Sent from the playerstage-gazebo mailing list archive at Nabble.com.
>>
>>
>>  -------------------------------------------------------------------------
>>  This SF.net email is sponsored by the 2008 JavaOne(SM) Conference
>>  Don't miss this year's exciting event. There's still time to save $100.
>>  Use priority code J8TL2D2.
>>  
>> http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone
>>  _______________________________________________
>>  Playerstage-gazebo mailing list
>>  [email protected]
>>  https://lists.sourceforge.net/lists/listinfo/playerstage-gazebo
>>
>>     
>
> -------------------------------------------------------------------------
> This SF.net email is sponsored by the 2008 JavaOne(SM) Conference 
> Don't miss this year's exciting event. There's still time to save $100. 
> Use priority code J8TL2D2. 
> http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone
> _______________________________________________
> Playerstage-gazebo mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/playerstage-gazebo
>
>   


-------------------------------------------------------------------------
This SF.net email is sponsored by the 2008 JavaOne(SM) Conference 
Don't miss this year's exciting event. There's still time to save $100. 
Use priority code J8TL2D2. 
http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone
_______________________________________________
Playerstage-gazebo mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/playerstage-gazebo

Reply via email to