from deadReckoning import calibrationTools from navigation import fullNavi from navigation import obstacleAvoidance from communication import dataFeeder # from communication import dataFeederDum from collections import deque from UI import search from UI import keypad_polling from UI import pyespeak from UI.my_deque import my_deque from UI.UISpeaker import UI_Speaker import os #to print sound just call voiceQueue.append(sentence) skip_pad = keypad_polling.keypad(None, None, None) skip_init = skip_pad.poll_for_num_timed(1) del skip_pad # VoiceQueue has 2 levels of priority: HIGH is enqueued by append_high, and NORMAL is enqueued by append # # ===HIGH PRIORITY=== # Node Reached # You reached %s node # Navigation Complete # Rerouting # # ===NORMAL PRIORITY=== # Right %f # Left %f # Go
# Locks for various variables locationTrackerLock = threading.Lock() obstacleLock = threading.Lock() obstacleStatusLock = threading.Lock() dataInSema = threading.Semaphore(0) userInputLock = threading.Lock() voiceSema = threading.Semaphore(0) voiceStopSema = False # Location variables startLocation = None endLocation = None # Keypad initialization keypad = keypad_polling.keypad(voiceQueue, voiceSema, speaker) # Threads to receive data from Arduino dataThreads = [] dataThreads.append(ReceiveDataThread(1, "data receiving")) dataThreads.append(ProcessDataThread(2, "data processing")) for thread in dataThreads: thread.start() # Init threads initThreads = [] initThreads.append(CalibrationThread(-1, "calibrating pedometer and compass")) for thread in initThreads: thread.start()