goGPS-Project/goGPS_Java

Decode 1077 Message

Opened this issue · 12 comments

Hello!

We are a researcher team trying to correct the mobile position with Ntrip and data from satellites.

We are trying to decode 1077 message but we have a problem with the length of bits (parameter that receive the function decode: ).

In RTCM put that sometimes the size of 1077 is bigger than supported and you have to split it. Split it and without it we have the follow error (the same message but change the numbers):

Process: com.rtklib.rtklib, PID: 7242
java.lang.ArrayIndexOutOfBoundsException: Invalid subset: exceeds length of 3576:
start of subset: 3492, length of subset: 190

And we have the dude about if we have to split bits or bits is already splitted and we have to read the next bits.

Thank you for your help.

hi @carolinaA2e

could you post a stack trace and possibly a binary RTCM message so I could try and reproduce?

Hello,

We don't have any binary RTCM message. Here you have the class of decode 1077 that we made it.

package com.rtklib.rtklib.parser;

import android.util.Log;
import com.rtklib.rtklib.producer.ObservationMsm;
import com.rtklib.rtklib.producer.ObservationSet;
import com.rtklib.rtklib.util.Bits;
public class Decode1077Msg implements Decode{
    //private int nSat = 0;
    //private int nSig = 0;
    @Override
    public Object decode(boolean[] bits, int week) {
        Log.e("tam bits ",String.valueOf(bits.length) + " week "+ String.valueOf(week));
        if(bits.length < 169+64){
            return null;
        }
        //Header
        int start = 12;
        //message number
        int DF002 = (int) Bits.bitsToUInt(Bits.subset(bits,start,12));
        start += 12;
        //Reference station ID
        int DF003 = (int) Bits.bitsToUInt(Bits.subset(bits,start,12));
        start += 12;
        long GNSSEpochTime = Bits.bitsToUInt(Bits.subset(bits,start,30));
        start += 30;
        //Multiple Message Bit
        boolean DF393 =  (Bits.bitsToUInt(Bits.subset(bits,start,1)) == 1);
        start += 1;
        //IODS Issue of data station
        int DF409 = (int) Bits.bitsToUInt(Bits.subset(bits,start,3));
        start += 3;
        //Reserved
        int DF001 = (int) Bits.bitsToUInt(Bits.subset(bits,start,7));
        start += 7;
        //Clock Steering indicator
        int DF411 = (int) Bits.bitsToUInt(Bits.subset(bits,start,2));
        start += 2;
        //External CLock Indicater
        int DF412 = (int) Bits.bitsToUInt(Bits.subset(bits,start,2));
        start += 2;
        //GNSS Divergence-free smoothing indicator
        boolean DF417 = (Bits.bitsToUInt(Bits.subset(bits,start,1)) == 1);
        start += 1;
        //GNSS Smoothing interval
        int DF418 = (int) Bits.bitsToUInt(Bits.subset(bits,start,3));
        start += 3;
        //GNSS Satellite Mask
        long DF394 = (long) Bits.bitsToUInt(Bits.subset(bits,start,64));
        start += 64;
        Log.e("satellite mask ", String.valueOf(DF394));
        //GNSS Signal Mask
        int DF395 = (int) Bits.bitsToUInt(Bits.subset(bits,start,32));
        start += 32;
        /*El tamaño de Cell Mask = Nº Satelites * Nº señales
         * Nº satelites = (nº de bits que se ponen en 1 en la máscara del satélite)
         * Nº señales = nº de bits que se ponen en 1 en la máscara de señales
         */
        int nSat = hammingWeight(DF394);
        int nSig = hammingWeight(DF395);
        Log.e("numero señales ",String.valueOf(nSig));

        //GNSS Cell Mask
        //Log.e("Cell mask tamaño ",String.valueOf(nSat*nSig));
        int DF396 = (int) Bits.bitsToUInt(Bits.subset(bits,start,nSat * nSig));
        start += nSat * nSig;
        Log.e("carga ","heade r nsat*nSig "+ String.valueOf(nSat*nSig));

        ObservationMsm os = new ObservationMsm();
        os.setMsgNumber(DF002);
        os.setStationId(DF003);
        os.setGnssEpoch(GNSSEpochTime);
        os.setMultipleMsg(DF393);
        os.setIods(DF409);
        os.setReserved(DF001);
        os.setClockSteeringInd(DF411);
        os.setExternalClockInd(DF412);
        os.setGnssDivSmootInd(DF417);
        os.setGnssSmootInt(DF418);
        os.setGnssSatMask(DF394);
        os.setGnssSignalCNRs((int)DF395);
        os.setGnssCellMask(DF396);
        //PRUEBAS Descomentar linea 193 ntripclientsocket
        Log.e("Header", " "+
                "msgNumber=" + DF002 +
                ", stationId=" + DF003 +
                ", gnssEpoch=" + GNSSEpochTime +
                ", multipleMsg=" + DF393 +
                ", iods=" + DF409 +
                ", reserved=" + DF001 +
                ", clockSteeringInd=" + DF411 +
                ", externalClockInd=" + DF412 +
                ", gnssDivSmootInd=" + DF417 +
                ", gnssSmootInt=" + DF418 +
                ", gnssSatMask=" + DF394 + " - "+Long.toBinaryString(DF394)+ " - " + nSat +
                ", gnssSignalMask=" + DF395 + " - "+Long.toBinaryString(DF395)+ " - " + nSig +
                ", gnssCellMask=" + DF396);
        //Content of Satellite data for MSM7
        if(bits.length < 36 * nSat){
            return null;
        }

        for(int i = 0; i < nSat /*number messages*/; ++i){
            //Log.e(" size start satellite ", String.valueOf(start) + " bits length " + String.valueOf(bits.length));

            //The number of integer milliseconds in GNSS Satellite rough ranges
            int DF397 = (int) Bits.bitsToUInt(Bits.subset(bits,start,8*nSat));
            start += 8*nSat;
            //Extended Satellite Information specific for each GNSS
            int satExtendedInf = (int) Bits.bitsToUInt(Bits.subset(bits,start,4*nSat));
            start += 4*nSat;
            //GNSS Satellite rough ranges modulo 1 millisecond
            int DF398 = (int) Bits.bitsToUInt(Bits.subset(bits,start,10*nSat));
            start += 10*nSat;
            //GNSS Satellite rough PhaseRangeRates
            int DF399 = (int) Bits.bitsTwoComplement(Bits.subset(bits,start,14*nSat));
            start += 14*nSat;

            os.setSecondSatRoughRanges(DF397);
            os.setSatExtendedInf(satExtendedInf);
            os.setGnssSatRoughRange(DF398);
            os.setGnssSatRoughPhaseRangeRates(DF399);

            Log.e("Content satellite", " "+
                    "secondSatRoughRanges=" + DF397 +
                    ", satExtendedInf=" + satExtendedInf +
                    ", gnssSatRoughRange=" + DF398 +
                    ", gnssSatRoughPhaseRangeRates=" + DF399);
            //Log.e("carga ","content satellite");

        }

        int nCell = hammingWeight(DF396);
        Log.e("nCell", String.valueOf(nCell)+ " " + Long.toBinaryString(DF396) + " DF396 "+ String.valueOf(DF396));
        if(bits.length < 80*nCell){
            return null;
        }

        for(int i = 0; i < nCell; ++i){
            //Log.e(" size start cell ", String.valueOf(start));
            //Content of signal data
            //GNSS signal fine Pseudoranges with extender resolution
            //DF396 = n cell
            int DF405 = (int) Bits.bitsTwoComplement(Bits.subset(bits,start,20*nCell));
            start += 20*nCell;
            //Log.e("start:", String.valueOf(start));
            //GNSS signal fine PhaseRange data with extended resolution
            int DF406 = (int) Bits.bitsTwoComplement(Bits.subset(bits,start,24*nCell));
            start += 24*nCell;
            //GNSS PhaseRange Lock Time Indicator with extended range and resolution.
            int DF407 = (int) Bits.bitsToUInt(Bits.subset(bits,start,10*nCell));
            start += 10*nCell;
            //Half-cycle ambiguity indicator
            int DF420 = (int) Bits.bitsTwoComplement(Bits.subset(bits,start,1*nCell));
            start += 1*nCell;
            //GNSS signal CNRs with extended resolution
            int DF408 = (int) Bits.bitsTwoComplement(Bits.subset(bits,start,10*nCell));
            start += 10*nCell;
            //GNSS signal fine PhaseRangeRates
            int DF404 = (int) Bits.bitsToUInt(Bits.subset(bits,start,15*nCell));
            start += 15*nCell;
            Log.e("Carga "," content signal");
            Log.e("Content signal", " "+
                    "GNSS signal fine Pseudoranges with extender resolution=" + DF405 +
                    ", GNSS signal fine PhaseRange data with extended resolution=" + DF406 +
                    ", GNSS PhaseRange Lock Time Indicator with extended range and resolution=" + DF407 +
                    ", Half-cycle ambiguity indicator=" + DF420 +
                    ", GNSS signal CNRs with extended resolution=" + DF408 +
                    ", GNSS signal fine PhaseRangeRates=" + DF404);
            //Content of signal data
            os.setGnssSignalFinePseudoranges(DF405);
            os.setGnssSignalFinePhaseRangeExtResol(DF406);
            os.setGnssPhaseRangeLockTimeInd(DF407);
            os.setHalfCycleAmbiguityInd(DF420);
            os.setGnssSignalCNRs(DF408);
            os.setGnssSignalFinePhaseRange(DF404);
        }
        return os;
    }
    @Override
    public String toString() {
        return "Decode1077Msg{}";
    }

