Rhdlog: Difference between revisions

From Rsewiki
No edit summary
 
(One intermediate revision by the same user not shown)
Line 16: Line 16:


The file format is like the sample shown below,
The file format is like the sample shown below,
the first part is a list of logged variables - should be removed for MATLAB import.
the first part is a list of logged variables - but compatible with MATLAB import.


  % 1465748226.469605 2016-06-12 18:17:06.469
  % 1465748226.469605 2016-06-12 18:17:06.469
Line 59: Line 59:
  % 95 w 3 wingLogCtrl
  % 95 w 3 wingLogCtrl
  % 98 w 1 rhdloginterval
  % 98 w 1 rhdloginterval
  1465748227.454 1 0 0 0 2147483647 0 0 0 0 0 0 0 0 110 110 0 30 32 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0  
  1465748230.004 103 0 0 0 5947 5939 5945 5927 5920 5925 0 0 0 110 110 110 30 32 33 26001 25951 25976 0 0 0 350 612 28 150 540 -406 8472 8462 7814 1 -130 -7 -10 171 3 -1 -16 3 5 3 -14 54 0 32 35 18 37 1232 1488 1760 416 421 416 1191000 1219800 1257100 13267 -3799 15472 560 380 560 32 1 39 0 1 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0  
  1465748227.479 2 0 0 0 2147483647 3729 0 0 3707 0 0 0 0 110 110 110 30 32 33 0 23474 0 0 0 0 0 652 0 0 602 0 0 8466 0 0 -132 0 0 160 0 0 -24 0 0 3 0 0 0 0 0 19 0 0 1488 0 0 420 0 0 1219800 0 0 -3287 0 0 371 0 0 1 0 0 1 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0  
1465748230.029 104 0 0 0 5947 5947 5945 5927 5926 5925 0 0 0 110 110 110 30 32 33 26001 26026 25976 0 0 0 350 620 28 150 552 -406 8472 8528 7814 1 -131 -7 -10 166 3 -1 -19 3 5 2 -14 54 0 32 35 20 37 1232 1408 1760 416 420 416 1191000 1219800 1257100 13267 -4040 15472 560 381 560 32 1 39 0 1 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0  
  1465748227.504 3 0 0 0 2147483647 3729 3710 0 3707 3694 0 0 0 110 110 110 30 32 33 0 23474 23499 0 0 0 0 652 40 0 602 -428 0 8466 7830 0 -132 -4 0 160 -3 0 -24 7 0 3 -14 0 0 34 0 19 34 0 1488 1776 0 420 416 0 1219800 1257000 0 -3287 15138 0 371 558 0 1 36 0 1 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0  
  1465748230.054 105 0 0 0 5947 5947 5946 5927 5926 5928 0 0 0 110 110 110 30 32 33 26001 26026 26051 0 0 0 350 620 54 150 552 -418 8472 8528 7800 1 -131 -5 -10 166 -1 -1 -19 -1 5 2 -14 54 0 33 35 20 36 1232 1408 1792 416 420 416 1191000 1219800 1257100 13267 -4040 15918 560 381 560 32 1 39 0 1 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0  
  1465748227.529 4 0 0 0 3761 3729 3710 3730 3707 3694 0 0 0 110 110 110 30 32 33 23524 23474 23499 0 0 0 350 652 40 148 602 -428 8472 8466 7830 2 -132 -4 -5 160 -3 3 -24 7 6 3 -14 57 0 34 36 19 34 1360 1488 1776 416 420 416 1190900 1219800 1257000 12881 -3287 15138 558 371 558 30 1 36 0 1 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0  
  1465748230.079 106 0 0 0 5947 5947 5946 5927 5926 5928 0 0 0 110 110 110 30 32 33 26076 26026 26051 0 0 0 374 620 54 140 552 -418 8444 8528 7800 8 -131 -5 -9 166 -1 2 -19 -1 6 2 -14 55 0 33 36 20 36 1296 1408 1792 416 420 416 1190900 1219800 1257100 12881 -4040 15918 561 381 560 29 1 39 0 1 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0  
  1465748227.554 5 0 0 0 3761 3724 3710 3730 3702 3694 0 0 0 110 110 110 30 32 33 23524 23549 23499 0 0 0 350 628 40 148 576 -428 8472 8498 7830 2 -132 -4 -5 163 -3 3 -23 7 6 2 -14 57 0 34 36 19 34 1360 1440 1776 416 421 416 1190900 1219800 1257000 12881 -3799 15138 558 381 558 30 1 36 0 1 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0  
  1465748230.104 107 0 0 0 5947 5937 5946 5927 5920 5928 0 0 0 110 110 110 30 32 33 26076 26101 26051 0 0 0 374 624 54 140 552 -418 8444 8444 7800 8 -131 -5 -9 161 -1 2 -23 -1 6 2 -14 55 0 33 36 20 36 1296 1488 1792 416 420 416 1190900 1219800 1257100 12881 -4161 15918 561 381 560 29 1 39 0 1 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0  
  1465748227.579 6 0 0 0 3761 3724 3734 3730 3702 3711 0 0 0 110 110 110 30 32 33 23524 23549 23574 0 0 0 350 628 26 148 576 -412 8472 8498 7804 2 -132 -13 -5 163 0 3 -23 8 6 2 -15 57 0 34 36 19 36 1360 1440 1680 416 421 416 1190900 1219800 1257100 12881 -3799 15472 558 381 556 30 1 41 0 1 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0  
  1465748230.129 108 0 0 0 5947 5937 5946 5927 5920 5927 0 0 0 110 110 110 30 32 33 26076 26101 26126 0 0 0 374 624 34 140 552 -432 8444 8444 7872 8 -131 -5 -9 161 1 2 -23 1 6 2 -13 55 0 34 36 20 35 1296 1488 1792 416 420 416 1190900 1219800 1257100 12881 -4161 15472 561 381 560 29 1 40 0 1 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0  
  1465748227.604 7 0 0 0 3707 3724 3734 3696 3702 3711 0 0 0 110 110 110 30 32 33 23599 23549 23574 0 0 0 354 628 26 142 576 -412 8456 8498 7804 5 -132 -13 -2 163 0 -6 -23 8 6 2 -15 57 0 34 36 19 36 1264 1440 1680 416 421 416 1190900 1219800 1257100 12495 -3799 15472 560 381 556 29 1 41 0 1 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
  1465748230.154 109 0 0 0 5945 5937 5946 5925 5920 5927 0 0 0 110 110 110 30 32 33 26152 26101 26126 0 0 0 334 624 34 120 552 -432 8472 8444 7872 4 -131 -5 -12 161 1 2 -23 1 6 2 -13 54 0 34 34 20 35 1264 1488 1792 416 420 416 1190900 1219800 1257100 12495 -4161 15472 560 381 560 30 1 40 0 1 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0  
  1465748230.179 110 0 0 0 5945 5944 5946 5925 5924 5927 0 0 0 110 110 110 30 32 33 26152 26176 26126 0 0 0 334 636 34 120 590 -432 8472 8412 7872 4 -131 -5 -12 168 1 2 -27 1 6 2 -13 54 0 34 34 18 35 1264 1472 1792 416 420 416 1190900 1219800 1257100 12495 -4311 15472 560 381 560 30 1 40 0 1 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0  
 
 
