Gnuplot shell script ROS data from multiple files -


i'm trying plot data 2 different rosbag files using gnuplot. i'm trying automate have quite few files need run.

i need take first element of first column of each file , offset data of column w.r.t. (and divide 10^9) time in seconds. issue script returns different when run multiple times. either return first, second, or (occasionally) third plot command, i'm interested in.

the code i've cobbled below:

#!/bin/bash gnuplot -persist <<-eofmarker     set autoscale     set datafile separator ","     set key autotitle columnhead     plot "bag1" using (\$1):2 linespoints     first=gpval_data_x_min     plot "bag2" using (\$1):3 linespoints     second=gpval_data_x_min     plot "bag1" using ((\$1-first)/10**9):2, "bag2" using ((\$1-second)/10**9):3 eofmarker 

an example of dataset is:

%time,field.1,field.2,field.3 1.50317427276591e+018,23,64,64 1.50317427281556e+018,232,74,64 1.50317427285689e+018,216,76,64 1.50317427287325e+018,183,85,64 1.50317427292519e+018,165,89,64 1.50317427298662e+018,129,96,64 1.50317427300161e+018,115,101,64 1.50317427309547e+018,102,112,64 

and second input file is:

%time,field.1,field.2,field.3,field.4 1.50317425501603e+018,55,45,229,98755 1.50317425501843e+018,55,45,229,98752 1.5031742550235e+018,51,43,229,98758 1.50317425502979e+018,51,43,229,98761 1.50317425504176e+018,55,41,231,98764 1.50317425504579e+018,55,41,231,98770 1.50317425504728e+018,50,42,232,98773 1.50317425504855e+018,50,42,232,98773 1.50317425505353e+018,55,41,229,98770 1.50317425506442e+018,55,41,229,98770 

i've never experienced code multiple runs produces different results. can point me in right direction fix mess? outputs 3 plots below. no error message output script @ time.

first output:

enter image description here

third (and desired) output:

enter image description here

i don't know why getting different results; output of last plot command. however, seem using first 2 plot commands minimum value of first column each of 2 files. better way doesn't generate plots be

set datafile separator "," set key autotitle columnhead stats "bag1" using 1 first=stats_min stats "bag2" using 1 second=stats_min plot "bag1" using (($1-first)/10**9):2, "bag2" using (($1-second)/10**9):3 

Comments

Popular posts from this blog

ubuntu - PHP script to find files of certain extensions in a directory, returns populated array when run in browser, but empty array when run from terminal -

php - How can i create a user dashboard -

javascript - How to detect toggling of the fullscreen-toolbar in jQuery Mobile? -