Esempio n. 1
0
    def run(self):
        global isNextPathNeeded
        global nextPathSema
        while 1:

            # if isNextPathNeeded:
            #     print self.threadName, "blocking"
            #     nextPathSema.acquire()

            locationTrackerLock.acquire()

            if self.count == 0:
                locationTracker.updateLocation(stop=isNextPathNeeded, recalibrating=newLevelReached)
                print "Total Steps:", locationTracker.getTotalSteps()
                print "Total Distance:", locationTracker.getTotalDistance()
                print "Deviation from N:", locationTracker.getHeadingInDeg()
                print "True deviation from N:", locationTracker.getTrueHeadingInDeg()
                print locationTracker.getLocation()
                print "Height:", locationTracker.getHeightInCM()
                self.count = 0
            else:
                self.count += 1

            locationTrackerLock.release()
            time.sleep(1.5)
Esempio n. 2
0
    def run(self):
        while 1:
            locationTrackerLock.acquire()
            locationTracker.updateLocation(False, False)
            if self.count == 0:
                print "Total Steps:", locationTracker.getTotalSteps()
                print "Total Distance:", locationTracker.getTotalDistance()
                print "Deviation from N:", locationTracker.getHeadingInDeg()
                print "True deviation from N:", locationTracker.getTrueHeadingInDeg()
                print locationTracker.getLocation()
                print "Height:", locationTracker.getHeightInCM()
                self.count = 0
            else:
                self.count += 1

            # locationTracker.gyroCompass.updateOffset()
            locationTrackerLock.release()
            time.sleep(1.5)