The MATLAB plot file could be like:
 
%% plot from rhd log
clear
close all
%%
data = load('rhdlog.txt');
%%
figure(1)
plot(data(:,1)-data(1,1),data(:,45),'r');
hold on
plot(data(:,1)-data(1,1),data(:,48),'b');
plot(data(:,1)-data(1,1),data(:,51),'m');
grid MINOR
xlabel('time [sec]');
legend('X','Y','Z')
title('Magnetometer data 1')

Latest revision as of 08:22, 14 October 2018

The rhdlog plugin can simply start and stop logging of all RHD variables to a text file

read variables

rhdlogging is 0 when not logging (default) and 1 when logging

write variables

rhdloginterval default is 0, i.e. not logging. set to 1..N for saving a set og log data every N RHD sample times.

logfile

The file generated is in the default directory (where RHD were started).

You must have write access right to this directory, else nothing is logged.

The file format is like the sample shown below, the first part is a list of logged variables - but compatible with MATLAB import.

% 1465748226.469605 2016-06-12 18:17:06.469
% this file is intended for MATALB, like
% data = load('rhdlog.txt');
% symbols: 
% index r/w length name
% 1 t 1 timestamp (from gettimeofday())
% 2 r 1 tick
% 3 r 3 teradist
% 6 r 3 wingIoTime
% 9 r 3 wingIoReadTime
% 12 r 3 wingIoError
% 15 r 3 wingRev
% 18 r 3 wingID
% 21 r 3 wingHb
% 24 r 3 wingSensorOK
% 27 r 3 wingAccX
% 30 r 3 wingAccY
% 33 r 3 wingAccZ
% 36 r 3 wingGyroX
% 39 r 3 wingGyroY
% 42 r 3 wingGyroZ
% 45 r 3 wingMagX
% 48 r 3 wingMagY
% 51 r 3 wingMagZ
% 54 r 3 wingImuTemp
% 57 r 3 wingBaroTemp
% 60 r 3 wingBaroPascal
% 63 r 3 wingBaroCM
% 66 r 3 wingVolt
% 69 r 3 wingAmp
% 72 r 3 wingSharpHeight
% 75 r 1 rhdlogging
% 76 w 1 teramode
% 77 w 3 wingCmd
% 80 w 3 wingCmdval
% 83 w 3 wingMotor
% 86 w 3 wingTilt
% 89 w 3 wingFlap
% 92 w 3 wingLED
% 95 w 3 wingLogCtrl
% 98 w 1 rhdloginterval
1465748230.004 103 0 0 0 5947 5939 5945 5927 5920 5925 0 0 0 110 110 110 30 32 33 26001 25951 25976 0 0 0 350 612 28 150 540 -406 8472 8462 7814 1 -130 -7 -10 171 3 -1 -16 3 5 3 -14 54 0 32 35 18 37 1232 1488 1760 416 421 416 1191000 1219800 1257100 13267 -3799 15472 560 380 560 32 1 39 0 1 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 
1465748230.029 104 0 0 0 5947 5947 5945 5927 5926 5925 0 0 0 110 110 110 30 32 33 26001 26026 25976 0 0 0 350 620 28 150 552 -406 8472 8528 7814 1 -131 -7 -10 166 3 -1 -19 3 5 2 -14 54 0 32 35 20 37 1232 1408 1760 416 420 416 1191000 1219800 1257100 13267 -4040 15472 560 381 560 32 1 39 0 1 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 
1465748230.054 105 0 0 0 5947 5947 5946 5927 5926 5928 0 0 0 110 110 110 30 32 33 26001 26026 26051 0 0 0 350 620 54 150 552 -418 8472 8528 7800 1 -131 -5 -10 166 -1 -1 -19 -1 5 2 -14 54 0 33 35 20 36 1232 1408 1792 416 420 416 1191000 1219800 1257100 13267 -4040 15918 560 381 560 32 1 39 0 1 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 
1465748230.079 106 0 0 0 5947 5947 5946 5927 5926 5928 0 0 0 110 110 110 30 32 33 26076 26026 26051 0 0 0 374 620 54 140 552 -418 8444 8528 7800 8 -131 -5 -9 166 -1 2 -19 -1 6 2 -14 55 0 33 36 20 36 1296 1408 1792 416 420 416 1190900 1219800 1257100 12881 -4040 15918 561 381 560 29 1 39 0 1 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 
1465748230.104 107 0 0 0 5947 5937 5946 5927 5920 5928 0 0 0 110 110 110 30 32 33 26076 26101 26051 0 0 0 374 624 54 140 552 -418 8444 8444 7800 8 -131 -5 -9 161 -1 2 -23 -1 6 2 -14 55 0 33 36 20 36 1296 1488 1792 416 420 416 1190900 1219800 1257100 12881 -4161 15918 561 381 560 29 1 39 0 1 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 
1465748230.129 108 0 0 0 5947 5937 5946 5927 5920 5927 0 0 0 110 110 110 30 32 33 26076 26101 26126 0 0 0 374 624 34 140 552 -432 8444 8444 7872 8 -131 -5 -9 161 1 2 -23 1 6 2 -13 55 0 34 36 20 35 1296 1488 1792 416 420 416 1190900 1219800 1257100 12881 -4161 15472 561 381 560 29 1 40 0 1 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 
1465748230.154 109 0 0 0 5945 5937 5946 5925 5920 5927 0 0 0 110 110 110 30 32 33 26152 26101 26126 0 0 0 334 624 34 120 552 -432 8472 8444 7872 4 -131 -5 -12 161 1 2 -23 1 6 2 -13 54 0 34 34 20 35 1264 1488 1792 416 420 416 1190900 1219800 1257100 12495 -4161 15472 560 381 560 30 1 40 0 1 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 
1465748230.179 110 0 0 0 5945 5944 5946 5925 5924 5927 0 0 0 110 110 110 30 32 33 26152 26176 26126 0 0 0 334 636 34 120 590 -432 8472 8412 7872 4 -131 -5 -12 168 1 2 -27 1 6 2 -13 54 0 34 34 18 35 1264 1472 1792 416 420 416 1190900 1219800 1257100 12495 -4311 15472 560 381 560 30 1 40 0 1 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 


The MATLAB plot file could be like:

%% plot from rhd log
clear
close all
%%
data = load('rhdlog.txt');
%%
figure(1)
plot(data(:,1)-data(1,1),data(:,45),'r');
hold on
plot(data(:,1)-data(1,1),data(:,48),'b');
plot(data(:,1)-data(1,1),data(:,51),'m');
grid MINOR
xlabel('time [sec]');
legend('X','Y','Z')
title('Magnetometer data 1')