From: Radu B. R. <ru...@cs...> - 2005-12-16 09:49:20
|
Hello Alberto, Sorry for replying so late (hmm, looks like I'm the only one actually doing that on this mailing list :)). I just uploaded a basic Blobfinder example to the Javaclient examples web page. Maybe that will help. Please modify your source code according to the following guidelines, and try again: - before the while (true), add a line like "robot.runThreaded (-1, -1);" - remove the "bfi.readData();" from the main while loop; - add a delay such as "try { Thread.sleep (100); } catch (Exception e) { }" in the main while loop. I don't know about Gazebo, but I will have a look. Best regards, Radu. -- | Radu Bogdan Rusu | http://rbrusu.com/ | http://www9.cs.tum.edu/people/rusu/ | Intelligent Autonomous Systems | Technische Universitaet Muenchen Alberto Amengual wrote: > Hello everybody, > > This is the first time I am using javaclient and also Player/Gazebo. I > am trying to detect a blue cylinder using blobfinder, but it's not > working. I don't know if my problem is the way I am using the java > client, or might be related with the color file in cmvision, or other > things. > > In the world file, I have a Pioneer2AT robot with a SonyVID30 camera, > and a couple of SimpleSolids, one of which is a cylinder, with > <color>0.0 0.0 1</color> (the others are not blue). > > Then, in the player file, I have > > driver > ( > name "gz_camera" > provides ["camera:0"] > gz_id "camera1" > ) > > driver > ( > name "cmvision" > provides ["blobfinder:0"] > requires ["camera:0"] > colorfile ["colorfile"] > ) > > The client code I am trying is: > > PlayerClient robot = new PlayerClient("localhost", 6665); > BlobfinderInterface bfi = new robot.requestInterfaceBlobFinder(0,'r'); > short numBlobs = 0; > bfi.setTrackingColor(0,0,0,0,250,255); > while (true) { > bfi.readData(); > numBlobs = bfi.getBlobCount(); > System.out.println("num blobs="+numBlobs); > } > > I get different values back for num blobs (0, 10, 88, 4608, ...), and > also sometimes in the client I get an "outofBounds" exception, > "Error when reading payload: java.lang.ArrayIndexOutOfBoundsException: > 256", I guess that the number of "detected" blobs might be too big. > > Anybody can help??? > > > > Many thanks, > > Alberto Amengual |