\chapter{A Framework for Indoor Navigation in Museums Exploiting Passive User Localization}\label{chap:smart}
{

\begin{quote}
\textit{
In this Chapter we present smArt\footnote{Demo video: https://vimeo.com/miccunifi/smart}, a low-cost framework to quickly set up indoor exhibits featuring a smart navigation system for museums. The framework is web-based and allows the design on a digital map of a sensorized museum environment and the dynamic and assisted definition of the multimedia materials and sensors associated to the artworks. The knowledge-base uses semantic technologies and it is exploited by museum visitors to get directions and to have multimedia insights in a natural way. Indoor localization and routing is provided taking advantage of active and passive sensors advertisements and user interactions. In this way we overcome the Global Positioning System (GPS) unavailability issue in indoor environments.
\footnote{This chapter has been published as \dquote{smArt: Open and Interactive Indoor Cultural Data} in \textit{Proceedings of the 23rd ACM International Conference on Multimedia, pp.~807-808, 2015}~\cite{ferracani2015smart}.}
}
\end{quote}

\section{Context and Motivation}
The problem of linking physical spaces with structured data is urgent considering from the one hand the opportunities offered by the evolution of the semantic web and from the other the increasing adoption of the so-called Internet-Of-Things (IOT). Furthermore, managers in the cultural heritage need easy to use tools to promote, curate and publish cultural data that may be exploited at several levels by students, tourists, professionals, researchers and so on. To this end tools have to provide museum curators with facilities for artworks' search, browsing and collection, and not at least the opportunity to make cultural resources available as public structured data on the web. At the same time, nowadays, real spaces can easily be made reactive and low-cost solutions are desirable. smArt fulfills these requirements and provides a tool where cultural resources can be browsed and published, from and on the web, using a big and extendable repository (i.e. DBPedia dataset\footnote{See http://bit.ly/1HxOUVI}). Data can be enriched with sensors information for \emph{ad hoc} deployable installations. In details, the web application allows to associate artworks in a semi-automatic way with different types of sensors and features proximity sensing and routing in an indoor environment. This is not trivial: in fact while tourism electronic guides for outdoor are widespread and  provide access to contextual multimedia data relying on GPS technology, things are more difficult in indoor where GPS is not available. Sub-room indoor localisation is an active area of research which includes applications in reactive indoor spaces. smArt exploits Bluetooth Low Energy (BLE) beaconing, in synergy with other tools, as an indoor positioning and routing technology. Bluetooth Estimote Beacons\footnote{See http://bit.ly/1d7dZdB} and automatic generated QR codes can be automatically and manually associated to artworks or locations in the knowledge-base and then physically positioned. Cited technologies are low or without cost and don't involve an infrastructural overhead: two common requirements for cultural public institutions.


\section{The System}

The system is mainly composed by two modules: 1) a web-based application for the semi-automatic ingestion and management of Open Linked Data regarding the cities of Venice, Rome and Florence in Italy; 2) a mobile Android application which exploits the data generated by the web app and reacts to the expected signals in the real environment.


\subsection{Configuring the environment: the Web Application}

