ARCS.js, a Web framwork for Augmented Reality

ARCS.js is a component oriented programming framework dedicated to augmented reality applications. It is written using the javascript language. The targeted platforms are:

  • On server-side, node.js (version 4+);
  • On client-side, any recent navigator able to handle javascript Promises.

Models

The framework introduces a component and an application model in order to run applications:

Component model

Components are javascript prototypes with a few additional traits. The idea is borrowed from signal/slot's Qt paradigm. In a nutshell, slots are inputs and signals outputs. A slot has an implementation whereas signals do not dispose of it. Components communicate through signal/slot communications which are synchronous and can transport data. Components can be initialized by two different means:

  • using instantiation parameters passed to constructor;
  • using slot calls (see invocations below).

Application model

In ARCS.js, an application is considered to have a lifecycle going through several different states (initialisation, normal mode, recovery mode, etc). Each state is characterized by a set of omponents and a set of signal/slot connections. Such configuration is called a sheet. The application is then controlled by a finite statemachine, each state of it corresponding to one sheet. When a transition is triggered in the statemachine, it activates a change of sheet.

The sheet is composite structure. It contains components as well as other data:

  • a list of pre-connection invocations for component initialization;
  • a list of connections to establish datapath between components;
  • a list of post-connection invocations that enables dataflow;
  • a list of cleanup invocations in order to set some components in a stable state.

The behavior of the application controller is the following, assuming that it received a token triggering a transition (having a starting state and an ending state):

  1. If a sheet is active (corresponding to the starting state), disconnect all components;
  2. Perform cleanup invocations on sheet;
  3. Enable the next sheet (corresponding to the ending state):
    1. Perform pre-connection invocations;
    2. Connect components of the sheet;
    3. Perform post-connection invocations.

To complete the behavior, the controller, when the application starts, activates the first sheet or the one that is labelled as initial. An application is finished when the statemachine reaches an ending state.