## 4 HARP: An Architecture for Hoptically Enhanced AR Experiences
### System Architecture  
Once the data model has been presented, it is time to present the architecture itself. The diagram in Figure 5 shows the main components of the architecture, which can be divided in two main blocks: (a) the _HARP client_ and (b) the _communication service_. Figure 4: Basic data model handled by the system. * HARP client: This block brings together the minimum functionalities that a client must accomplish to satisfy the requirements mentioned in Section 3:
* The _Session Manager_ component acts as an entry point into the system. As its name indicates, it is in charge of managing the _session_ information, which, briefly recalling, includes information of the 3D objects to be represented by combining AR and haptics. It is capable of receiving the status of the session from the _Communication Service_ and of generating and updating it. * The _AR View Manager_ has a very specific purpose. It is in charge of receiving the _session status_ from the _Session Manager_ and representing it using the AR framework of the device on which it is deployed. For example, in the case of being deployed to an iOS device, after receiving the _session status_, it has to generate the scene and to create a node (SCNNode in Scenekit) on that scene for each element on the _session_. As updates from the state arrive, it must adapt the AR view to them. At this point, an issue arises: to which point in the physical space should that AR content be attached? * The _World Center Manager_ component emerges to address that issue. It must define the required functionality to set the origin of coordinates for the digital content and its relation to the real world. The final implementation is open to all kind of possibilities. In Section 5.1, we give as an example the possibility of establishing the alignment manually or semiautomatically. * The _App Logic manager_ groups all the logic on which the application depends. For example, in the Simon example in Section 6.2, this component was integrated on the HoloLens client. Its main occupation was to keep track of the buttons that the user presses, the generation of new color sequences, and other related functionality. * The _Interaction Manager_ component abstracts the interaction capabilities of the system. For example, the Simon prototype was deployed in two different devices: an iOS one and an HoloLens one. On the one hand, the _Interaction Manager_ from the iOS client is in charge of detecting touches on the screen, translating them into touches on digital objects and generating the corresponding events. On the other hand, the implementation on the HoloLens client receives information of hand gestures and reacts to it. In any case, the resulting interaction should be able to trigger certain logics of the application and to cooperate with the _Session Manager_. An example of this process in the Simon system happens when the user pushes the haptic button with their hand and the HoloLens has received the interaction event. The HoloLens then processes the color of the button and checks if it is the proper one. In this case, the logic is that checking process in which the next color of the sequence is compared to the introduced one, but any other logic could be implemented here. To finish with this component, it may be possible for the result of the interaction to generate a haptic response (e.g., to change the haptic pattern or to disable the haptic feedback). It is also possible that the device that provides the aforementioned response also delivers relevant information (e.g., the Ultrahaptics device has a Leap Motion on it that generates a representation of the user hand), which can be processed. Figure 5: Blocks that make up the architecture with minimum possible deployment. * Communication Service: Most haptic devices require a wired connection to a computer, connections that smartphones and wearable AR devices cannot guarantee. Hence, this component will act as a bridge between different clients that collaborate in the process.