Re: Running simulation > 10Hz

Rich Mattes <[email protected]>
Newsgroups gmane.science.robotics.playerstage
Message-ID <[email protected]>
On 04/17/2013 10:44 AM, ulle wrote:
> Hi again
>
> I tried the writelog thing, and the data stored in the log file has updated
> at 100Hz. But the data my client program obtains is only a small fraction of
> that.
> I measured the time my client program takes to wait for the data compared to
> how long it takes to execute other stuff in my loop. My code takes usually
> less than 1ms while the Read() function takes 50-300ms.
Ok, so all of the messages are showing up in the log, meaning Player is 
at least getting all of them.  However, the blocking behavior you see at 
the PlayerClient is troubling.  Read() shouldn't take very long if 
there's a lot of data present, unless you're overflowing the client's 
buffers and getting out of whack.  You might try setting the replace 
rule [1] for position2d or ranger messages so you're guaranteed not to 
overflow your message queue on the Player server. It may still result in 
dropped messages, but could help with Read().  You can also try 
ReadIfWaiting(), which is supposed to be non-blocking.
> I provide a text file with a few debug outputs for three loops that include
> elapsed time, odo and ranger data. Then the log data follows where I have
> marked those instances corresponding to the debug outputs.
> (For some reason the ranger data in the log consists of one correct line and
> one line with 0.5 at all measurements.)
If you look more closely, you'll see that there are actually two message 
types being sent out by Stage over the ranger interface: 
PLAYER_RANGER_DATA_RANGE (001) and PLAYER_RANGER_DATA_INTENS (003). 
Definitions for the ranger interface message types are at [2], and the 
readlog/writelog magic decoder ring is at [3].

[1] 
http://playerstage.sourceforge.net/doc/Player-svn/player/classPlayerCc_1_1PlayerClient.html#a496845414a96f05d3abb16a3a267b7e2
[2] 
http://playerstage.sourceforge.net/doc/Player-svn/player/group__interface__ranger.html 

[3] 
http://playerstage.sourceforge.net/doc/Player-svn/player/group__tutorial__datalog.html

Rich



------------------------------------------------------------------------------
Precog is a next-generation analytics platform capable of advanced
analytics on semi-structured data. The platform includes APIs for building
apps and a phenomenal toolset for data science. Developers can use
our toolset for easy data analysis & visualization. Get a free account!
http://www2.precog.com/precogplatform/slashdotnewsletter
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.