def updateOrientation(self):
        self.elapsedTime = IMU.DELAY_TIME
        while True:
            startTime = time.time()
            gyroX, gyroY, gyroZ = self.gyro.getRawData()
            accelOrientation = self.accel.getOrientation()

            # kalman filter
            self.roll = self.kalmanFilter.filterX(accelOrientation.roll, gyroX, self.elapsedTime)
            self.pitch = self.kalmanFilter.filterY(accelOrientation.pitch, gyroY, self.elapsedTime)

            # if abs(gyroX) > .5:
            #     self.roll = self.roll + (gyroX * self.elapsedTime)
            # if abs(gyroY) > .5:
            #     self.pitch = self.pitch - (gyroY * self.elapsedTime)
            # if abs(gyroZ) > .5:
            #     self.yaw = self.yaw + (gyroZ * self.elapsedTime)
                
            # # complementary filter
            # self.roll = self.roll * 0.95 + accelOrientation.roll * 0.05
            # self.pitch = self.pitch * 0.95 + accelOrientation.pitch * 0.05
            
            # # low pass filter
            #self.roll = self.roll*.5 + accelOrientation.roll*.5
            #self.pitch = self.pitch*.5 + accelOrientation.pitch*.5
            time.sleep(max(0, IMU.DELAY_TIME - (time.time() - startTime)))
            self.elapsedTime = startTime - time.time()
dataset/ETHPy150Open ericboehlke/BB-8/IMU.py/IMU.updateOrientation/swapped operands of `-`