The web application is used for the ingestion, creation and management of data concerning museums. It provides a graphical user interface for building data and components mashups in order to configure a sensorized environment. Users are enabled to `pipe' several interface components and then set up rules for how content should be modified. There are three main components: 1) City Component: it allows to choose cities from which to select public multimedia data; 2) Museum Component: it is used to collect, aggregate and enrich data about museums and artworks from DBPedia through Open Linked Data; 3) Sensor Component: it can be applied to artwork collections in order to automatically associate physical sensors. Components are managed and organised on the interface using a drag-and-drop paradigm. A component is shown as a circle icon with a label and an image. When dragged on other components icons can make appear contextual menus in order to apply modifiers. The Museum Component provides contextual panels to search museums, select and associate sensors to artworks (i.e. Beacons or QR codes). Furthermore, for each museum the user can: 1) interactively draw the museum map of the environment to be sensorized; 2) decide the location of the artworks; 3) define the access point to the museum halls and finally 4) mark out all the trajectories that visitors can use to reach the artworks. All this infos are then used by the mobile application to provide localization and routing systems to museum visitors. The web app has been developed in HTML5 for the client and uses PHP and MySQL on the server for metadata storing. Storing and communication with the semantic knowledge-base is performed through RDF and Sparql Queries to a self-hosted DBPedia endpoint. The knowledge-base is reachable on a self-hosted Virtuoso Server\footnote{See http://bit.ly/1BqKEVP} and it uses triple-store dumps of Wikipedia frequently and automatically updated.


\subsection{Mobile App, Localisation and Routing}

smArt mobile application allows the visitor to localise herself in the indoor museum and provides a routing system to guide the user to artworks of interest on the basis of the data generated by the web application. The app has been designed with the aim to enhance the user experience of a visitor approaching or searching for an artwork and provides multimedia insights exploiting natural interaction paradigms. It is well known that GPS is not working in indoor locations due to the poor signal coverage. Furthermore, indoor localisation is particularly challenging for several reasons: presence of obstacles and moving people, interference caused by other electronic devices etc. Standard solutions contemplate active (QR code scanning, NFC) and passive sensors (beacon bluetooth for proximity detection or triangulation for exact location). smArt exploits bluetooth beacons which are cheap and well supported and require a low level of interaction. As an alternative each artwork can be automatically or manually associated to QR codes which have no cost but need more user participation. \\
The app has been developed as an Android application and uses an SQL Lite database generated by the web application and stored on a server. The interface has been designed following the Google guidelines for material design. The main interface is map based and provides outdoor navigation. Through a sliding-up panel the user can check his localisation and browse all the nearby museums where an interactive exhibit has been set up. Google directions are also provided. When a user approaches a museum she is notified on the app interface of the possibility to switch to an indoor map visualisation. The map is rendered in realtime on the device using canvas and vector shapes. Zoom and drag gestures are enabled. Artworks equipped with a sensor are visualised on the map as icons. Once the user has localised herself or the app has identified her location, the user can select any artwork on the map or using the sliding panel in order to be suggested with the shortest path to it.  User location is acquired when the app receives the unique identifying information broadcasted by a beacon via bluetooth or when the user scans a QR code associated with an artwork or provided as a localisation hotspot in the museum. A background service is always active and listens to BLE advertisements. When the device receives the signal, the user is notified and contextual artwork multimedia data are shown.\\
The indoor engine is in charge to draw and manage the map and the navigation system: paths are computed modelling the information about museum rooms and artworks as a graph of traversable spots. Spots have been defined and arranged by the web app user on the map and can be sensorized artworks, path spot, door spot or museum visitor localisation spots.  The shortest path to an artwork is estimated on the fly by the indoor engine using the Dijkstra's algorithm and then visualised on the map. The engine provides also a completely automatic system to calculate the shortest path in the case that the web app user has not marked the path spots required to navigate from an artwork or a localisation in a room to another. This is achieved using automatic 2D polygon convex partitioning of the museum map: the Hertel-Mehlhorn algorithm is exploited which is never worse than $2\emph{r}+1$ pieces, where $r$ is the number of reflex vertices. Once the polygon is partitioned the center of mass of each partition is identified and treated as a path spot to be used in the graph by the Dijkstra's algorithm to build the itinerary from the user position to the artwork of interest. The algorithm allows to face situations where the map is a regular polygon but paths from an artwork or a localisation in a room to a target artwork in another room could cross the museum hall walls resulting in a wrong feedback to the user.


\section{Conclusions and Future Work}
In this Chapter we present a web-based framework designed for museum curators to manage and set up easily interactive exhibits in a sensorized environment. Museums, artworks and associated multimedia materials are retrieved from and saved to the web using Open Linked Data. Artworks can be placed on the map and associated with cheap and easy to install actuators to be placed in the real museum environment. Exploiting these data museum visitors equipped with an \emph{ad hoc} mobile app can enjoy interactive exhibits in an effective and natural way. Future work will focus on the refinement of methods for the reduction of localization errors using BLE technology. A good starting point are the results in \cite{Martin2014}.

