Hi
   I have tried to get the color of the robot using GetProperty as you have suggested. I tried setting the data type of color as char and uint32_t however I am not getting a valid answer.
My code has the following lines:

    PlayerClient robo("localhost");
    SimulationProxy sp(&robo, 0);
    for (;;)
    {
     uint32_t *color;
     sp.GetProperty("r2","color", &color,sizeof(uint32_t));
     std::cout << "COLOR"<<*color << std::endl;
    }

   However I seem to be getting the following response irrespective of the color I set robot r2 to in the world file.
 OUTPUT:
   playerc error   : got NACK from request
   COLOR48080
   playerc error   : got NACK from request
   COLOR48080
   playerc error   : got NACK from request
   COLOR48080
   playerc error   : got NACK from request
   COLOR48080
   playerc error   : got NACK from request
   COLOR48080
   playerc error   : got NACK from request
   COLOR48080
 I am using the CVS version of Player and  stage 2.10 RC. Any help with this would be appreciated.

Regards
Eshwaran

On Mon, Mar 3, 2008 at 11:46 PM, Brian Gerkey <brian@gerkey.org> wrote:

On Feb 22, 2008, at 1:53 AM, Andy Guest wrote:
>  Probably a stupid question but is there a way for a simulated robot
> to identify what colour it is ? If I've got ten copies of the same
> control code running on ten separate robots in a stage world, where
> the color for each robot is set in the cfg file, say 3 red, 3 blue
> and 4 green, is there anyway for the control program of any given
> robot to know what color it is ?

I believe that you can get this information as a property via the
'simulation' interface, assuming that you know the robot's name (as
assigned in the .world file, using the 'name' option).  This is not
quite the same as asking the robot directly, but should do the trick.

       brian.

-------------------------------------------------------------------------
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-users mailing list
Playerstage-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/playerstage-users