wiki:WikiStart/Toolchain/ReadingLogData

Reading log data without a full installation of Rock

Sometimes it is useful to be able to access the log data created by the Rock framework, without installing an entire Rock. The log data, which by default is generated from all the modules used in Rock is using the pocolog dataformat. This stores metadata in the file, so that the data can be retrieved in a meaningful way, even if the original types have already changed.

Currently the pocolog package has a few dependencies, which make it impractical to install it manually. The easiest way is to get a bare installation of the rock build system, and a buildconfig, which only has pocolog in it.

Note: This procedure is strictly local, and you won't clutter up your system outside of the selected directory.

Installing Pocolog

  • You need a linux supported by Rock, as well as ruby installed on your system
  • Create a new directory and step into it

mkdir pocolog ; cd pocolog

  • Get the boostrap shell script

wget https://gitorious.org/rock/buildconf-bare/raw/31cdb91b7cfe345a980dc624b6e599a50dedb104:bootstrap.sh -O bootstrap.sh

  • Run the bootstrap command - and use the default option for all questions

sh bootstrap.sh

  • Wait for the build to finish, and the source the environment

source env.sh

You are done now. You should be able to call pocolog --help which will give you the options of the pocolog tool.

Short course on using pocolog

Once you have pocolog installed, you can run it on your logfiles.

% pocolog xsens_imu.0.log 
File data is in little endian byte order
pocolog.rb[INFO]: loading file info from ./xsens_imu.0.idx... 
Stream xsens_imu.calibrated_sensors [/base/samples/IMUSensors_m]
  18101 samples from Thu 03/03/2011 17:41:40 to Thu 03/03/2011 17:44:40 [0:03:00.976]
Stream xsens_imu.orientation_samples [/base/samples/RigidBodyState_m]
  18102 samples from Thu 03/03/2011 17:41:40 to Thu 03/03/2011 17:44:40 [0:03:00.986]

This shows that in the xsens_imu.0.log file, there are two streams embedded. The first stream is called xsens_imu.calibrated_sensors, and is of type /base/samples/IMUSensors_m the second stream is called xsens_imu.orientation_samples, and has type /base/samples/RigidBodyState_m.

The command

% pocolog xsens_imu.0.log --show xsens_imu.orientation_samples

Will dump the entire content of the stream. The first line is a header giving the names of the fields. The field names are hierarchical, so you can select subfields to show if you are only interested in parts of the data.

The next command for example will only show the orientation data (quaternion) with the real and the imaginary part. The to option shows the data entries up to this index.

% pocolog xsens_imu.0.log --show xsens_imu.orientation_samples --fields orientation --to 1
pocolog.rb[INFO]: loading file info from ./xsens_imu.0.idx... 
orientation.im[0] orientation.im[1] orientation.im[2] orientation.re
0.22480970621109009 0.29827189445495605 -0.56142556667327881 0.73844146728515625
0.22483809292316437 0.298296719789505 -0.56142890453338623 0.73842024803161621
Last modified 6 years ago Last modified on 03/06/14 16:04:12