How do you indicate a line between a user and a GPS satellite?
The distance between the satellite and the user was obtained, but it was obtained with the ECEF coordinate system.
If you use ecef2enu, a function that changes the distance to the ENU coordinate system, errors continue to occur. I am curious about the solution, and furthermore, I want to use the unit vector to reduce the distance and then visualize the satellite-user distance.
receiverLat = 37.498759;
receiverLon = 127.027487;
receiverAlt = 0;
t = datetime(‘now’, ‘TimeZone’, ‘Local’);
[satPos, ~] = gnssconstellation(t);
wgs84 = wgs84Ellipsoid(‘meters’);
[recX, recY, recZ] = geodetic2ecef(wgs84, receiverLat, receiverLon, receiverAlt);
distances = zeros(size(satPos, 1), 1);
for i = 1:size(satPos, 1)
satX = satPos(i, 1);
satY = satPos(i, 2);
satZ = satPos(i, 3);
distances(i) = sqrt((satX – recX)^2 + (satY – recY)^2 + (satZ – recZ)^2);
end
disp(‘Satellite location:’);
disp(satPos);
disp(‘Receiver location:’);
disp([recX, recY, recZ]);
disp(‘Satellite-Receiver distances:’);
disp(distances);The distance between the satellite and the user was obtained, but it was obtained with the ECEF coordinate system.
If you use ecef2enu, a function that changes the distance to the ENU coordinate system, errors continue to occur. I am curious about the solution, and furthermore, I want to use the unit vector to reduce the distance and then visualize the satellite-user distance.
receiverLat = 37.498759;
receiverLon = 127.027487;
receiverAlt = 0;
t = datetime(‘now’, ‘TimeZone’, ‘Local’);
[satPos, ~] = gnssconstellation(t);
wgs84 = wgs84Ellipsoid(‘meters’);
[recX, recY, recZ] = geodetic2ecef(wgs84, receiverLat, receiverLon, receiverAlt);
distances = zeros(size(satPos, 1), 1);
for i = 1:size(satPos, 1)
satX = satPos(i, 1);
satY = satPos(i, 2);
satZ = satPos(i, 3);
distances(i) = sqrt((satX – recX)^2 + (satY – recY)^2 + (satZ – recZ)^2);
end
disp(‘Satellite location:’);
disp(satPos);
disp(‘Receiver location:’);
disp([recX, recY, recZ]);
disp(‘Satellite-Receiver distances:’);
disp(distances); The distance between the satellite and the user was obtained, but it was obtained with the ECEF coordinate system.
If you use ecef2enu, a function that changes the distance to the ENU coordinate system, errors continue to occur. I am curious about the solution, and furthermore, I want to use the unit vector to reduce the distance and then visualize the satellite-user distance.
receiverLat = 37.498759;
receiverLon = 127.027487;
receiverAlt = 0;
t = datetime(‘now’, ‘TimeZone’, ‘Local’);
[satPos, ~] = gnssconstellation(t);
wgs84 = wgs84Ellipsoid(‘meters’);
[recX, recY, recZ] = geodetic2ecef(wgs84, receiverLat, receiverLon, receiverAlt);
distances = zeros(size(satPos, 1), 1);
for i = 1:size(satPos, 1)
satX = satPos(i, 1);
satY = satPos(i, 2);
satZ = satPos(i, 3);
distances(i) = sqrt((satX – recX)^2 + (satY – recY)^2 + (satZ – recZ)^2);
end
disp(‘Satellite location:’);
disp(satPos);
disp(‘Receiver location:’);
disp([recX, recY, recZ]);
disp(‘Satellite-Receiver distances:’);
disp(distances); gps, gnss, unit vector, ecef, enu MATLAB Answers — New Questions