Example #1
0
bool RawRtcm23::ProcessAntennaRef(Frame& f)
{
	int64 x = ((int64)f.GetSigned(3, 1, 24)<<14) | f.GetField(4, 1, 14);
	int64 y = ((int64)f.GetSigned(4, 17, 24)<<30) | (f.GetField(5, 1, 24)<<6) | f.GetField(6,1,6);
	int64 z = ((int64)f.GetSigned(6, 9, 24)<<22) | f.GetField(7, 1, 22);
	int64 height = 0;
	if (f.GetField(7, 24, 24) != 0)
		height = f.GetField(8, 1, 18);

	Pos = Position(x/10000.0, y/10000.0, z/10000.0);
	AntennaHeight = height/10000.0;
	debug("ProcessAntennaRef: x=%.3f y=%.3f z=%.3f h=%.3f\n",
		Pos.x, Pos.y, Pos.z, AntennaHeight);
	return OK;
}
Example #2
0
bool RawRtcm23::ProcessCarrierPhase(Frame& f)
{
	// Get the time of measurement
	if (GetMeasurementTime(f) != OK)
		return OK;

	// We are only interested in L1 for now
	if (f.GetField(3, 1, 2) != 0)
		return OK;

	// Decide how many observables
	int n = (f.NrWords-3)/2;

	// Get the data for each observation
	for (int i=0; i<n; i++) {

		// We want C/A GPS measurements only (for now)
		if (f.GetField(4+2*i, 2, 3) != 0) continue;

		// which satellite?
		int svid = f.GetField(4+2*i, 4, 8);
		int Sat = SvidToSat(svid);
		if (Sat == -1) return Error("RawRtcm23: didn't recognize svid=%d\n", svid);
		HasPhase[Sat] = true;

		// Phase
		int64 phase = (f.GetSigned(4+2*i, 17, 24)<<24) | f.GetField(5+2*i, 1, 24);
		obs[Sat].Phase = phase / -256.0;

		obs[Sat].Doppler = 0;

		// TODO: Handle phase rollover.
		//  for now, it will be caught as an outlier

		// Quality
		uint32 DataQual = f.GetField(4+2*i, 9, 11);

		// Slipped?
		int32 LossCount = f.GetField(4+2*i, 12, 16);
		obs[Sat].Slip = (LossCount == CarrierLossCount[Sat]);
		if (obs[Sat].Slip)
			CarrierLossCount[Sat] = LossCount;

		// More?
		MoreToCome = (f.GetField(4+2*i, 1, 1) != 0);
		debug("RawRtcm23: Sat=%d  Phase=%.3f  MoreToComm=%d\n", Sat,obs[Sat].Phase, MoreToCome);
	}

	return OK;
}