You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
119 lines
4.6 KiB
119 lines
4.6 KiB
9 years ago
|
tic;
|
||
|
clc;clear all; close(findall(0,'Type','figure'));
|
||
|
%%
|
||
9 years ago
|
%ProcessGnssMeasScript.m, script to read GnssLogger output, compute and plot:
|
||
|
% pseudoranges, C/No, and weighted least squares PVT solution
|
||
|
%
|
||
9 years ago
|
% you can run the data in pseudoranges log files provided for you:
|
||
8 years ago
|
%prFileName = 'pseudoranges_log_2016_06_30_21_26_07.txt'; %with duty cycling, no carrier phase
|
||
9 years ago
|
% prFileName = 'pseudoranges_log_2016_08_22_14_45_50.txt'; %no duty cycling, with carrier phase
|
||
8 years ago
|
%prFileName = 'workshop_trials01.txt';
|
||
|
%prFileName = 'N9_google.txt';
|
||
|
prFileName = 's8_01.txt';
|
||
9 years ago
|
% as follows
|
||
|
% 1) copy everything from GitHub google/gps-measurement-tools/ to
|
||
|
% a local directory on your machine
|
||
8 years ago
|
% 2) softPath will read current working directory
|
||
9 years ago
|
softPath = pwd;
|
||
|
addpath(softPath);
|
||
|
%CHANGE this to your data folder
|
||
|
dirName = sprintf('%s%s',softPath,'\demoFiles');
|
||
9 years ago
|
|
||
9 years ago
|
% 3) run ProcessGnssMeasScript.m script file
|
||
8 years ago
|
% 4) when asked select 'change folder' to get proper pwd
|
||
9 years ago
|
|
||
|
%Author: Frank van Diggelen
|
||
8 years ago
|
%edits: LKB
|
||
9 years ago
|
%Open Source code for processing Android GNSS Measurements
|
||
9 years ago
|
%% debug and profiling tools
|
||
8 years ago
|
% tools below are used to debug/follow code
|
||
9 years ago
|
% profile on;
|
||
|
% profile clear;
|
||
|
display('DEBUG MODE');
|
||
8 years ago
|
dbclear all
|
||
8 years ago
|
dbstop if error %gives post-mortem
|
||
9 years ago
|
% dbstop if naninf
|
||
|
% dbstop in subRoutine at 17 if idx==7
|
||
8 years ago
|
%dbstop in ProcessGnssMeas at 98
|
||
|
%dbstop in ReadGnssLogger at 20
|
||
8 years ago
|
%dbstop at 66
|
||
9 years ago
|
dbstatus
|
||
|
% get display screen file
|
||
|
HW_ScrSize = get(0,'ScreenSize');%in pixels
|
||
9 years ago
|
|
||
|
%% parameters
|
||
9 years ago
|
%param.llaTrueDegDegM = [];
|
||
9 years ago
|
%enter true WGS84 lla, if you know it:
|
||
8 years ago
|
%param.llaTrueDegDegM = [37.422578, -122.081678, -28];%Charleston Park Test Site
|
||
|
param.llaTrueDegDegM = [45.5298979 -122.6619045 24.16] %workshop trial approx coords
|
||
8 years ago
|
param.llaTrueDegDegM = [37.4224423 -122.0819186 -16.66] %google Nexus9 approx coords
|
||
|
param.llaTrueDegDegM = [48.0530356 11.6535412 660.57] %S8 trial approx coords
|
||
|
|
||
9 years ago
|
%% Set the data filter and Read log file
|
||
|
dataFilter = SetDataFilter;
|
||
9 years ago
|
[gnssRaw,gnssAnalysis] = ReadGnssLogger(dirName,prFileName,dataFilter);
|
||
9 years ago
|
if isempty(gnssRaw), return, end
|
||
9 years ago
|
|
||
8 years ago
|
%% Get online ephemeris from Nasa ftp, first
|
||
9 years ago
|
fctSeconds = 1e-3*double(gnssRaw.allRxMillis(end));
|
||
8 years ago
|
utcTime = Gps2Utc([],fctSeconds); %compute UTC Time from gnssRaw:
|
||
|
allGpsEph = GetNasaHourlyEphemeris(utcTime,dirName); %Get online ephemeris
|
||
9 years ago
|
if isempty(allGpsEph), return, end
|
||
9 years ago
|
|
||
|
%% process raw measurements, compute pseudoranges:
|
||
|
[gnssMeas] = ProcessGnssMeas(gnssRaw);
|
||
|
|
||
|
%% plot pseudoranges and pseudorange rates
|
||
9 years ago
|
h1 = figure('Color','white','MenuBar','figure','Position',[0 0 HW_ScrSize(3) HW_ScrSize(4)]);
|
||
9 years ago
|
[colors] = PlotPseudoranges(gnssMeas,prFileName);
|
||
8 years ago
|
% h2 = figure('Color','white','MenuBar','figure','Position',[0 0 HW_ScrSize(3) HW_ScrSize(4)]);
|
||
|
% PlotPseudorangeRates(gnssMeas,prFileName,colors);
|
||
|
% h3 = figure('Color','white','MenuBar','figure','Position',[0 0 HW_ScrSize(3) HW_ScrSize(4)]);
|
||
|
% PlotCno(gnssMeas,prFileName,colors);
|
||
9 years ago
|
|
||
|
%% compute WLS position and velocity
|
||
|
gpsPvt = GpsWlsPvt(gnssMeas,allGpsEph);
|
||
|
|
||
|
%% plot Pvt results
|
||
9 years ago
|
h4 = figure('Color','white','MenuBar','figure','Position',[0 0 HW_ScrSize(3) HW_ScrSize(4)]);
|
||
9 years ago
|
ts = 'Raw Pseudoranges, Weighted Least Squares solution';
|
||
|
PlotPvt(gpsPvt,prFileName,param.llaTrueDegDegM,ts); drawnow;
|
||
9 years ago
|
h5 = figure('Color','white','MenuBar','figure','Position',[0 0 HW_ScrSize(3) HW_ScrSize(4)]);
|
||
9 years ago
|
PlotPvtStates(gpsPvt,prFileName);
|
||
|
|
||
8 years ago
|
% if no results visible make sure that param.llaTrueDegDegM is correctly set
|
||
|
% if unknown, use Median llaDegDegM
|
||
|
|
||
9 years ago
|
%% Plot Accumulated Delta Range
|
||
8 years ago
|
if any(any(isfinite(gnssMeas.AdrM) & gnssMeas.AdrM~=0))
|
||
|
print('this phone has ICP');
|
||
|
[gnssMeas]= ProcessAdr(gnssMeas);
|
||
|
h6 = figure('Color','white','MenuBar','figure','Position',[0 0 HW_ScrSize(3) HW_ScrSize(4)]);
|
||
|
PlotAdr(gnssMeas,prFileName,colors);
|
||
|
[adrResid]= GpsAdrResiduals(gnssMeas,allGpsEph,param.llaTrueDegDegM);drawnow
|
||
|
h7 = figure('Color','white','MenuBar','figure','Position',[0 0 HW_ScrSize(3) HW_ScrSize(4)]);
|
||
|
PlotAdrResids(adrResid,gnssMeas,prFileName,colors);
|
||
|
else print('this phone do not have ICP capacity, sorry');
|
||
|
end
|
||
9 years ago
|
|
||
9 years ago
|
%% end of ProcessGnssMeasScript
|
||
9 years ago
|
rmpath(softPath)
|
||
9 years ago
|
toc
|
||
8 years ago
|
|
||
|
|
||
|
|
||
9 years ago
|
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||
|
% Copyright 2016 Google Inc.
|
||
|
%
|
||
|
% Licensed under the Apache License, Version 2.0 (the "License");
|
||
|
% you may not use this file except in compliance with the License.
|
||
|
% You may obtain a copy of the License at
|
||
|
%
|
||
9 years ago
|
% http://www.apache.org/licenses/LICENSE-2.0
|
||
9 years ago
|
%
|
||
|
% Unless required by applicable law or agreed to in writing, software
|
||
|
% distributed under the License is distributed on an "AS IS" BASIS,
|
||
|
% WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||
|
% See the License for the specific language governing permissions and
|
||
|
% limitations under the License.
|