예제 #1
0
class IMUPacket(DataType):
    _ID = 3
    desc = pack.ComposedType([
        ('index', pack.IntType(64)),
        ('proper_acceleration', TupleType([pack.StructType('<d')] * 3)),
        ('angular_velocity', TupleType([pack.StructType('<d')] * 3)),
    ])
예제 #2
0
class GNSSCorrelationPacket(DataType):
    _ID = 128
    desc = pack.ComposedType([
        ('stream', pack.IntType(32)),
        ('substream', pack.IntType(32)),
        ('sv', pack.IntType(16)),
        ('center_samples', pack.IntType(64)),  # XXX is signed
        ('center_fractional_samples', pack.StructType('<d')),
        ('doppler', pack.StructType('<d')),
        ('chip_speed', pack.StructType('<d')),
        ('correlations', ListType(ComplexType())),
    ])
예제 #3
0
class MagnetometerPacket(DataType):
    _ID = 6
    desc = pack.ComposedType([
        ('stream', pack.IntType(16)),
        ('index', pack.IntType(64)),
        ('magnetic_field', TupleType([pack.StructType('<d')] * 3)),
    ])
예제 #4
0
class BarometerPacket(DataType):
    _ID = 4
    desc = pack.ComposedType([
        ('stream', pack.IntType(16)),
        ('index', pack.IntType(64)),
        ('pressure', pack.StructType('<d')),
    ])
예제 #5
0
class ComplexType(pack.Type):
    _inner = pack.StructType('<d')

    def read(self, file):
        real, file = self._inner.read(file)
        imag, file = self._inner.read(file)
        return complex(real, imag), file

    def write(self, file, item):
        c = complex(item)
        file = self._inner.write(file, c.real)
        file = self._inner.write(file, c.imag)
        return file
예제 #6
0
class GNSSObservationPacket(DataType):
    _ID = 192
    desc = pack.ComposedType([
        ('stream', pack.IntType(32)),
        ('substream', pack.IntType(32)),
        ('sv', pack.IntType(16)),
        ('origin_time',
         pack.ComposedType([
             ('WN', pack.StructType('<i')),
             ('TOW_ps', pack.StructType('<q')),
         ])),
        ('origin_position', TupleType([pack.StructType('<d')] * 3)),
        ('origin_velocity', TupleType([pack.StructType('<d')] * 3)),
        ('phase', pack.StructType('<d')),
        ('doppler', pack.StructType('<d')),
        ('center_samples', pack.IntType(64)),
        ('center_fractional_samples', pack.StructType('<d')),
        ('C_over_N_0', pack.StructType('<d')),
    ])