Unable to solve correct GPS receiver position with MATLAB internal functions
Mostrar comentarios más antiguos
Dear Community
I want to post process received GPS data with the relatively new MATLAB functions. MATLAB loads RINEX files, processes them and plots the positions.
RINEX Data I use a Septentrio X5 receiver with a navXperience 3G+C maritime antenna to log raw data into a SBF-file. The file contains observations from one hour. Then I use RTKCONV from RTKLIB to convert the SBF-File into RINEX Navigation and Observation files, see attached. The Antenna position is:
ECEF: 4267425.180, 655030.289, 4679698.745
WGS84: 47.4976660732, 8.7265311946, 510.424 N
MATLAB Inside MATLAB I run the following code (also attached):
%% read files
% NAV (Ephemeris)
navfile = "20220912-225553_log.nav";
navdata = rinexread(navfile);
% OBS (Receiver Measurements)
obsfile = "20220912-225553_log.obs";
obsdata = rinexread(obsfile); % time is GPS Time (UTC + 19 s)
%% Solve GPS
% timestamps to solve
t = unique(obsdata.GPS.Time);
% positions vector
pos = zeros(length(t),3);
for i=1:length(t)
% select observables
obs = obsdata.GPS(find(and(obsdata.GPS.Time==t(i), ~isnan(obsdata.GPS.C1W))),:);
pr = timetable2table(obs(:,["SatelliteID","C1W"]),"ConvertRowTimes",false); % table with pseudoranges
% calculate Satellite positions
nav = navdata.GPS(ismember(navdata.GPS.SatelliteID,obs.SatelliteID),:);
[navPos,~,navIDs] = gnssconstellation(t(i),RINEXData=nav);
satPos = [navIDs,navPos];
satPos = array2table(satPos,"VariableNames",["SatelliteID", "x", "y", "z"]);
% join tables with pseudoranges and satellite positions
tab = join(pr,satPos);
% solve
pos(i,:) = receiverposition(table2array(tab(:,"C1W")),table2array(tab(:,["x","y","z"])));
end
geoplot(pos(:,1),pos(:,2),'.')
Solution The solution from the MATLAB script is far away from the correct antenna position, see the attached plot. If I use RTKPOST from RTKLIB to load the same exact RINEX files, the solution is plausible, see the attached KML-File. Therefore I assume that the problem is within my MATLAB code.

Does anybody have an idea what I'm doing wrong?
Thanks for your help!
Best wishes,
Simon
Respuesta aceptada
Más respuestas (0)
Categorías
Más información sobre Scenario Generation and Visualization en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!