I also noticed the warnings about "leftovers" in the
in the buffer on write().
Setting the reading frequency to 5Hz and reading the
data in a dedicated thread fixed the problem.
> Moshe Sayag wrote:
> > I am trying to write a new viewer for "player" and
> > control the robots, but unfortunately, the data
> > receive from the different devices (blob finder,
> > position, etc.) is lagged (30-60 seconds old).
> > Position readings, for example, are not accurate
> > the time I get them and in the camera I see things
> > that are no longer in the area.
> hi Moshe,
> Offhand, I would guess that your client (i.e., the
>viewer program) is
> not reading from the server often enough. You"ll
>know this is the
> problem if you see data backing up on the socket
>between client and
> server. In Linux, use "netstat" to check on sockets
>and their buffers,
> $ netstat -A inet -c
> Also the lag in the data would start out small and
>grow over time.
> If your client is indeed reading too slowly, then I
>can recommend some
> possible solutions.
Do you Yahoo!?
Yahoo! Mail - 250MB free storage. Do more. Manage less.
From: Brian Gerkey <gerkey@ai...> - 2005-01-19 17:38:36
Moshe Sayag wrote:
> I also noticed the warnings about "leftovers" in the
> in the buffer on write().
> Setting the reading frequency to 5Hz and reading the
> data in a dedicated thread fixed the problem.
Good to know that you fixed it. Any time you see the leftover warning
from the server, something is definitely going wrong and your client is
probably losing data.
A separate thread to interact with Player is a great solution. I've
also had success recently in GTK-based GUIs with registering a function
that checks the player socket as an idle callback (g_idle_add()), then
handing the event loop over to GTK (gtk_main()). This keeps everything
in one thread and works fine so long as your GUI doesn't do really
intense computation that would keep the socket from being serviced for a
Brian P. Gerkey gerkey@...
Stanford AI Lab http://ai.stanford.edu/~gerkey