I don't know about the compress data part of this question.. but I had a
similar issue where isDataReady is only true when the camera interface
is first created. It was always false in subsequent reads.
The code below is an infinite loop for i >1
for i=1:2
while ~cami.isDataReady
robot.readAll;
end
end
Yes.. I am using matlab... but this is only an issue with the camera
interface, I didn't notice any bad behavior with sonar or laser interfaces.
I tried to trace the code and this is as far as I was able to to get.
- cami.isDataReady is only true if readyPcdata is true
- readyPcdata is true only if cami.readData(someheader) method is called.
- client.readAll calls read() which calls client.read (0, 0) which calls
client.readDataDevice (header) which calls ((PlayerDevice)deviceList.get
(i)).readData (header)...
so readDataDevice is calling readData every time readAll is invoked,
isDataReady should be reset.... unless the client does not consider the
camera as a device or something.
To put a bandaid over things.. I close the robot connection and reopen
it and the needed interfaces every time I get an image... yes...
every... single... time... sigh. it just seems wrong to do it that way
though.
*Re: [Java-player-users] Camera compress data never ready
<http://sourceforge.net/mailarchive/message.php?msg_name=9f3b4c660710010857s7c01cd3fve38e443a1eb56aac%40mail.gmail.com>*
From: <marcela22@gm...> - 2007-10-01 15:57
*Attachments:* Message as HTML
<http://sourceforge.net/mailarchive/attachment.php?list_name=java-player-users&message_id=9f3b4c660710010857s7c01cd3fve38e443a1eb56aac%40mail.gmail.com&counter=1>
I tried with your option but I didn't get anything, I also tried with the
runThreaded but is always the same, there is no data ready. I don't know wh=
y
with the camera device (no compress) works fine if I'm using the same
routine but the camera compress just read once.
Thanks
Marcela
---------- Forwarded message ----------
From: John Oliver <john.d.oliver@gm...>
Date: 01/10/2007 08:19
Subject: Re: [Java-player-users] Camera compress data never ready
To: java-player-users@li...
I think the problem is that you set PlayerClient to run not threaded, then
after the initial client.readAll(); you then enter the infinate loop:
while (!cami.isDataReady ());
and since there is no reading inside the loop to check for new data from
player once this loop starts it will never end. I think something like:
while (!cami.isDataReady ())client.readAll();
may work.
thanks
John
|