# A Testbed for GNSS-Based Positioning and Navigation Technologies in Smart Cities:
## 4 Hansel Services
### Collaborative Positioning Service (CPS)  
The framework implemented in the HANSEL _testbed_ to support DGNSS-CP navigation and positioning algorithms foresees a near-real-time exchange of raw GNSS measurements among a set of Android(tm) smartphones. The devices integrate modern multi-constellation and multi-frequency GNSS chipsets and they are capable of communicating through a central node (i.e., the server running the services API). Such a node plays the role of a virtual channel and buffer between the users. Raw measurements obtained independently from each receiver are posted through a mobile application to a remote database to be downloaded by other users. A high-level scheme highlighting the data-flow and the component of the whole cooperative framework is shown in Figure 5.  
The CPS implemented in the HANSEL _testbed_ provides a toolbox for the exchange of GNSS raw measurements through general purpose network connectivity such as Wi-Fi(tm) 802.11\(\times\) or cellular networks (4G/LTE, 5G). The measurements are received by the CPS with a proper time stamp (aligned to the GNSS timescale) and they are stored locally for further analysis and future improved algorithms.  
Preliminary analysis on the exchange of information between real network devices showed that the framework is capable of supporting near-real-time measurements exchange despite it being based on a client-server approach, non-real time operating systems, and non-ad-hoc links. Raw GNSS measurements can be effectively exchanged within the inter-epoch time of a receiver working at 1 Hz and a Extended Kalman Filter (EKF)-based tight integration scheme proposed in [51, 52] can be beneficial to collaboratively improve estimation accuracy despite the possible delay introduced by the network and no error cancellation can be foreseen about these quantities. A delay in the transmission of data frames could actually affect the feasibility of an effective alignment of the asynchronous measurements sets, thus the availability of usable collaborative measurements. An inaccurate synchronisation of the local and external raw GNSS measurements can inject non-negligible biases in the baseline estimation. In the current implementation, if network latency between the agents exceeds the inter-epoch time of a given receiver, both the combination and integration of the collaborative measurements are inhibited to avoid additional errors in the position estimation. A rough time synchronisation provided by the independent PVT solutions of the smartphones w.r.t. the GNSS timescale, was hence assumed to achieve a reliable pseudorange differentiation [53, 54]. By considering  
Figure 5: High-level scheme of the cooperative framework foreseeing the exchange of GNSS raw measurements among Android(tm) smartphones through the Collaborative Positioning Service (CPS).  
a reasonable latency on the network link (i.e., 50 ms), Doppler-based synchronisation has been demonstrated to be a suitable technique to achieve an accurate alignment of data [54].  
By analyzing the data logged through two Xiaomi(tm) Mi 8 Pro, it has been assessed that the combination of raw data is feasible and regularly provided by smartphones with a measurement rate of 1 Hz (default value foreseen by Google(tm API). The message format for the collaborative exchange of data has been defined to limit the bandwidth occupancy, and ensuring at the same time a simple interface. The API defined for the CPS can be used to download the data and test any collaborative navigation algorithm in post processing by exploiting local (aided agenti) and external (aiding agent) fixes and raw measurements.