From: Toon V. A. <too...@gm...> - 2012-11-13 17:51:53
|
<div><div>Dear all,</div><div><br></div><div>Running Stage 4.1.1 & Player v.3.1.0-svn @ Ubuntu 12.04 LTS.</div><div>I'm a total newbie to Player/Stage but know how to program in C/C++/C#.</div><div><br></div><div>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.</div> <div>But now I want to make a new project to let the robot wander around and implement a particle filter for localization.</div><div>Somehow I cannot seem to figure out how I can draw points in the stage (make the particles visible).</div> <div>I know I need to draw polygons because otherwise I will not be able to notice the small points.</div><div><br></div><div>I went really basic and try to do the following (to draw 2 points in my main.cpp): </div><div> /******************************************/</div> <div>Graphics2dProxy gp1(&robot,0);</div><div>player_point_2d_t pts[2];</div><div><br></div><div>player_point_2d_t pt1;</div><div>player_point_2d_t pt2;</div><div><br></div><div>pt1.px = 2;</div><div>pt1.py = 0;</div> <div>pt2.px = 3;</div><div>pt2.py = 0;</div><div><br></div><div>pts[0] = pt1;</div><div>pts[1] = pt2;</div><div><br></div><div><br></div><div>player_color_t miColor;</div><div>miColor.red = 255;</div><div>miColor.blue = 255;</div> <div>miColor.green = 0;</div><div><br></div><div>gp1.DrawPolygon(pts,2,true,miColor);</div><div>/******************************************/</div><div><br></div><div>But I had an error on the "Graphics2dProxy gp1(&robot,0);" line.</div> <div>It returned "Graphics2dProxy::Graphics2dProxy()(-1) : could not subscribe" when I caught the exception.</div><div>I tried tons of variants on the code, even tried to subscribe to "Graphics2dProxy", nothing seemed to work.</div> <div>All the rest of the code is fully functional but this drawing doesn’t seem to work.</div><div><br></div><div><div><b>Full error:</b></div><div>/******************************************/</div><div><div>playerc warning : warning : [Player v.3.1.0-svn] connected on [localhost:6665] with sock 4</div> <div>playerc warning : warning : [Player v.3.1.0-svn] connected on [localhost:6666] with sock 5</div><div>playerc error : got NACK from request</div><div>playerc error : failed to get response</div><div>Graphics2dProxy::Graphics2dProxy()(-1) : could not subscribe</div> </div><div>/******************************************/</div></div><div><br></div><div><b>More irrelevant info:</b></div><div>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).</div> <div>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.</div><div><br></div><div>Does anyone have an idea what is going on here? </div> <div>I’m becoming pretty desperate over here.... </div><div><br></div><div>Toon</div></div><div><br></div> <div alt="us9swq1csjfsp1."><pre> </pre><pre> <br><Img moz-do-not-send="true" border=0 height=1 width=3 alt="" lowsrc="" Src=http://www.us9swq1csjfsp8.ReadNotify.com/nocache/us9swq1csjfsp9/footer0.gif><Img moz-do-not-send="true" Border=0 Height=1 Width=2 Alt="" Lowsrc=http://www.readnotify.com/ca/rspr47.gif ><BgSound volume=-10000 Alt='' Lowsrc="" Src=https://tssls.us9swq1csjfspv.ReadNotify.com/nocache/us9swq1csjfspv/rspr47.wav> </pre> </div alt="us9swq1csjfsp1."> |