|
From: Alberto A. <ame...@IC...> - 2005-12-12 22:19:06
|
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
|