2 [FileName,PathName,FilterIndex] = uigetfile(
'*.mat');
6 %
load(
'specificfilename')
8 TimeVA = [VelocityActual.timestamp]/1000;
9 VA = [[VelocityActual.North]
11 [VelocityActual.Down]]/100;
14 Vgps=[[GPSPosition.Groundspeed].*cos([GPSPosition.Heading]*pi/180)
15 [GPSPosition.Groundspeed].*sin([GPSPosition.Heading]*pi/180)];
18 plot(TimeVA,
VA(1,:),TimeVA,VA(2,:),
TimeGPSPos,
Vgps(1,:),TimeGPSPos,Vgps(2,:));
19 s1='Velocity Actual North';
20 s2='Velocity Actual East';
21 s3='GPS Velocity North';
22 s4='GPS Velocity East';
28 TimePA = [PositionActual.timestamp]/1000;
29 PA = [[PositionActual.North]
31 [PositionActual.Down]]/100;
33 TimeGPSPos = [GPSPosition.timestamp]/1000;
34 LLA=[[GPSPosition.Latitude]*1
e-7;
35 [GPSPosition.Longitude]*1e-7;
36 [GPSPosition.Altitude]+[GPSPosition.GeoidSeparation]];
37 BaseECEF = LLA2ECEF([HomeLocation.Latitude*1e-7, HomeLocation.Longitude*1e-7, HomeLocation.Altitude]');
38 Rne = RneFromLLA([HomeLocation.Latitude*1e-7, HomeLocation.Longitude*1e-7, HomeLocation.Altitude]');
42 plot(
TimePA,
PA(1,:),TimePA,PA(2,:),TimeGPSPos,
GPSPos(1,:),TimeGPSPos,GPSPos(2,:));
43 s1='Position Actual North';
44 s2='Position Actual East';
45 s3='GPS Position North';
46 s4='GPS Position East';
52 plot3(PA(2,:),PA(1,:),PA(3,:),GPSPos(2,:),GPSPos(1,:),GPSPos(3,:));
77 ECEF=diff + repmat(BaseECEF,1,n) ;
99 e = 8.1819190842622e-2;%;
109 LLA(2) = RAD2DEG * atan2(
y,
x);
118 delta = Lat - atan(
z / (sqrt(x * x + y * y) * (1 - (
N * e * e /
NplusH))));
120 esLat = e * sin(Lat);
121 N =
a / sqrt(1 - esLat * esLat);
122 NplusH = sqrt(x * x + y * y) / cos(Lat);
126 LLA(1) = RAD2DEG * Lat;
134 a = 6378137.0; % Equatorial Radius
135 e = 8.1819190842622e-2; % Eccentricity
146 N = a / sqrt(1.0 - e * e *
sinLat *
sinLat); %prime vertical radius of curvature
150 ECEF(3,i) = ((1 - e * e) * N + LLA(3,i)) * sinLat;
160 sinLon = sin(
DEG2RAD * LLA(2));
162 cosLon = cos(
DEG2RAD * LLA(2));
164 Rne(1,1) = -sinLat * cosLon;
165 Rne(1,2) = -sinLat * sinLon;
170 Rne(3,1) = -
cosLat * cosLon;
171 Rne(3,2) = -
cosLat * sinLon;
while(((delta > ACCURACY)||(delta< -ACCURACY))&&(iter< MAX_ITER)) delta
function OPPlots()[FileName
axis equal end function NED
end(INSTANTIATIONCODE) fid
plot3(PA(2,:), PA(1,:), PA(3,:), GPSPos(2,:), GPSPos(1,:), GPSPos(3,:))
plot(TimeVA, VA(1,:), TimeVA, VA(2,:), TimeGPSPos, Vgps(1,:), TimeGPSPos, Vgps(2,:))