def init_check(): global visual_flag global motion_flag global audio_flag print 'self checking......' try: imgencode = woody_vision.cam() print "camera ready" except: print "camera offline" woody_embedded.random_look() try: os.system("mplayer /home/" + user_name + "/Philos_R/Robots/Woody/speaker_checking.wav") except: pass time.sleep(2) try: from Woody import woody_action print "motion module detected" try: woody_action.init_check() print "motion unit ready" except: print "motion unit error" except: print "motion module offline" time.sleep(2) time.sleep(2)
def send_to_emotion(): global imgencode while True: imgencode = woody_vision.cam() se.sendto(imgencode, ("192.168.1.109", 9901)) se.close()
def cam(): while True: global imgencode imgencode = woody_vision.cam()