Changeset 1808 in ntrip


Ignore:
Timestamp:
Apr 24, 2009, 10:36:34 AM (16 years ago)
Author:
stoecker
Message:

fixed

Location:
trunk/clock_and_orbit
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/clock_and_orbit/clock_orbit_rtcm.c

    r1581 r1808  
    33        Name:           clock_orbit_rtcm.c
    44        Project:        RTCM3
    5         Version:        $Id: clock_orbit_rtcm.c,v 1.2 2008/11/26 12:05:37 stoecker Exp $
     5        Version:        $Id: clock_orbit_rtcm.c,v 1.9 2009/02/27 08:59:49 weber Exp $
    66        Authors:        Dirk Stöcker
    77        Description:    state space approach for RTCM3
     
    9393
    9494/* defined values */
    95 #define T_DELTA_RADIAL(a)                SCALEADDBITS(22, 10000.0, a)
    96 #define T_DELTA_ALONG_TRACK(a)           SCALEADDBITS(22, 10000.0, a)
    97 #define T_DELTA_CROSS_TRACK(a)           SCALEADDBITS(22, 10000.0, a)
    98 #define T_DELTA_DOT_RADIAL(a)            SCALEADDBITS(21, 1000000.0, a)
    99 #define T_DELTA_DOT_ALONG_TRACK(a)       SCALEADDBITS(21, 1000000.0, a)
    100 #define T_DELTA_DOT_CROSS_TRACK(a)       SCALEADDBITS(21, 1000000.0, a)
     95#define T_DELTA_RADIAL(a)                SCALEADDBITS(22,    10000.0, a)
     96#define T_DELTA_ALONG_TRACK(a)           SCALEADDBITS(20,     2500.0, a)
     97#define T_DELTA_CROSS_TRACK(a)           SCALEADDBITS(20,     2500.0, a)
     98#define T_DELTA_DOT_RADIAL(a)            SCALEADDBITS(21,  1000000.0, a)
     99#define T_DELTA_DOT_ALONG_TRACK(a)       SCALEADDBITS(19,   250000.0, a)
     100#define T_DELTA_DOT_CROSS_TRACK(a)       SCALEADDBITS(19,   250000.0, a)
    101101#define T_DELTA_DOT_DOT_RADIAL(a)        SCALEADDBITS(27, 50000000.0, a)
    102 #define T_DELTA_DOT_DOT_ALONG_TRACK(a)   SCALEADDBITS(27, 50000000.0, a)
    103 #define T_DELTA_DOT_DOT_CROSS_TRACK(a)   SCALEADDBITS(27, 50000000.0, a)
     102#define T_DELTA_DOT_DOT_ALONG_TRACK(a)   SCALEADDBITS(25, 12500000.0, a)
     103#define T_DELTA_DOT_DOT_CROSS_TRACK(a)   SCALEADDBITS(25, 12500000.0, a)
    104104#define T_SATELLITE_REFERENCE_POINT(a)   ADDBITS(1, a)
    105105
    106106#define T_SATELLITE_REFERENCE_DATUM(a)   ADDBITS(1, a)
    107 #define T_DELTA_CLOCK_C0(a)              SCALEADDBITS(22, 10000.0, a)
    108 #define T_DELTA_CLOCK_C1(a)              SCALEADDBITS(21, 1000000.0, a)
     107#define T_DELTA_CLOCK_C0(a)              SCALEADDBITS(22,    10000.0, a)
     108#define T_DELTA_CLOCK_C1(a)              SCALEADDBITS(21,  1000000.0, a)
    109109#define T_DELTA_CLOCK_C2(a)              SCALEADDBITS(27, 50000000.0, a)
    110110#define T_NO_OF_CODE_BIASES(a)           ADDBITS(5, a)
     
    112112#define T_GLONASS_SIGNAL_IDENTIFIER(a)   ADDBITS(5, a)
    113113#define T_GALILEO_SIGNAL_IDENTIFIER(a)   ADDBITS(5, a)
    114 #define T_CODE_BIAS(a)                   SCALEADDBITS(14, 100.0, a)
     114#define T_CODE_BIAS(a)                   SCALEADDBITS(14,      100.0, a)
    115115#define T_GLONASS_SATELLITE_ID(a)        ADDBITS(5, a)
    116116
     
    120120#define T_MULTIPLE_MESSAGE_INDICATOR(a)  ADDBITS(1, a)
    121121#define T_SSR_URA(a)                     ADDBITS(4, a)
    122 #define T_HR_CLOCK_CORRECTION(a)         SCALEADDBITS(22, 10000.0, a)
     122#define T_HR_CLOCK_CORRECTION(a)         SCALEADDBITS(22,    10000.0, a)
    123123#define T_SSR_UPDATE_INTERVAL(a)         ADDBITS(4, a)
    124124
     
    475475  while((a) > numbits) \
    476476  { \
    477     if(!size--) return GCOBR_SHORTBUFFER; \
     477    if(!size--) return GCOBR_SHORTMESSAGE; \
    478478    bitbuffer = (bitbuffer<<8)|((unsigned char)*(buffer++)); \
    479479    numbits += 8; \
     
    514514/* defined values */
    515515#define G_DELTA_RADIAL(a)                GETFLOATSIGN(a, 22, 1/10000.0)
    516 #define G_DELTA_ALONG_TRACK(a)           GETFLOATSIGN(a, 22, 1/10000.0)
    517 #define G_DELTA_CROSS_TRACK(a)           GETFLOATSIGN(a, 22, 1/10000.0)
     516#define G_DELTA_ALONG_TRACK(a)           GETFLOATSIGN(a, 20, 1/2500.0)
     517#define G_DELTA_CROSS_TRACK(a)           GETFLOATSIGN(a, 20, 1/2500.0)
    518518#define G_DELTA_DOT_RADIAL(a)            GETFLOATSIGN(a, 21, 1/1000000.0)
    519 #define G_DELTA_DOT_ALONG_TRACK(a)       GETFLOATSIGN(a, 21, 1/1000000.0)
    520 #define G_DELTA_DOT_CROSS_TRACK(a)       GETFLOATSIGN(a, 21, 1/1000000.0)
     519#define G_DELTA_DOT_ALONG_TRACK(a)       GETFLOATSIGN(a, 19, 1/250000.0)
     520#define G_DELTA_DOT_CROSS_TRACK(a)       GETFLOATSIGN(a, 19, 1/250000.0)
    521521#define G_DELTA_DOT_DOT_RADIAL(a)        GETFLOATSIGN(a, 27, 1/50000000.0)
    522 #define G_DELTA_DOT_DOT_ALONG_TRACK(a)   GETFLOATSIGN(a, 27, 1/50000000.0)
    523 #define G_DELTA_DOT_DOT_CROSS_TRACK(a)   GETFLOATSIGN(a, 27, 1/50000000.0)
     522#define G_DELTA_DOT_DOT_ALONG_TRACK(a)   GETFLOATSIGN(a, 25, 1/12500000.0)
     523#define G_DELTA_DOT_DOT_CROSS_TRACK(a)   GETFLOATSIGN(a, 25, 1/12500000.0)
    524524#define G_SATELLITE_REFERENCE_POINT(a)   GETBITS(a, 1)
    525525
     
    595595   (((unsigned char)buffer[sizeofrtcmblock+2]))))
    596596    return GCOBR_CRCMISMATCH;
     597  size = sizeofrtcmblock; /* reduce size, so overflows are detected */
    597598
    598599  G_MESSAGE_NUMBER(type)
     600#ifdef DEBUG
     601fprintf(stderr, "type %d size %d\n",type,sizeofrtcmblock);
     602#endif
    599603  switch(type)
    600604  {
     
    611615      return GCOBR_DATAMISMATCH;
    612616    co->OrbitDataSupplied = 1;
     617#ifdef DEBUG
     618fprintf(stderr, "epochtime %d ui %d mmi %d sats %d\n",co->GPSEpochTime,co->UpdateInterval,mmi,co->NumberOfGPSSat);
     619#endif
    613620    for(i = 0; i < co->NumberOfGPSSat; ++i)
    614621    {
     
    626633      G_SATELLITE_REFERENCE_POINT(co->SatRefPoint)
    627634      G_SATELLITE_REFERENCE_DATUM(co->SatRefDatum)
     635#ifdef DEBUG
     636fprintf(stderr, "id %2d iod %3d dr %8.3f da %8.3f dc %8.3f dr %8.3f da %8.3f dc %8.3f dr %8.3f da %8.3f dc %8.3f rp %d rd %d\n",
     637co->Sat[i].ID,co->Sat[i].IOD,co->Sat[i].Orbit.DeltaRadial,
     638co->Sat[i].Orbit.DeltaAlongTrack,co->Sat[i].Orbit.DeltaCrossTrack,
     639co->Sat[i].Orbit.DotDeltaRadial,
     640co->Sat[i].Orbit.DotDeltaAlongTrack,
     641co->Sat[i].Orbit.DotDeltaCrossTrack,
     642co->Sat[i].Orbit.DotDotDeltaRadial,
     643co->Sat[i].Orbit.DotDotDeltaAlongTrack,
     644co->Sat[i].Orbit.DotDotDeltaCrossTrack,
     645co->SatRefPoint,
     646co->SatRefDatum);
     647#endif
    628648    }
    629649    break;
     
    10621082    return GCOBR_UNKNOWNTYPE;
    10631083  }
     1084#ifdef DEBUG
     1085for(type = 0; type < size && (unsigned char)buffer[type] != 0xD3; ++type)
     1086  numbits += 8;
     1087fprintf(stderr, "numbits left %d\n",numbits);
     1088#endif
    10641089  if(bytesused)
    10651090    *bytesused = sizeofrtcmblock+6;
  • trunk/clock_and_orbit/clock_orbit_rtcm.h

    r1581 r1808  
    66        Name:           clock_orbit_rtcm.h
    77        Project:        RTCM3
    8         Version:        $Id: clock_orbit_rtcm.h,v 1.2 2008/11/26 12:05:37 stoecker Exp $
     8        Version:        $Id: clock_orbit_rtcm.h,v 1.8 2009/03/06 15:59:53 weber Exp $
    99        Authors:        Dirk Stöcker
    1010        Description:    state space approach for RTCM3
     
    1616enum SatelliteReferencePoint { POINT_IONOFREE=0, POINT_CENTER=1 };
    1717enum ClockOrbitType {
    18      COTYPE_GPSORBIT=4060, COTYPE_GPSCLOCK=4061,
    19      COTYPE_GPSCOMBINED=4063, COTYPE_GPSURA=4064, COTYPE_GPSHR=4065,
     18     COTYPE_GPSORBIT=3001, COTYPE_GPSCLOCK=3002,
     19     COTYPE_GPSCOMBINED=3004, COTYPE_GPSURA=3005, COTYPE_GPSHR=3006,
    2020
    21      COTYPE_GLONASSORBIT=4066, COTYPE_GLONASSCLOCK=4067,
    22      COTYPE_GLONASSCOMBINED=4069, COTYPE_GLONASSURA=4070, COTYPE_GLONASSHR=4071,
     21     COTYPE_GLONASSORBIT=3007, COTYPE_GLONASSCLOCK=3008,
     22     COTYPE_GLONASSCOMBINED=3010, COTYPE_GLONASSURA=3011, COTYPE_GLONASSHR=3012,
    2323
    2424     COTYPE_AUTO=0 };
    25 enum BiasType { BTYPE_GPS=4062, BTYPE_GLONASS=4068, BTYPE_AUTO = 0 };
     25enum BiasType { BTYPE_GPS=3003, BTYPE_GLONASS=3009, BTYPE_AUTO = 0 };
    2626
    2727enum COR_CONSTANTS {
     
    131131  GCOBR_SHORTBUFFER = -30,
    132132  GCOBR_MISSINGBITS = -31,
    133   GCOBR_MESSAGEEXCEEDSBUFFER = -32
     133  GCOBR_MESSAGEEXCEEDSBUFFER = -32,
     134  GCOBR_SHORTMESSAGE = -33
    134135};
    135136
Note: See TracChangeset for help on using the changeset viewer.