pvt.h
Go to the documentation of this file.
00001 /*
00002  * Copyright (C) 2010 Swift Navigation Inc.
00003  * Contact: Henry Hallam <henry@swift-nav.com>
00004  *          Matt Peddie <peddie@alum.mit.edu>
00005  *
00006  * This source is subject to the license found in the file 'LICENSE' which must
00007  * be be distributed together with this source. All other rights reserved.
00008  *
00009  * THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND,
00010  * EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED
00011  * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE.
00012  */
00013 
00014 #ifndef LIBSWIFTNAV_PVT_H
00015 #define LIBSWIFTNAV_PVT_H
00016 
00017 #include "common.h"
00018 #include "track.h"
00019 
00020 /* GPS constants */
00022 #define GPS_NUM_SATS  32
00023 #define GPS_PI      3.14159265358979323846
00024 #define GPS_L1_HZ     1.57542E9
00025 #define NAV_OMEGAE_DOT 7.2921151467e-005
00026 #define NAV_GM 3.986005e14
00027 #define NAV_C 299792458.0
00028 #define NAV_F -4.442807633e-010
00029 #define NOMINAL_RANGE 22980E3 /* Average distance to satellite, meters. */
00030 #define R2D (180.0/GPS_PI)    /* Radians to degrees. */
00031 #define D2R (GPS_PI/180.0)    /* Degrees to radians. */
00032 
00033 #define GNSS_MAX_OBS GPS_NUM_SATS
00034 #define GNSS_MAX_RECEIVERS 1
00035 
00036 #define PVT_MAX_ITERATIONS 20
00037 
00038 typedef struct {
00039   double pdop;
00040   double gdop;
00041   double tdop;
00042   double hdop;
00043   double vdop;
00044 } dops_t;
00045 
00046 typedef struct __attribute__((packed)) {
00047   /*
00048    * Be careful of stuct packing to avoid (very mild) slowness,
00049    * try to keep all the types aligned i.e. put the 64bit
00050    * things together at the top, then the 32bit ones etc.
00051    */
00053   double pos_llh[3];
00055   double pos_ecef[3];
00057   double vel_ned[3];
00059   double vel_ecef[3];
00060 
00061   /* This is the row-first upper diagonal matrix of error covariances
00062    * in x, y, z (all receiver clock covariance terms are ignored).  So
00063    * it goes like so:
00064    *
00065    *    0  1  2
00066    *    _  3  4
00067    *    _  _  5
00068    *
00069    *    Index 6 is the GDOP.
00070    */
00071   double err_cov[7];
00072 
00073   double clock_offset;
00074   double clock_bias;
00075 
00076   /* GPS time */
00077   gps_time_t time;
00078 
00079   /* 0 = invalid, 1 = code phase */
00080   u8 valid;
00081   /* Number of channels used in the soluton. */
00082   u8 n_used;
00083 } gnss_solution;
00084 
00085 u8 calc_PVT(const u8 n_used,
00086             const navigation_measurement_t const nav_meas[n_used],
00087             gnss_solution *soln,
00088             dops_t *dops);
00089 
00090 #endif /* LIBSWIFTNAV_PVT_H */
00091 


enu
Author(s): Mike Purvis
autogenerated on Fri Jan 3 2014 11:21:07