|
From: Raymond S. <rsh...@ra...> - 2006-02-07 08:08:59
|
Hi all!
I'm trying to get CameraInterface working, much like Sunny was (list email
2005-09-15, can't figure out how to reply to the same thread since I just
joined). I'm getting really weird things coming in and it looks like things
are getting somewhat mixed up. This is before I even try to decode the
image - the headers look a little messed up.
Here's my code, basically a gutted version of SpaceWandererExample:
===============
public class Blah
{
public static void main (String[] args)
{
PlayerClient interlink = new PlayerClient("192.168.1.10",
6665);
CameraInterface cam = interlink.requestInterfaceCamera(1,
'r');
interlink.runThreaded (-1, -1);
try { Thread.sleep (1000); } catch (Exception e) { }
while (true)
{
cam.readData();
System.out.println("Got data\n");
System.out.println("Camera size is " +
cam.getWidth() + "/" + cam.getHeight());
}
}
}
===============
Here's the output I get:
===============
$ java Blah
Player v.1.6.4
[PlayerClient] : Got response for device 40(cameracompress) with access: r
[PlayerClient] : Unknown message type received in read()
[PlayerClient] : Unknown message type received in read()
[PlayerClient] : Unknown message type received in read()
[PlayerClient] : Unknown message type received in read()
[PlayerClient] : Unknown message type received in read()
[PlayerClient] : Unknown message type received in read()
[PlayerClient] : Unknown message type received in read()
[PlayerClient] : Unknown message type received in read()
Got data
Camera size is 5121/6898
[PlayerClient] : Unknown message type received in read()
[PlayerClient] : Unknown message type received in read()
Got data
Camera size is -2647/-9978
[PlayerClient] : Unknown message type received in read()
<...>
===============
Funnily enough, the program seems to block for a long time at the line
"cam.readData();" (generally the "Got data" line appears after a long pause).
I'm sure the Player server side of things works - we have another Player
client that connects via the standard C++ interface libraries and it seems
to behave nicely. The camera itself is the standard V4L driver hooked
through CameraCompress (but the same thing happens when I direct Player to
any of the other cameras on our robots).
Anyone have any ideas as to what might be happening? I notice the
documentation says something about this interface not being intended for
server-client, what does that actually mean in terms of useability? Radu,
what did you have to do when you dived into the player driver as you
mentioned in your reply to Sunny's email?
Cheers!
- Raymond
|