|
From: Radu B. R. <ru...@cs...> - 2006-03-27 22:13:01
|
Ok, since the fix seems to affect more than one file (Player-wise),
ignore changing your player distribution for now, and use the latest
Javaclient2 CVS version. I just commited the latest changes which should
work with the *current* Player version (CVS). Once Player 2.1 is out, I
will change it.
Best,
Radu.
Radu Bogdan Rusu wrote:
> Aham!!! Evrika! ;)
>
> We just found another Player bug. The fix for this one is trivial
> though. I envision Player in a few months being 99.99% bug free at
> this rate! :)
>
> Unfortunately I don't have commit rights to that part of the
> repository (libplayercore)... so I'll ask Brian to do it for us now.
>
> If you don't want to "cvs" Player... go into player.h yourself, search
> for the player_graphics2d_cmd_points_t,
> player_graphics2d_cmd_polyline_t and player_graphics2d_cmd_polygon_t
> structures, and modify the first member from "uint16_t count;" to
> "uint16_t points_count;". Then recompile Player, and that should be it.
>
> There is one small fix for Javaclient2 as well... I am committing it
> now, and then waiting for Brian to patch Player, and probably test
> again in the morning.
>
> Cheers,
> Radu.
>
> Marques, Hugo G wrote:
>
>> Hi Radu...
>>
>> first of all thank's for the quick implementation of the interface...
>> I really needed it in order to continue my experiments...
>>
>> I tryed to run your code and it works perfectly... but if I try to
>> use an PlayerGraphics2dCmdPolyline object with the number of lines
>> smaller than 64 it simply does not show anything... I tryed to show a
>> simple line on Stage with only 2 points using the same idea you used
>> in the example and it did not work... Then I hacked slightly your
>> code (see bellow) in order to print only part of the circles and it
>> did not worked as well...
>>
>> I then tried to solve the issue with the class
>> PlayerGraphics2dCmdPolygon but I had the same problem. I tried to
>> went through the source code of playerclient and the
>> graphics2DInterface and it seemed fine to me...
>> Another thing that you might want to have a look in the class
>> PlayerGraphics2dCmdPolygon is that if you do not setFill_color it
>> gives an exception, when it could probably use a default
>> (transparent?) value...
>>
>> Thank you very much Regards...
>> Hugo
>>
>> ************************************* CODE *******************
>>
>> PlayerClient robot;
>> Graphics2DInterface graphicsInterface;
>>
>> robot = new PlayerClient ("localhost", 6665);
>> graphicsInterface = robot.requestInterfaceGraphics2D(0, 1);
>> robot.runThreaded(-1, -1);
>>
>> graphicsInterface.clearScreen ();
>>
>> PlayerGraphics2dCmdPolyline p = new PlayerGraphics2dCmdPolyline ();
>>
>> PlayerColor color = new PlayerColor ();
>> color.setAlpha (0);
>> color.setRed (0); color.setGreen (0); color.setBlue (0xff);
>> int lineSize = 32;
>> p.setCount (lineSize);
>>
>> for (double r = 0; r < 1.0; r += 0.05) {
>> PlayerPoint2d[] points = new PlayerPoint2d[lineSize];
>> for (int j = 0; j < lineSize; j++) {
>> points[j] = new PlayerPoint2d ();
>> points[j].setPx ((float)(r * Math.cos (j * Math.PI / 32)));
>> points[j].setPy ((float)(r * Math.sin (j * Math.PI / 32)));
>> System.out.println(" Point: "+points[j].getPx()+",
>> "+points[j].getPy());
>> }
>>
>> p.setPoints (points);
>> p.setColor (color);
>>
>> graphicsInterface.drawPolyline (p);
>>
>> try { Thread.sleep (100); } catch (Exception e) {
>> e.printStackTrace(); }
>>
>> ************************************* END CODE *******************
>>
>>
>>
>> ----------------------------------------------------
>> Hugo Gravato Marques, University of Essex, PhD Student
>> PHONE: +44 (0)7854917241, England or +351 962482416, Portugal
>> ADDRESS: University of Essex, Department of Computer Science,
>> Wivenhoe Park, Colchester Essex, CO4 3SQ, UK
>> WEB: http://privatewww.essex.ac.uk/~hgmarq/
>>
>>
>
--
| Radu Bogdan Rusu | http://rbrusu.com/
| http://www9.cs.tum.edu/people/rusu/
| Intelligent Autonomous Systems
| Technische Universitaet Muenchen
|