navigation.h

Go to the documentation of this file.
00001 /**
00002 \file    navigation.h
00003 \brief   GNSS core 'c' function library: navigation functions.
00004 \author  Glenn D. MacGougan (GDM)
00005 \date    2007-11-29
00006 \since   2005-08-23
00007 
00008 \b "LICENSE INFORMATION" \n
00009 Copyright (c) 2007, refer to 'author' doxygen tags \n
00010 All rights reserved. \n
00011 
00012 Redistribution and use in source and binary forms, with or without
00013 modification, are permitted provided the following conditions are met: \n
00014 
00015 - Redistributions of source code must retain the above copyright
00016   notice, this list of conditions and the following disclaimer. \n
00017 - Redistributions in binary form must reproduce the above copyright
00018   notice, this list of conditions and the following disclaimer in the
00019   documentation and/or other materials provided with the distribution. \n
00020 - The name(s) of the contributor(s) may not be used to endorse or promote 
00021   products derived from this software without specific prior written 
00022   permission. \n
00023 
00024 THIS SOFTWARE IS PROVIDED BY THE CONTRIBUTORS ``AS IS'' AND ANY EXPRESS 
00025 OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 
00026 WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
00027 DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
00028 INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
00029 (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 
00030 SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 
00031 CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 
00032 LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 
00033 OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 
00034 SUCH DAMAGE.
00035 */
00036 
00037 #ifndef _C_NAVIGATION_H_
00038 #define _C_NAVIGATION_H_
00039 
00040 #ifdef __cplusplus
00041 extern "C" {
00042 #endif
00043 
00044 
00045 /// \brief    Computes the derivative of the pseudorange with respect 
00046 ///           to X, Y, Z. Also computes the user to satellite range for 
00047 ///           convenience.
00048 /// 
00049 /// \author   Glenn D. MacGougan (GDM)
00050 /// \date     2005-08-23
00051 /// \since    2005-08-23
00052 /// 
00053 void NAVIGATION_ComputeDerivativesOf_Range_WithRespectTo_XYZ( 
00054   const double x,     //!< User X coordinate WGS84 ECEF      [m]
00055   const double y,     //!< User Y coordinate WGS84 ECEF      [m]
00056   const double z,     //!< User Z coordinate WGS84 ECEF      [m]
00057   const double satX,  //!< Satellite X coordinate WGS84 ECEF [m]
00058   const double satY,  //!< Satellite Y coordinate WGS84 ECEF [m]
00059   const double satZ,  //!< Satellite Z coordinate WGS84 ECEF [m]  
00060   double* dPdx,       //!< Derivative of P wrt X             []
00061   double* dPdy,       //!< Derivative of P wrt Y             []
00062   double* dPdz,       //!< Derivative of P wrt Z             []    
00063   double* range       //!< computed user to satellite range  [m]  
00064   );
00065 
00066 
00067 /// \brief    Computes the derivative of the pseudorange with respect 
00068 ///           to latitude, longitude, and height/ Also computes the user 
00069 ///           to satellite range for convenience.
00070 /// 
00071 /// \author   Glenn D. MacGougan (GDM)
00072 /// \date     2005-08-23
00073 /// \since    2005-08-23
00074 /// 
00075 void NAVIGATION_ComputeDerivativesOf_Range_WithRespectToLatitudeLongitudeHeight( 
00076   const double latitude,  //!< User geodetic latitude                   [rad]
00077   const double longitude, //!< User geodetic longtiude                  [rad]
00078   const double height,    //!< User geodetic height                     [m]
00079   const double satX,      //!< Satellite X coordinate WGS84 ECEF        [m]
00080   const double satY,      //!< Satellite Y coordinate WGS84 ECEF        [m]
00081   const double satZ,      //!< Satellite Z coordinate WGS84 ECEF        [m]  
00082   double* dlat,           //!< d(P)/d(lat) but not in units of [m/rad], [m/m]
00083   double* dlon,           //!< d(P)/d(lon) but not in units of [m/rad], [m/m]
00084   double* dhgt,           //!< d(P)/d(hgt)                              [m/m]
00085   double* range           //!< computed user to satellite range         [m]
00086   );
00087 
00088 
00089 
00090 
00091 /// \brief    Compute a closed form position solution using four 
00092 ///           raw pseudoranges.
00093 /// 
00094 /// \author   Glenn D. MacGougan (GDM)
00095 /// \date     2005-08-23
00096 /// \since    2005-08-23
00097 /// 
00098 /// \return   TRUE(1) if successful, FALSE(0) otherwise.
00099 ///
00100 /// \remarks
00101 /// (1) The satellite clock corrections in meters are required for each pseudorange \n
00102 /// (2) This function was written for easy portability into Matlab
00103 /// 
00104 /// \b REFERENCES \n
00105 /// [1] Mezentsev, O. and J. Collin (2004). A Closed Form Solution Of Non-Linear GPS 
00106 ///     Pseudorange Equations. White paper proof - not published.
00107 /// 
00108 int NAVIGATION_PerformClosedFormPositionSolution_FromPseuodrangeMeasurements(
00109   double p1,          //!< 1st raw pseudorange measurement [m]
00110   double p2,          //!< 2nd raw pseudorange measurement [m]
00111   double p3,          //!< 3rd raw pseudorange measurement [m]
00112   double p4,          //!< 4th raw pseudorange measurement [m]
00113   double prc_satclk1, //!< 1st satellite clock corrections for psuedoranges [m]
00114   double prc_satclk2, //!< 2nd satellite clock corrections for psuedoranges [m]
00115   double prc_satclk3, //!< 3rd satellite clock corrections for psuedoranges [m]
00116   double prc_satclk4, //!< 4th satellite clock corrections for psuedoranges [m]
00117   double x1,          //!< 1st satellite X coordinates, WGS84 ECEF [m]
00118   double x2,          //!< 2nd satellite X coordinates, WGS84 ECEF [m]
00119   double x3,          //!< 3rd satellite X coordinates, WGS84 ECEF [m]
00120   double x4,          //!< 4th satellite X coordinates, WGS84 ECEF [m]
00121   double y1,          //!< 1st satellite Y coordinates, WGS84 ECEF [m]
00122   double y2,          //!< 2nd satellite Y coordinates, WGS84 ECEF [m]
00123   double y3,          //!< 3rd satellite Y coordinates, WGS84 ECEF [m]
00124   double y4,          //!< 4th satellite Y coordinates, WGS84 ECEF [m]
00125   double z1,          //!< 1st satellite Z coordinates, WGS84 ECEF [m]
00126   double z2,          //!< 2nd satellite Z coordinates, WGS84 ECEF [m]
00127   double z3,          //!< 3rd satellite Z coordinates, WGS84 ECEF [m]
00128   double z4,          //!< 4th satellite Z coordinates, WGS84 ECEF [m]
00129   double* latitude,   //!< The computed geodetic latitude [rad]
00130   double* longitude,  //!< The computed geodetic longitude [rad]
00131   double* height,     //!< The computed geodetic height [m]
00132   double* rx_clock_bias //!< The computed receiver clock bias [m]
00133   );
00134 
00135 #ifdef __cplusplus
00136 }
00137 #endif
00138 
00139 
00140 #endif // _C_NAVIGATION_H_