   /* public int getnSat() {
        return nSat;
    }

    public void setnSat(int nSat) {
        this.nSat = nSat;
    }*/

    //public void setnSig(int nSig) { this.nSig = nSig;}

    //Cuenta el nº de bits puestos a 1
    private int hammingWeight(int n) {
        return Integer.bitCount(n);
    }

    //Cuenta el nº de bits puestos a 1
    private int hammingWeight(long n) {
        return Long.bitCount(n);
    }

    
    }
}

Thank you!

Thank you for sending that. An example binary message would be really useful if you could send it. But I'll have a look myself in the meantime

Sorry but I don't have one. We are tried to decode this message to get it.

I've checked out their project to see whether there are some changes that could be useful to you.
There are no changes as far message 1077 goes but there are some changes in RTCM3Client that could be useful, not sure.
I'm totaly unfamiliar with RTCM. Do you know if I can create a free account on IGS or anywhere else? I can't find much information

Hello, I can send you the Standar RTCM an one paper about the decode of this message. Can you give me your email? I've tried to add you by linkedin or send you a message but I couldn't. And yesterday an IGS contact told me that we don't have to divided the message. The message is sent complete and that we have to review the order of read the message. So, I think we are going to finish this decode soon. If we find the solution I'll let you know.

Thank you for your attention to this matter.

I've checked out their project to see whether there are some changes that could be useful to you. There are no changes as far message 1077 goes but there are some changes in RTCM3Client that could be useful, not sure. I'm totaly unfamiliar with RTCM. Do you know if I can create a free account on IGS or anywhere else? I can't find much information

Hi @ZiglioUK you can register to some free RTCM streaming services from this page: https://igs.org/rts/user-access/
Not sure whether you can find a caster streaming message 1077 there though...

@carolinaA2e first of all, nice to e-meet you, and thanks for your interest in goGPS! Could you suggest a source of 1077 messages? If you could share some material about it, it would be greatly appreciated. I wrote most of goGPS RTCM parsers, but it was years ago, and I did not follow the more recent developments.

Hello @ege010, nice to e-meet you too. Here I've attached the material that we have it. The first it is very complete about RTCM 3.2 and you have to look for MSM7 or 1077 and read about it. And the second is a paper specific about MSM messages. Thank you for your attention!

Hi @carolinaA2e thank you! I took the liberty to edit your message to remove the links to the documents, because I believe there might be copyright issues with one of them.

Hi @ege010, yes, it is ok.

Oh, can the old uCenter run an NTRIP Caster? that'd be awesome

image