Exemplo n.º 1
0
class TestPlatform(Platform):
    def __init__(self, simulation=None, trajectory=None):
        self.radio = IdealRadio(self)
        self.packetsReceived = []
        self.radio.setReceiveHandler(self.handlePacket)
        Platform.__init__(self, simulation, trajectory)

    def handlePacket(self, packet):
        self.packetsReceived.append(packet)

    def sendPacket(self, packet):
        self.radio.transmit(packet)

    @property
    def components(self):
        return [self.radio]
Exemplo n.º 2
0
class TestPlatform(Platform):
    def __init__(self, simulation=None, trajectory=None):
        self.radio = IdealRadio(self)
        self.packetsReceived = []
        self.radio.setReceiveHandler(self.handlePacket)
        Platform.__init__(self, simulation, trajectory)

    def handlePacket(self, packet):
        self.packetsReceived.append(packet)

    def sendPacket(self, packet):
        self.radio.transmit(packet)

    @property
    def components(self):
        return [self.radio]
Exemplo n.º 3
0
    def __init__(self,
                 acc_bias,
                 acc_noise,
                 gyro_bias,
                 gyro_noise,
                 simulation=None,
                 trajectory=None):
        identity = np.eye(3, dtype='double')

        # To handle the noise free case we need to choose different sensor subclasses
        # (Otherwise the call that creates random data raises an Exception due to zero scale)
        if isinstance(acc_noise, Number) and acc_noise <= 0:
            self.accelerometer = TransformedAccelerometer(
                self, identity, acc_bias)
        else:
            self.accelerometer = NoisyTransformedAccelerometer(
                self, acc_noise, identity, acc_bias)

        if isinstance(gyro_noise, Number) and gyro_noise <= 0:
            self.gyroscope = TransformedGyroscope(self, identity, gyro_bias)
        else:
            self.gyroscope = NoisyTransformedGyroscope(self, gyro_noise,
                                                       identity, gyro_bias)

        self.magnetometer = IdealMagnetometer(self)
        self.adc = IdealADC(self)
        self.radio = IdealRadio(self)
        self.timer = IdealTimer(self)
        StandardIMU.__init__(self, simulation, trajectory)
Exemplo n.º 4
0
 def __init__(self, simulation=None, trajectory=None):
     self.accelerometer = IdealAccelerometer(self)
     self.magnetometer = IdealMagnetometer(self)
     self.gyroscope = IdealGyroscope(self)
     self.adc = IdealADC(self)
     self.timer = IdealTimer(self)
     self.radio = IdealRadio(self)
     StandardIMU.__init__(self, simulation, trajectory)
Exemplo n.º 5
0
 def __init__(self,
              positionOffset=vector(0, 0, 0),
              rotationOffset=Quaternion(1, 0, 0, 0),
              simulation=None,
              trajectory=None):
     self.accelerometer = IdealAccelerometer(self,
                                             positionOffset=positionOffset,
                                             rotationOffset=rotationOffset)
     self.magnetometer = IdealMagnetometer(self,
                                           positionOffset=positionOffset,
                                           rotationOffset=rotationOffset)
     self.gyroscope = IdealGyroscope(self,
                                     positionOffset=positionOffset,
                                     rotationOffset=rotationOffset)
     self.adc = IdealADC(self)
     self.timer = IdealTimer(self)
     self.radio = IdealRadio(self)
     StandardIMU.__init__(self, simulation, trajectory)
Exemplo n.º 6
0
 def __init__(self, simulation=None, trajectory=None, rng=None):
     """
     @param rng: L{np.random.RandomState} from which to draw imperfections.
     """
     self.adc = QuantisingADC(self, bits=12, vref=1.65)
     adc_lsb = 3.3 / 2**self.adc._bits
     self.timer = ParametricTimer(self,
                                  frequency=32768,
                                  freqError=30,
                                  rng=rng)
     self.accelerometer = MMA7260Q(self,
                                   sensitivity='6g',
                                   noiseStdDev=15.3 * adc_lsb,
                                   rng=rng)
     self.magnetometer = HMC105x(self, noiseStdDev=8.1 * adc_lsb, rng=rng)
     self.gyroscope = ADXRS300(self,
                               sensitivity='1200deg/s',
                               noiseStdDev=1 * adc_lsb,
                               rng=rng)
     self.radio = IdealRadio(self)
     StandardIMU.__init__(self, simulation, trajectory)
 def __init__(self, simulation=None, trajectory=None):
     self.timer = IdealTimer(self)
     self.radio = IdealRadio(self)
     Platform.__init__(self, simulation, trajectory)
Exemplo n.º 8
0
 def __init__(self, simulation=None, trajectory=None):
     self.radio = IdealRadio(self)
     self.packetsReceived = []
     self.radio.setReceiveHandler(self.handlePacket)
     Platform.__init__(self, simulation, trajectory)
Exemplo n.º 9
0
 def __init__(self, simulation=None, trajectory=None):
     self.radio = IdealRadio(self)
     self.packetsReceived = []
     self.radio.setReceiveHandler(self.handlePacket)
     Platform.__init__(self, simulation, trajectory)