from agentspace import space
import signal 
import os
import time
def quit():
    space['forward'] = 0
    space['turn'] = 0
    time.sleep(0.25)
    os._exit(0)

def signal_handler(signal, frame):
    quit()
    
signal.signal(signal.SIGINT, signal_handler)

from cameraagent import CameraAgent
from emotionagent import EmotionAgent
from controlagent import ControlAgent
from gearagent import GearAgent

print('starting camera')
CameraAgent(1,'colorImage')
time.sleep(1)
print('starting face detector')
EmotionAgent('colorImage','facePosition','faceImage','faceEmotion')
time.sleep(1)
print('starting control')
ControlAgent('facePosition','faceEmotion','forward','turn')
time.sleep(1)
print('starting gear')
GearAgent('forward','turn')
time.sleep(1)
print('started')

# os._exit(0)

