Main Content

# receiverposition

Estimate GNSS receiver position and velocity

## Syntax

``recPos = receiverposition(p,satPos)``
``[recPos,recVel] = receiverposition(___,pdot,satVel)``
``[recPos,recVel,hdop,vdop] = receiverposition(___)``

## Description

````recPos = receiverposition(p,satPos)` returns the receiver position estimated from the pseudoranges and satellite positions.```

example

````[recPos,recVel] = receiverposition(___,pdot,satVel)` also returns the receiver velocity estimated from the pseudorange rates `pdot` and satellite velocities `satVel`.```
````[recPos,recVel,hdop,vdop] = receiverposition(___)` also returns the horizontal dilation of precision `hdop` and vertical dilation of precision `vdop` associated with the position estimate.```

## Examples

collapse all

Use the `receiverposition` function to estimate a GNSS receiver position. Get the satellte positiions and velocities using the `gnssconstellation` function. Generate pseudoranges from these positions using the `pseudoranges` function.

Specify a receiver position in geodetic coordinates (latitude, longitude, altitude) and a receiver velocity in the local navigation frame.

```recPos = [42 -71 50]; recVel = [1 2 3];```

Get the satellite positions for the current time.

```t = datetime('now'); [gpsSatPos,gpsSatVel] = gnssconstellation(t);```

Get the the pseudoranges and pseudorange rates between the GNSS receiver and the satellites.

`[p,pdot] = pseudoranges(recPos,gpsSatPos,recVel,gpsSatVel);`

Use the pseudoranges to estimate the receiver position and velocity. The values close to your original receiver position and velocity used to generate the satellite position and pseudoranges.

`[lla,gnssVel] = receiverposition(p,gpsSatPos,pdot,gpsSatVel)`
```lla = 1×3 42.0000 -71.0000 49.6892 ```
```gnssVel = 1×3 0.9889 2.0034 2.9882 ```

## Input Arguments

collapse all

Pseudoranges between the satellites and receiver, specified as an n-element vector in meters.

Data Types: `single` | `double`

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

Data Types: `single` | `double`

Pseudorange rates between the satellites and receiver, specified as an n-element vector in meters per second.

Data Types: `single` | `double`

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

Data Types: `single` | `double`

## Output Arguments

collapse all

Receiver position in geodetic coordinates, returned as a three-element vector of the form [latitude longitude altitude]

Data Types: `single` | `double`

Receiver velocity in the local navigation frame using north-east-down (NED) coordinates, returned as a three-element vector of the form [vx vy vz].

Data Types: `single` | `double`

Horizontal dilation of precision, returned as a scalar.

Data Types: `double`

Vertical dilation of precision, returned as a scalar.

Data Types: `double`

## Extended Capabilities

### C/C++ Code GenerationGenerate C and C++ code using MATLAB® Coder™.

Introduced in R2021a