[Rock-dev] Generating one gnuplot data file from different logs

Leif Christensen leif.christensen at dfki.de
Tue Jun 18 13:19:00 CEST 2013


Hi,

I'm generating my own (gnuplot) data file from different orocos log 
files using this script:

   1 #! /usr/bin/env ruby
   2 require 'orocos/log'
   3 include Orocos
   4
   5 replay = Log::Replay::open("xsens_imu.0.log", "sysmon.0.log")
   6
   7 replay.sysmon.system_status.tracked = true
   8 replay.xsens_imu.calibrated_sensors.tracked = true
   9
  10 #reader1 = replay.xsens_imu.calibrated_sensors.reader
  11 #reader2 = replay.sysmon.system_status.reader
  12
  13 replay.align
  14
  15 replay.run do |port,data|
  16 #  puts reader1.read
  17 #  puts reader2.read
  18   t     = data.time if port.name == 'system_status' or 
'calibrated_sensors'
  19   enc   = data.asguardJointEncoder if port.name == 'system_status'
  20   magx  = data.mag[0] if port.name == 'calibrated_sensors'
  21   if magx.nil?
  22      puts "magx nil!"
  23   elsif t.nil?
  24     puts "t nil"
  25   elsif enc.nil?
  26     puts "enc nil"
  27   else
  28     printf "%016.4f %6.4f %6.4f\n", t.to_f, enc, magx
  29   end
  30 end

Writing the script, several questions pop up:

a) is the replay.align call necessary or already done inside open/load?
b) is this call doing what I hope, sorting the samples of the different 
streams for the replay
c) if so, is it using logical/writing or sample time (if the sample 
provides a time) to sort
d) When accessing 'data' in the replay.run loop, one of the values is 
always nil:

 >...
 >magx nil!
 >enc nil
 >magx nil!
 >enc nil
 >...

I guess that is because of the two streams are interleaved now and there 
is no reader defined providing always the last valid reading. But the 
value should't be nil, since it is asigned only in case of the right 
port being read ('... if port.name == ...')

e) What would be your suggestion to come up with a simple data file 
combining streams from different locations preserving the original 
sampling time and order? Tried using the pocolog tool, but wasn't able 
to give multiple stream arguments for the -s option

Regards,
Leif




-- 
  Leif Christensen

  DFKI Bremen
  Robotics Innovation Center
  Robert-Hooke-Straße 5
  28359 Bremen, Germany

  Phone: +49 (0)421 17845-4149
  Fax:   +49 (0)421 17845-4150
  E-Mail: leif.christensen at dfki.de

  Weitere Informationen: http://www.dfki.de/robotik
  -----------------------------------------------------------------------
  Deutsches Forschungszentrum fuer Kuenstliche Intelligenz GmbH
  Firmensitz: Trippstadter Straße 122, D-67663 Kaiserslautern
  Geschaeftsfuehrung: Prof. Dr. Dr. h.c. mult. Wolfgang Wahlster
  (Vorsitzender) Dr. Walter Olthoff
  Vorsitzender des Aufsichtsrats: Prof. Dr. h.c. Hans A. Aukes
  Amtsgericht Kaiserslautern, HRB 2313
  Sitz der Gesellschaft: Kaiserslautern (HRB 2313)
  USt-Id.Nr.:    DE 148646973
  Steuernummer:  19/673/0060/3
  -----------------------------------------------------------------------



More information about the Rock-dev mailing list