Main Content

gpsSensor

GPS receiver simulation model

Description

The gpsSensor System object™ models data output from a Global Positioning System (GPS) receiver.

To model a GPS receiver:

  1. Create the gpsSensor object and set its properties.

  2. Call the object with arguments, as if it were a function.

To learn more about how System objects work, see What Are System Objects?.

Creation

Description

GPS = gpsSensor returns a gpsSensorSystem object that computes a Global Positioning System receiver reading based on a local position and velocity input signal. The default reference position in geodetic coordinates is

  • latitude: 0o N

  • longitude: 0o E

  • altitude: 0 m

GPS = gpsSensor('ReferenceFrame',RF) returns a gpsSensorSystem object that computes a global positioning system receiver reading relative to the reference frame RF. Specify RF as 'NED' (North-East-Down) or 'ENU'(East-North-Up). The default value is 'NED'.

GPS = gpsSensor(___,Name,Value) sets each property Name to the specified Value. Unspecified properties have default values.

Properties

expand all

Unless otherwise indicated, properties are nontunable, which means you cannot change their values after calling the object. Objects lock when you call them, and the release function unlocks them.

If a property is tunable, you can change its value at any time.

For more information on changing property values, see System Design in MATLAB Using System Objects.

Update rate of the receiver in Hz, specified as a positive real scalar.

Data Types: single | double

Reference location, specified as a 3-element row vector in geodetic coordinates (latitude, longitude, and altitude). Altitude is the height above the reference ellipsoid model, WGS84. The reference location is in [degrees degrees meters]. The degree format is decimal degrees (DD).

Data Types: single | double

Horizontal position accuracy in meters, specified as a nonnegative real scalar. The horizontal position accuracy specifies the standard deviation of the noise in the horizontal position measurement.

Tunable: Yes

Data Types: single | double

Vertical position accuracy in meters, specified as a nonnegative real scalar. The vertical position accuracy specifies the standard deviation of the noise in the vertical position measurement.

Tunable: Yes

Data Types: single | double

Velocity accuracy in meters per second, specified as a nonnegative real scalar. The velocity accuracy specifies the standard deviation of the noise in the velocity measurement.

Tunable: Yes

Data Types: single | double

Global position noise decay factor, specified as a scalar in the range [0,1].

A decay factor of 0 models the global position noise as a white noise process. A decay factor of 1 models the global position noise as a random walk process.

Tunable: Yes

Data Types: single | double

Random number source, specified as a character vector or string:

  • 'Global stream' –– Random numbers are generated using the current global random number stream.

  • 'mt19937ar with seed' –– Random numbers are generated using the mt19937ar algorithm with the seed specified by the Seed property.

Data Types: char | string

Initial seed of an mt19937ar random number generator algorithm, specified as a nonnegative integer scalar.

Dependencies

To enable this property, set RandomStream to 'mt19937ar with seed'.

Data Types: single | double | int8 | int16 | int32 | int64 | uint8 | uint16 | uint32 | uint64

Usage

Description

[position,velocity,groundspeed,course] = GPS(truePosition,trueVelocity) computes global navigation satellite system receiver readings from the position and velocity inputs.

Input Arguments

expand all

Position of the GPS receiver in the local navigation coordinate system in meters, specified as a real finite N-by-3 matrix.

N is the number of samples in the current frame.

Data Types: single | double

Velocity of GPS receiver in the local navigation coordinate system in meters per second, specified as a real finite N-by-3 matrix.

N is the number of samples in the current frame.

Data Types: single | double

Output Arguments

expand all

Position of the GPS receiver in the geodetic latitude, longitude, and altitude (LLA) coordinate system, returned as a real finite N-by-3 array. Latitude and longitude are in degrees with North and East being positive. Altitude is in meters.

N is the number of samples in the current frame.

Data Types: single | double

Velocity of the GPS receiver in the local navigation coordinate system in meters per second, returned as a real finite N-by-3 array.

N is the number of samples in the current frame.

Data Types: single | double

Magnitude of the horizontal velocity of the GPS receiver in the local navigation coordinate system in meters per second, returned as a real finite N-by-1 column vector.

N is the number of samples in the current frame.

Data Types: single | double

Direction of the horizontal velocity of the GPS receiver in the local navigation coordinate system in degrees, returned as a real finite N-by-1 column of values between 0 and 360. North corresponds to 360 degrees and East corresponds to 90 degrees.

N is the number of samples in the current frame.

Data Types: single | double

Object Functions

To use an object function, specify the System object as the first input argument. For example, to release system resources of a System object named obj, use this syntax:

release(obj)

expand all

stepRun System object algorithm
releaseRelease resources and allow changes to System object property values and input characteristics
resetReset internal states of System object

Extended Capabilities

Introduced in R2018b