You need to specify that one or more of the models accessed by the Stage driver should provide the graphics2d interface in your.cfg file, like so:

† name "stage"
† provides [ "position2d:0" "ranger:0" "ranger:1" "graphics2d:0" ]
† model "myrobotname"†

The origin of the graphics coordinate system moves with the model, so choose either your robot(s) or the map model appropriately.

- rtv

On Tue, Nov 13, 2012 at 9:33 AM, Toon Van Assche <> wrote:
Dear all,

Running Stage 4.1.1 & Player v.3.1.0-svn @ Ubuntu 12.04 LTS.
I'm a total newbie to Player/Stage but know how to program in C/C++/C#.

I already managed to let a robot wander around, do some collision detection and let it drive to fiducials when they are in the range of the sensor.
But now I want to make a new project to let the robot wander around and implement a particle filter for localization.
Somehow I cannot seem to figure out how I can draw points in the stage (make the particles visible).
I know I need to draw polygons because otherwise I will not be able to notice the small points.

I went really basic and try to do the following (to draw 2 points in my main.cpp):†
Graphics2dProxy gp1(&robot,0);
player_point_2d_t pts[2];

player_point_2d_t pt1;
player_point_2d_t pt2;

pt1.px = 2; = 0;
pt2.px = 3; = 0;

pts[0] = pt1;
pts[1] = pt2;

player_color_t †miColor; = 255; = 255; = 0;


But I had an error on the "Graphics2dProxy gp1(&robot,0);" line.
It returned "Graphics2dProxy::Graphics2dProxy()(-1) : could not subscribe" when I caught the exception.
I tried tons of variants on the code, even tried to subscribe to "Graphics2dProxy", nothing seemed to work.
All the rest of the code is fully functional but this drawing doesnít seem to work.

Full error:
playerc warning † : warning : [Player v.3.1.0-svn] connected on [localhost:6665] with sock 4
playerc warning † : warning : [Player v.3.1.0-svn] connected on [localhost:6666] with sock 5
playerc error † : got NACK from request
playerc error † : failed to get response
Graphics2dProxy::Graphics2dProxy()(-1) : could not subscribe

More irrelevant info:
My map is 10 meter by 5 meter and I use 2 robots, one without a simulation error (robot) and one with the error (robot2).
I have 6 fiducials placed in the map right now (top left, top center, top right, bottom right, bottom center, bottom left) as in the robocup.

Does anyone have an idea what is going on here?†
Iím becoming pretty desperate over here....†


Monitor your physical, virtual and cloud infrastructure from a single
web console. Get in-depth insight into apps, servers, databases, vmware,
SAP, cloud infrastructure, etc. Download 30-day Free Trial.
Pricing starts from $795 for 25 servers or applications!
Playerstage-users mailing list