Main Content

gnssconstellation

Satellite locations at specified time

Description

example

[satPos,satVel] = gnssconstellation(t) returns the satellite positions and velocities at the datetime t. The function returns positions and velocities in the Earth-centered Earth-fixed (ECEF) coordinate system in meters and meters per second, respectively.

Examples

collapse all

Get the current satellite positions and velocities from the GNSS constellations. Access the orbital parameters from IS-GPS-200K Interface Specification and calculate the position and velocities in ECEF coordinates for the given time. Display the satellite positions.

t = datetime('now','TimeZone','Local');
[satPos,satVel] = gnssconstellation(t);
disp(satPos)
   1.0e+07 *

    1.4059    1.6347   -1.5509
    1.6565   -0.8356    1.9005
   -2.4083   -0.0024   -1.1200
   -2.5175   -0.8459   -0.0325
    0.8743   -1.8249    1.7204
    0.1396   -2.5040    0.8743
    1.4628    1.4804    1.6500
   -1.4705    0.4109   -2.1733
    0.9478    2.3854    0.6826
    1.6452    0.4584    2.0341
    1.2102   -2.0842   -1.1161
    0.0217   -1.8156   -1.9384
   -2.2215    1.2738   -0.7046
   -0.6094    1.3996    2.1735
   -0.8236   -1.6807   -1.8845
   -1.7608   -1.5402   -1.2577
    2.5538    0.6720   -0.2842
   -1.8380    0.6901    1.7888
   -1.1010   -2.2265    0.9406
    1.3846   -0.7403   -2.1422
   -0.1317    2.5080    0.8642
    1.5769    0.6658   -2.0308
    2.2054   -1.3494   -0.6079
   -0.8157    2.0622   -1.4616
    0.1990    1.7055   -2.0263
   -1.8108   -0.2189    1.9306
   -0.9031   -1.2311    2.1733

Use the lookangles function to get the azimuth and elevation angles of satellites for given satellite and receiver positions. Specify a mask angle of 5 degrees. Get the satellite positions using the gnssconstellation function.

Specify a receiver position in geodetic coordinates (latitude, longitude, altitude).

recPos = [42 -71 50];

Get the satellite positions for the current time.

t = datetime('now');
gpsSatPos = gnssconstellation(t);

Specify a mask angle of 5 degrees.

maskAngle = 5;

Get the azimuth and elevation look angles for the satellite positions. The vis output indicates which satellites are visible. Get the total using nnz.

[az,el,vis] = lookangles(recPos,gpsSatPos,maskAngle);
fprintf('%d satellites visible at %s.\n',nnz(vis),t);
9 satellites visible at 03-Jul-2021 06:36:53.

Input Arguments

collapse all

Current time for the satellite simulation, specified as a scalar datetime array.

The default time zone for a dateTtime array is UTC. For information on specifying a different time zone, see datetime.

GPS start time is Jan 6, 1980 midnight, UTC. Specifying any datetime prior to this time will use the GPS start time.

Example: datetime('now','TimeZone','Local');

Data Types: datetime

Output Arguments

collapse all

Satellite positions in the Earth-centered Earth-fixed (ECEF) coordinate system in meters, returned as an N-by-3 matrix of scalars. N is the number of satellites in the constellation.

Data Types: single | double

Velocity readings of the GNSS receiver in the local navigation coordinate system in meters per second, returned as an N-by-3 matrix of scalars. N is the number of satellites in the constellation.

Data Types: single | double

More About

collapse all

Orbital Parameters

The satellite positions and velocities are defined by orbital parameters from IS-GPS-200K Interface Specification, and are given in Earth-centered Earth-fixed (ECEF) coordinates.

Position calculations use equations from Table 30-II in the same IS-GPS-200K Interface Specification.

Velocity calculations use equations 8.21–8.27 in [1].

References

[1] Groves, Paul D. Principles of GNSS, Inertial, and Multisensor Integrated Navigation Systems. Boston: Artech House, 2013.

Extended Capabilities

Introduced in R2021a