Compute the raw range (a.k.a. geometric range) from a receiver at at receive time and an SV at transmit time.
When working with coordinates in an ECEF frame, the rotation of the frame during the transmission must be accounted for in computing the distance. The range equation can be written as such:
The computeRange() methods perform this exact computation. Note that a simple rotation around the Z axis can be used due to the assumption of a short time of flight (<1s). This will not work for larger time deltas.
The above range equation requires knowing the transmit time and the time of flight (tof) but usually neither is known. There are several RawRange methods for estimating the transmit time and tof depending on the available inputs.
Documentation and code in this class tries to stay consistent in terminology. The table below describes the terminology.
Term | Variable Name | Math Term | Explanation |
---|---|---|---|
R3 | N/A | ![]() | A rotation about the Z axis |
Time of flight (tof) | tof | ![]() | The time it takes from signal transmission to signal reception |
Angular velocity | N/A | ![]() | An ECEF reference frame's angular velocity, typically provided by an ellipsoid model |
Receiver (RX) position | rxPos | ![]() | A receiver's position in ECEF coordinates |
SV position | svPos | ![]() | An SV's position in ECEF coordinates |
Nominal receive time | receiveNominal | ![]() | The receive time in the time frame of the receiver. |
Receive time | receive | ![]() | The true receive time |
Nominal transmit time | transmitNominal | ![]() | The transmit time in the time frame of the transmitter (e.g. SV) |
Transmit time | transmit | ![]() | The true transmit time |
SV clock offset | N/A | ![]() | An SV clock's offset from a true time frame (typically GPS) |
RX relativity correction | | A relativity correction due to the ellipictal orbits of SVs
Definition at line 113 of file RawRange.hpp.
#include <RawRange.hpp>
Static Public Member Functions | |
static std::tuple< double, Position > | computeRange (const Position &rxPos, const CommonTime &receive, const Position &svPos, const CommonTime &transmit, const EllipsoidModel &ellipsoid, bool smallAngleApprox=false) |
static std::tuple< double, Xvt > | computeRange (const Position &rxPos, const CommonTime &receive, const Xvt &svXvt, const CommonTime &transmit, const EllipsoidModel &ellipsoid, bool smallAngleApprox=false) |
static std::tuple< double, Position > | computeRange (const Position &rxPos, const Position &svPos, double tof, const EllipsoidModel &ellipsoid, bool smallAngleApprox=false) |
static std::tuple< double, Xvt > | computeRange (const Position &rxPos, const Xvt &svXvt, double tof, const EllipsoidModel &ellipsoid, bool smallAngleApprox=false) |
static std::tuple< bool, CommonTime > | estTransmitFromObs (const CommonTime &receiveNominal, double pseudorange, NavLibrary &navLib, const NavSatelliteID &sat, SVHealth xmitHealth=SVHealth::Any, NavValidityType valid=NavValidityType::ValidOnly, NavSearchOrder order=NavSearchOrder::User) |
static std::tuple< bool, CommonTime > | estTransmitFromReceive (const Position &rxPos, const CommonTime &receive, NavLibrary &navLib, const NavSatelliteID &sat, const EllipsoidModel &ellipsoid, SVHealth xmitHealth=SVHealth::Any, NavValidityType valid=NavValidityType::ValidOnly, NavSearchOrder order=NavSearchOrder::User, double seed=0.07, double threshold=1.e-13, int maxIter=5) |
static std::tuple< bool, double, Xvt > | fromNominalReceive (const Position &rxPos, const CommonTime &receiveNominal, NavLibrary &navLib, const NavSatelliteID &sat, const EllipsoidModel &ellipsoid, bool smallAngleApprox=false, SVHealth xmitHealth=SVHealth::Any, NavValidityType valid=NavValidityType::ValidOnly, NavSearchOrder order=NavSearchOrder::User, double seed=0.7, double threshold=1.e-13, int maxIter=5) |
static std::tuple< bool, double, Xvt > | fromNominalReceiveWithObs (const Position &rxPos, const CommonTime &receiveNominal, double pseudorange, NavLibrary &navLib, const NavSatelliteID &sat, const EllipsoidModel &ellipsoid, bool smallAngleApprox=false, SVHealth xmitHealth=SVHealth::Any, NavValidityType valid=NavValidityType::ValidOnly, NavSearchOrder order=NavSearchOrder::User) |
static std::tuple< bool, double, Xvt > | fromReceive (const Position &rxPos, const CommonTime &receive, NavLibrary &navLib, const NavSatelliteID &sat, const EllipsoidModel &ellipsoid, bool smallAngleApprox=false, SVHealth xmitHealth=SVHealth::Any, NavValidityType valid=NavValidityType::ValidOnly, NavSearchOrder order=NavSearchOrder::User, double seed=0.07, double threshold=1.e-13, int maxIter=5) |
static std::tuple< bool, double, Xvt > | fromSvPos (const Position &rxPos, const Xvt &svXvt, const EllipsoidModel &ellipsoid, bool smallAngleApprox=false, double seed=0.07, double threshold=1.e-13, int maxIter=5) |
static std::tuple< bool, double, Xvt > | fromSvTransmit (const Position &rxPos, NavLibrary &navLib, const NavSatelliteID &sat, const CommonTime &transmit, const EllipsoidModel &ellipsoid, bool smallAngleApprox=false, SVHealth xmitHealth=SVHealth::Any, NavValidityType valid=NavValidityType::ValidOnly, NavSearchOrder order=NavSearchOrder::User, double seed=0.07, double threshold=1.e-13, int maxIter=5) |
static std::tuple< bool, double, Xvt > | fromSvTransmitWithObs (const Position &rxPos, double pseudorange, NavLibrary &navLib, const NavSatelliteID &sat, const CommonTime &transmit, const EllipsoidModel &ellipsoid, bool smallAngleApprox=false, SVHealth xmitHealth=SVHealth::Any, NavValidityType valid=NavValidityType::ValidOnly, NavSearchOrder order=NavSearchOrder::User) |
static Position | rotateECEF (const Position &vec, double dt, const EllipsoidModel &ellipsoid, bool smallAngleApprox=false) |
static Triple | rotateECEF (const Triple &vec, double dt, const EllipsoidModel &ellipsoid, bool smallAngleApprox=false) |
static Xvt | rotateECEF (const Xvt &xvt, double dt, const EllipsoidModel &ellipsoid, bool smallAngleApprox=false) |
|
static |
Compute geometric range from an SV's transmitting position to a receiver's position and accounting for the rotation of the ECEF frame during the time of flight.
The computation is equiavalent to
[in] | rxPos | ( ![]() |
[in] | receive | ( ![]() |
[in] | svPos | ( ![]() |
[in] | transmit | ( ![]() |
[in] | ellipsoid | Used to provide an angular rate of rotation of the ECEF ( ![]() |
[in] | smallAngleApprox | If true, uses the small angle approximation to skip trigonometric computations. This can be used to reduce the number of operations but sacrifice precision. |
Definition at line 395 of file RawRange.cpp.
|
static |
Compute geometric range from an SV's transmitting position to a receiver's position and accounting for the rotation of the ECEF frame during the time of flight.
The computation is equiavalent to
[in] | rxPos | ( ![]() |
[in] | receive | ( ![]() |
[in] | svPos | ( ![]() |
[in] | transmit | ( ![]() |
[in] | ellipsoid | Used to provide an angular rate of rotation of the ECEF ( ![]() |
[in] | smallAngleApprox | If true, uses the small angle approximation to skip trigonometric computations. This can be used to reduce the number of operations but sacrifice precision. |
Definition at line 371 of file RawRange.cpp.
|
static |
Compute geometric range from an SV's transmitting position to a receiver's position and accounting for the rotation of the ECEF frame during the time of flight.
The computation is equiavalent to
[in] | rxPos | ( ![]() |
[in] | svPos | ( ![]() |
[in] | tof | ( ![]() |
[in] | ellipsoid | Used to provide an angular rate of rotation of the ECEF ( ![]() |
[in] | smallAngleApprox | If true, uses the small angle approximation to skip trigonometric computations. This can be used to reduce the number of operations but sacrifice precision. |
Definition at line 407 of file RawRange.cpp.
|
static |
Compute geometric range from an SV's transmitting position to a receiver's position and accounting for the rotation of the ECEF frame during the time of flight.
The computation is equiavalent to
[in] | rxPos | ( ![]() |
[in] | svXvt | The SV's position ( ![]() |
[in] | tof | ( ![]() |
[in] | ellipsoid | Used to provide an angular rate of rotation of the ECEF ( ![]() |
[in] | smallAngleApprox | If true, uses the small angle approximation to skip trigonometric computations. This can be used to reduce the number of operations but sacrifice precision. |
Definition at line 383 of file RawRange.cpp.
|
static |
Estimate signal transmission time using receiver observations and ephemeris.
A pseudorange is typically formed as the difference between nominal receive time and nominal transmit time, multiplied by the speed of light.
The nominal transmit time consists of the actual transmit time plus clock offsets at the time of broadcast. Clock offsets are provided by SV ephemeris broadcasts.
Solving for transmit time, we get:
[in] | receiveNominal | The receive time in the time frame of the receiver |
[in] | pseudorange | Measured pseudorange at the nominal receive time |
[in] | navLib | The navigation data library to use for looking up satellite XVT. |
[in] | sat | Satellite ID to get the position for. |
[in] | xmitHealth | The desired health status of the transmitting satellite. |
[in] | valid | Specify whether to search only for valid or invalid messages, or both. |
[in] | order | Specify whether to search by receiver behavior or by nearest to when in time. |
Definition at line 347 of file RawRange.cpp.
|
static |
Estimate a transmit time using a known receive time and geometric constraints.
This method estimates a transmit time by finding the optimal solution to the set of equations:
The above equations are evaluated iteratively until an end condition is met.
[in] | rxPos | A receiver's position in ECEF |
[in] | navLib | The navigation data library to use for looking up satellite XVT. |
[in] | sat | Satellite ID to get the position for. |
[in] | ellipsoid | Ellipsoid model to provide an ECEF rotation rate. |
[in] | xmitHealth | The desired health status of the transmitting satellite. |
[in] | valid | Specify whether to search only for valid or invalid messages, or both. |
[in] | order | Specify whether to search by receiver behavior or by nearest to when in time. |
[in] | seed | An initial guess of the time of flight ( ![]() |
[in] | threshold | Convergence threshold |
[in] | maxIter | Max number of iterations to evaluate |
Definition at line 298 of file RawRange.cpp.
|
static |
Compute geometric range from an SV's transmitting positioning
Uses a combination of fromSvTransmit() and fromNominalReceiveWithObs to estimate the range from SV to RX.
[in] | rxPos | A receiver's position in ECEF |
[in] | receiveNominal | The receive time in the time frame of the receiver |
[in] | navLib | The navigation data library to use for looking up satellite XVT. |
[in] | sat | Satellite ID to get the position for. |
[in] | ellipsoid | Ellipsoid model to provide an ECEF rotation rate. |
[in] | smallAngleApprox | If true, uses the small angle approximation to skip trigonometric computations. This can be used to reduce the number of operations but sacrifice precision. |
[in] | xmitHealth | The desired health status of the transmitting satellite. |
[in] | valid | Specify whether to search only for valid or invalid messages, or both. |
[in] | order | Specify whether to search by receiver behavior or by nearest to when in time. |
[in] | seed | An initial guess of the time of flight ( ![]() |
[in] | threshold | Convergence threshold |
[in] | maxIter | Max number of iterations to evaluate |
Definition at line 199 of file RawRange.cpp.
|
static |
Compute geometric range from receiver observations
This is the common approach to computing raw range when provided receiver observations. It uses estTransmitFromObs to generate a transmit time and then compute raw range.
[in] | rxPos | A receiver's position in ECEF |
[in] | receiveNominal | The receive time in the time frame of the receiver |
[in] | pseudorange | Measured pseudorange at the nominal receive time |
[in] | navLib | The navigation data library to use for looking up satellite XVT. |
[in] | sat | Satellite ID to get the position for. |
[in] | ellipsoid | Ellipsoid model to provide an ECEF rotation rate. |
[in] | smallAngleApprox | If true, uses the small angle approximation to skip trigonometric computations. This can be used to reduce the number of operations but sacrifice precision. |
[in] | xmitHealth | The desired health status of the transmitting satellite. |
[in] | valid | Specify whether to search only for valid or invalid messages, or both. |
[in] | order | Specify whether to search by receiver behavior or by nearest to when in time. |
Definition at line 242 of file RawRange.cpp.
|
static |
Compute geometric range at a known receive time
[in] | rxPos | A receiver's position in ECEF |
[in] | receive | The receive time |
[in] | navLib | The navigation data library to use for looking up satellite XVT. |
[in] | sat | Satellite ID to get the position for. |
[in] | ellipsoid | Ellipsoid model to provide an ECEF rotation rate. |
[in] | smallAngleApprox | If true, uses the small angle approximation to skip trigonometric computations. This can be used to reduce the number of operations but sacrifice precision. |
[in] | xmitHealth | The desired health status of the transmitting satellite. |
[in] | valid | Specify whether to search only for valid or invalid messages, or both. |
[in] | order | Specify whether to search by receiver behavior or by nearest to when in time. |
[in] | seed | An initial guess of the time of flight ( ![]() |
[in] | threshold | Convergence threshold |
[in] | maxIter | Max number of iterations to evaluate |
Definition at line 150 of file RawRange.cpp.
|
static |
Compute geometric range from an SV's known transmitting position.
This method estimates a transmit time by holding the SV position as constant and finding the optimal solution to the set of equations:
[in] | rxPos | A receiver's position in ECEF |
[in] | svXvt | An SV's Xvt |
[in] | ellipsoid | Ellipsoid model to provide an ECEF rotation rate. |
[in] | smallAngleApprox | If true, uses the small angle approximation to skip trigonometric computations. This can be used to reduce the number of operations but sacrifice precision. |
[in] | seed | An initial guess of the time of flight ( ![]() |
[in] | threshold | Convergence threshold |
[in] | maxIter | Max number of iterations to evaluate |
Definition at line 57 of file RawRange.cpp.
|
static |
Compute geometric range from an SV's transmitting position
This method is the same as RawRange::fromSvPos() but will look up the SV position for you by the provided time and NavLibrary.
[in] | rxPos | A receiver's position in ECEF |
[in] | navLib | The navigation data library to use for looking up satellite XVT. |
[in] | sat | Satellite ID to get the position for. |
[in] | transmit | The transmit time |
[in] | ellipsoid | Ellipsoid model to provide an ECEF rotation rate. |
[in] | smallAngleApprox | If true, uses the small angle approximation to skip trigonometric computations. This can be used to reduce the number of operations but sacrifice precision. |
[in] | xmitHealth | The desired health status of the transmitting satellite. |
[in] | valid | Specify whether to search only for valid or invalid messages, or both. |
[in] | order | Specify whether to search by receiver behavior or by nearest to when in time. |
[in] | seed | An initial guess of the time of flight ( ![]() |
[in] | threshold | Convergence threshold |
[in] | maxIter | Max number of iterations to evaluate |
Definition at line 90 of file RawRange.cpp.
|
static |
Compute geometric range using a known transmit time and pseudorange measurement.
This is specifically used for smoothed observations which are time stamped by SV transmit time.
[in] | rxPos | A receiver's position in ECEF |
[in] | pseudorange | A measured pseudorange |
[in] | navLib | The navigation data library to use for looking up satellite XVT. |
[in] | sat | Satellite ID to get the position for. |
[in] | ellipsoid | Ellipsoid model to provide an ECEF rotation rate. |
[in] | smallAngleApprox | If true, uses the small angle approximation to skip trigonometric computations. This can be used to reduce the number of operations but sacrifice precision. |
[in] | xmitHealth | The desired health status of the transmitting satellite. |
[in] | valid | Specify whether to search only for valid or invalid messages, or both. |
[in] | order | Specify whether to search by receiver behavior or by nearest to when in time. |
Definition at line 118 of file RawRange.cpp.
|
static |
Transform ECEF coordinates into rotated ECEF frame
The transformation is equiavalent to
[in] | vec | A position. If it is not in ECEF it will first be converted to ECEF before performing rotation. |
[in] | dt | Time of rotation in seconds |
[in] | ellipsoid | Provides the angular rate of the ECEF |
[in] | smallAngleApprox | If true, uses the small angle approximation to skip trigonometric computations. This can be used to reduce the number of operations but sacrifice precision. |
Definition at line 444 of file RawRange.cpp.
|
static |
Transform ECEF coordinates into rotated ECEF frame
The transformation is equiavalent to
[in] | vec | An ECEF vector |
[in] | dt | Time of rotation in seconds |
[in] | ellipsoid | Provides the angular rate of the ECEF |
[in] | smallAngleApprox | If true, uses the small angle approximation to skip trigonometric computations. This can be used to reduce the number of operations but sacrifice precision. |
Definition at line 420 of file RawRange.cpp.
|
static |
Transform ECEF coordinates into rotated ECEF frame
This method will transform both the xvt position and velocity vectors to keep them consistent.
The transformation is equiavalent to
[in] | xvt | An ECEF position and velocity |
[in] | dt | Time of rotation in seconds |
[in] | ellipsoid | Provides the angular rate of the ECEF |
[in] | smallAngleApprox | If true, uses the small angle approximation to skip trigonometric computations. This can be used to reduce the number of operations but sacrifice precision. |
Definition at line 462 of file RawRange.cpp.