main module

class main.Coordinator

Bases: object

start()

The following are the three main processes of the system:

  1. camera process

  2. interface process

  3. the virtual assistant process

Camera:

The camera starts when the system starts, and its purpose is to detect if a person comes in front of the camera and calculate the time between the last moment when a face was detected and the current moment in time.

param user
  • this variable contains the name of the user, if its registered, or contains the string ‘stranger’ if the user standing in front of the camera is not registered

type user

[str]

param delay
  • this variable describes the amount of time since the camera did not detect a face

type delay

[float]

param timeFaceFound
  • this variable marks the time when a face was detected the last time

type timeFaceFound

[float]

param faceFound
  • True -> a face is detected by the camera

  • False -> there is no face detected by the camera

type faceFound

[bool]

param runCamera
  • True -> camera is running from the Camera process

  • False -> the camera is not running from this particular process

type runCamera

[bool]

param cameraStopped
  • the variable is used as double check, for the “runCamera” variable, that ensures that the camera is running or is stopped in the Camera process

type cameraStopped

[bool]

Virtual Assistant:
The virtual assistant process stops and starts, depending on the idle time calculated by the camera. The idle time represents the time difference in seconds since the camera lastly detected a face:
  • if the idle time is greater than 20 seconds, the virtual assistant process is destroyed

  • if the idle time is less than 20 seconds and the virtual assistant is not started, then the process is created

  • if the virtual assistant process is running, and the idle time is less than 20 seconds, the virtual assistant process runs until the idle time is greater than 20 seconds

param answer
  • contains the response provided by the virtual assistant to the user’s request

type answer

[str]

param virtualAssistantStatus
  • contains the virtual assistant status: processing, listening, answering, calling, etc.

type virtualAssistantStatus

[str]

:param understanding :
  • contains a string that is displayed on the interface that represents the request that was understood by the system

type understanding

[str]

param root
  • GUI object instantiated as the main process

type root

[TKinter object]

param AIStarted
  • boolean variable that reflects the virtual_assistant status

  • True -> the virtual assistant status is running

  • False -> the virtual assistant is not running

  • used like a semaphore, not allowing the instantiation of the virtual_assistant multiple times if the virtual assistant runs already

type AIStarted

[bool]