#!/usr/local/bin/ruby -Ks $: << '~/src/eclipse/autopilot/common/ruby' require 'ublox' if $0 == __FILE__ then if ARGV.size < 1 then puts "Usage: #{__FILE__} target_log" exit(-1) end longlats = [] open(ARGV[0]).each{|line| if line =~ /^G/ then packet = U_blox::string2packet(line[2...(line.size - 2)]) if !U_blox::valid_header?(packet) then next end if !U_blox::valid_size?(packet) then next end if !U_blox::valid_parity?(packet) then next end llh = U_blox::fetch_longlatheight(packet) #puts (llh << U_blox::fetch_ITOW(packet)).join(' ') if llh puts llh.join(' ') if llh end } end