{'fraction_non_alphanumeric': 0.032151781582600646, 'fraction_numerical': 0.012161036557149467, 'mean_word_length': 4.559374356863552, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 1, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 4, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
Collaborative SLAM based on Wifi Fingerprint Similarity and Motion Information

Simultaneous localization and mapping (SLAM) has been extensively researched in past years particularly with regard to range-based or visual-based sensors. Instead of deploying dedicated devices that use visual features, it is more pragmatic to exploit the radio features to achieve this task, due to their ubiquitous nature and the widespread deployment of Wi-Fi wireless network. This paper presents a novel approach for collaborative simultaneous localization and radio fingerprint mapping (C-SLAM-RF) in large unknown indoor environments. The proposed system uses received signal strengths (RSS) from Wi-Fi access points (AP) in the existing infrastructure and pedestrian dead reckoning (PDR) from a smart phone, without a prior knowledge about map or distribution of AP in the environment. We claim a loop closure based on the similarity of the two radio fingerprints. To further improve the performance, we incorporate the turning motion and assign a small uncertainty value to a loop closure if a matched turning is identified. The experiment was done in an area of 130 meters by 70 meters and the results show that our proposed system is capable of estimating the tracks of four users with an accuracy of 0.6 meters with Tango-based PDR and 4.76 meters with a step counter-based PDR.


I. INTRODUCTION
With growing applications of the Internet of Things (IoT), recent research shows an increasing interest in indoor positioning due to the rapid demand of location-based services, such as indoor guidance and asset tracking [1]- [4]. To perform indoor positioning, the knowledge of the existing infrastructure must be provided in advance (for example a map of the environment or locations of the beacons). In the scenario of emergency response in disaster areas or large scale environments, such kind of knowledge is not available or difficult to obtain beforehand, which makes the indoor positioning challenging. Therefore, recent researchers are focusing on developing efficient methods and technologies to simultaneously localize mobile devices (robots and smartphones) and generate a map of the environment [5]- [8]. The underlying problem is well known by the term, Simultaneous Localization and Mapping (SLAM). Extensive researches have been done with regard to visual-based [9] or range-based sensors [10].
Loop closure detection is elementary to any SLAM system. It denotes a situation that the mobile device has entered a previously-visited location, which permits to correct the accumulated odometry error. In order to perform loop closure detection in SLAM, dedicated devices (i.e., laser range finders or cameras) are required to measure the similarity of observations by scan matching [11] or feature matching [9], which are usually computationally expensive. However, growing popularity of Wi-Fi wireless networks provide a new opportunity to detect loop closure and perform SLAM in a different way.
Most existing buildings with Wi-Fi network deployed can be exploited for localization and mapping with low hardware requirements and computational cost (for example with the ubiquitous IoT devices like normal smartphones) due to their ubiquitous nature of in-built sensing capabilities [1], [12]. The current signal-strength-based SLAM requires an analytical model to feature the radio signal distribution over distance [6], [13]. However, it is not practical to build such a model due to many multiple path issues in uncontrolled environments. On the other hand, radio fingerprinting [2], [14], [15], represents a location with a collection of radio signals from Wi-Fi access points, which is considered to be more robust against the signal distortions. Therefore, we adopt this technique to simultaneously determine the location of a user and create a radio map of the environment.
In addition to the Wi-Fi network, a typical indoor environment consists of many landmarks, such as turnings, elevators, rooms, and doors, which can be also considered as features for the positioning of a device. These landmarks can be recognized through inertial sensors, which are available in most commercial off-the-shelf smartphones [16], [17]. In contrast to large location uncertainty of radio fingerprints due to the distortion of signals, such kind of landmarks can better confine the location of a device and enhance the positioning accuracy of fingerprinting-based approaches [15], [18].
In opposite to the feature map or occupancy map built by laser range finders or visual cameras, our goal is to build a map (in particular a radio map) with radio fingerprint as feature, and use that for the positioning. To ensure a good positioning accuracy in large scale environment, a fine-grained radio map is required [1], [2] and it will be time consuming to create such a map with a single user. Therefore, a low cost method (e.g., acquire fingerprints via crowdsensing by multiple users) to create the radio map is a necessity.
This paper presents a system that fuses the pedestrian dead reckoning from a smartphone, and received signal strength (RSS) measurements from surrounding Wi-Fi access points (AP), to estimate the trajectory of multiple users and map the radio signals in unknown environment via a collaborative fashion, using graph SLAM technique. To further improve the accuracy, we incorporate the turning features and reduce the uncertainty of loops inferred based on radio fingerprints similarity. The proposed approach requires neither the map of the environment nor the locations of the access points. We tested the system under two different dead reckoning systems, one is based on Tango that has a high motion tracking accuracy through vision-based odometry, and the second one is based on step counter using on-board inertial sensors that has a poor motion tracking accuracy. By leveraging on in-built sensing capabilities from smart phones and crowdsensing nature, our system can generate a radio fingerprint map in a large indoor environment at low cost as compared with traditional site surveying methods. We summarize the contributions of this paper as: • We present a solution that incorporates Wi-Fi fingerprint and dead reckoning information for crowdsensing SLAM in unknown indoor environments; • We propose an algorithm that automatically learns a model to characterize the uncertainty of a loop based on the degree of similarity using the short term odometry measurement; • We integrate the turning features to further reduce the uncertainty of radio fingerprint-based loop closures and improve the overall accuracy; • We throughly evaluate our approach in one building at our campus with an area of approx. 9000 square meters with two different pedestrian dead reckoning systems.
We organize the rest of this paper as follows. The related work is discussed in Section II. Section III formulates the problem and explains the detail of the proposed system. Section IV presents the experimental results. Conclusions with possible directions of future work are made in Section V.

II. RELATED WORK
Over the past decades, indoor positioning shows a growing popularity due to the increasing demand of location-aware applications [1], [2]. A large number of researches have been performed regarding indoor positioning given a reference of the infrastructure (i.e., map of the environment or distributions of beacons). Obtaining and maintaining such kind of information is challenging, particularly in large scale environments [19] or emergency response for example search and rescue in disaster scenes [20], [21]. A solution to this problem is SLAM (Simultaneous Localization and Mapping), which has been investigated extensively in robotics community. In this section, we present a summary of the related work in SLAM, using different kinds of techniques. Throughout the years, many techniques and algorithms have been proposed, mainly including filtering-based solutions (for example the Kalman filter [5] and the particle filter [22]) and graph-based solutions [7], [23].
Depending on the types of sensors used, one can classify the SLAM into laser-based SLAM, visual-SLAM, magnetic-SLAM, WifiSLAM, and FootSLAM. Laser-based SLAM uses laser-range finders to create a structural map of an environment. The detection of loop closure is achieved by scan matching. Visual-SLAM methods, utilize cameras like Kinect or Tango [24] to construct a 3D model of the indoor scene. Bundle adjustment [25] is another popular technique for SLAM that uses visual images and has been used in commercialized SLAM systems such as Google's Project Tango [26]. Magnetic-SLAM systems, exploit digital magnetic compass for localization and mapping of a device [27]. The loop closure is inferred by examining spatial similarity of a sequence of magnetic measurements. For example, authors in [18] correlated motion patterns with the magnetic field to address the SLAM problem. A unique magnetic fingerprint may not be guaranteed due to the distortion of the environment, which makes this solution challenging for real applications.
WifiSLAM [6], [13] techniques use the radio signal and motion data of the device for localization and signal strength mapping in unknown environments. With SLAM technique, the hassle of site surveying can be avoided, and radio map can be created and updated conveniently whenever needed. For example, authors in [6] solved the WifiSLAM problem by mapping the high-dimensional signal strength into a twodimensional latent space with a Gaussian process. Authors in [13] proposed a generalized and effective algorithm to solve the WifiSLAM using GraphSLAM algorithm. Both approaches assume the signal strength at two close locations are similar and the measurement likelihood can be modeled as a Gaussian process. In contrast, our approach does not require any model to describe the signal strength distribution, and the closeness of locations is determined by the similarity of the radio fingerprints.
FootSLAM [28] uses inertial-based measurements to determine the underlying building structure. No ranging or visual measurement were required; the only features used are the probability distributions of human motions at different locations. Several extensions, for example ActionSlam [29], incorporate location-orientated actions (for example entering elevators or door opening) as features to compensate for the IMU drifting error. Additional information [30] can be further incorporated into FootSLAM, for example a prior map or signal strength from a Wi-Fi access point. Authors in [31] proposed SenseWit that utilizes inertial measurements to generate a floorplan by identifying featured locations (turning, water dispenser, and door) in indoor space.
When the indoor environment becomes huge, generating the radio map with single mobile device becomes time consuming. The power of crowd comes into play in this scenario. Mobile crowdsensing is a popular computing paradigm, which enables ubiquitous devices to collect sensing data at large scales [32]- [34]. This technique can be utilized to unleash the potential of mobile phones of people who move inside the indoor environment [35]. Prior research have harnessed the power of crowdsensing to reconstruct indoor floor plans by combining user mobility traces, images of landmarks, and Wi-Fi fingerprints [36], [37]. Localization by combination of 6-DOF gyro-odometry and Wi-Fi localization has been done in [38], using multiple robots. Authors in [39] proposed an approach to utilize pairwise distance measures between users to reduce the positioning error in fingerprinting-based approaches.
Our system combines crowdsensed RSS from Wi-Fi APs and dead reckoning information from a phone to localize a device and build a radio map of the environment. To improve the accuracy, we additionally incorporate turning features extracted from users' trajectories into our system. Section III explains the details of the system implementation.

III. COLLABORATIVE SLAM BASED ON POSE GRAPH OPTIMIZATION
We present a novel approach that incorporates radio fingerprint measurement and motion information for collaborative SLAM in an unknown environment. The approach presented here does not require any prior knowledge about the map or the distribution of the access points nor does it need a laborintensive phase to collect the measurements in the existing infrastructure. Our approach features a cost-effective alternative to estimate the trajectory of multiple users in unknown environments. A radio map is created simultaneously, which can be used as reference to localize other users afterwards.
In our proposed collaborative framework, user walks in the environment and collects the radio measurements. Our approach merges the tracks from different users, performs loop closure detection, and optimizes the graph to generate a consistent radio fingerprint map. The data collected will be shared among all users through the server and each user will contribute to certain part of the map. The collaborative approach will accelerate the conventional way of map building. With our collaborative approach, the mapping of a building will become easier, since all users will participate in the map creation, which eliminates the expensive on-site survey phase in the conventional way of fingerprint map generation.
The goal is to estimate the entire trajectories from observations (i.e., Wi-Fi observations and motion measurements) taken from different users at different times without a prior knowledge about the environment. The problem addressed here is known as SLAM, which has been well studied in the field of robotics [10], [22], [40], [41]. Among those, the graphbased approach, which formulates the problem as maximum likelihood estimation using pose graphs, is regarded as one of the most effective way to solve SLAM problem. Based on the raw sensor measurements, graph-based SLAM [22] creates a graph, where nodes denote the poses of the users and edges decode the constraints between two nodes. The problem turns into graph optimization, which determines the best configuration of the poses by considering all constraints in the graph.
Loop closure is important for any SLAM system and is considered as one of the main challenges in implementing a SLAM system in large-scale environment. It represents a situation that users have revisited a previously observed location. Since the odometry will inevitably drift for long term run, loop closure allows to correct the accumulated odometric errors and create a consistent map of the scene. The loop closure problem has been researched extensively using visual-based or ranging-based sensors [9], [42], which are usually costly and computationally expensive. Instead of using the dedicated devices to perform loop closure detection, we focus on the radio fingerprints, which are available in existing indoor infrastructures and can be easily retrieved from every smartphone.
Formally, let x k 1:T = {x k 1 , ..., x k T } be the path of user k we would like to estimate up to time T , where x k t = (x k t , y k t , θ k t ) represents the global 2D location and heading of the user at time t. Let z n,j m,i and Σ n,j m,i represent the mean and covariance of a measurement (i.e., constraint or edge) between node x m i and x n j . We use C to denote the set containing all pairs of constraints.ẑ n,j m,i (x m i , x n j ) is the prediction of a measurement based on the current configuration of node x m i and x n j . The graph-based SLAM aims to find the best configuration x * to meet the following criteria: In particular for graph-based SLAM, z n,j m,i is known as edge or constraint which represents a rigid-body transformation between node x m i and x n j . The transformation is a 3×1 vector which encodes the 2D translation (i.e., x n,j m,i and y n,j m,i ) and the rotation θ n,j m,i . The constraint can be either sequential odometry measurement (i.e., odometry-based constraint) or loop closure (observation-based constraint), which is determined by aligning the sensor observations at two non-consecutive poses. Since observations are usually erroneous, all constraints are additionally parameterized with a certain degree of uncertainty (i.e., Σ n,j m,i ). For laser range finders, the transformation z n,j m,i can be determined by matching two scans [11] using modelbased registration, for example iterative closest point (ICP). Given a signal strength measurement from an AP, it is straightforward to know if an area has been visited by a user, since each reported RSS value is associated with a unique MAC address. However, estimating the precise transformation z n,j m,i between two observations turns out to be tricky, since radio signal neither reports distance nor bearing, and the detection range of an AP can be up to 50 meters, which is usually much larger than the accumulated error of a pedestrian dead reckoning system.
The distance to an access point can be approximated by the signal strength via an analytical signal-to-distance model. This model is used by some researchers to address the SLAM problem [6], [13], [43] and indoor positioning [1], [2]. However, obtaining such a model is usually not practical, as the propagation of signal will be distorted by many environmental factors (for example, multiple path or obstruction from obstacles). Instead of modeling them explicitly, this paper represents the location with radio fingerprint, which consists of the address of detected device and the measured signal strength. These fingerprints are location-dependent and are assumed to be unique to describe a location in an infrastructure. The closeness of two locations can be determined by comparing  the degree of similarity of the fingerprints.
We claim a loop closure if the similarity between two radio measurements at x m i and x n j reaches a threshold ϑ s . We then infer that their locations are the same and add a constraint z n,j m,i , with all elements zero, to the graph. Actually, the two locations are unlikely to be exactly the same, which will produce a small amount of error to the loop closure. The error can be compensated by associating a covariance Σ n,j m,i to the constraint. A choice of this can be a diagonal matrix by setting small values on the main diagonal. Our solution is a careful examination of the uncertainty of a loop based on the degree of similarity in a training phase. Based on training data, we automatically learn a nonparametric model to characterize the degree of similarity conditioned on the distance of two locations.
The uncertainty of the loop closure inferred from radio fingerprints is very high, we therefore exploit the turning features to improve the accuracy. We identify the turnings using motion information, match the turnings, and assign the loop closure with a small covariance if a match is found. Figure 1 gives an overview of the system. We will describe the details of each component in our proposed solutions in the following subsections. We summarize the notations of the symbols used in this paper in Table I.

A. Radio Fingerprints and the Similarity
Radio fingerprinting represents location with radio signals from radio-based sensors, for example Wi-Fi APs, Bluetooth beacons, and RFID tags. These fingerprints are robust against location-dependent distortions as compared to the model-based approaches, since the propagation of the radio signal in an environment is hard to predict due to the blockage of obstacles and multipath fading issue. This is quite similar to appearancebased approach, where the scene is represented by a number of visual features. Extracting visual features involves a large amount of computation, while this process can be ignored for  We represent a fingerprint of user k at time t as a pair denotes the odometry at time t when user k traverses the environment. f k t represents the radio measurement at location x k t , which consists of the RSS values from L access points: is used to represent the common APs in both f m i and f n j . The similarity function sim(F m i , F n j ) yields a positive value, representing the similarity between two radio measurements, namely f m i and f n j . We apply the cosine similarity which has been extensively used in the literature [44] [45].
(2) We refer the readers to [2] [46] for a comparison between different similarity measures.

B. Pedestrian Dead Reckoning
The spatial relationship between sequential poses in Equation 1 can be determined by the odometry measurements, which is known as odometry-based constraint. Nowadays, smartphones are equipped with various types of sensors, including IMU sensor, camera, light sensor, and proximity sensor. This enables one to implement a variety of pedestrian dead reckoning systems using different techniques. We evaluated our system under two pedestrian dead reckoning systems (PDR): Tango-based PDR using visual-inertial odometry (VIO) and step counter-based PDR using accelerometers and compass. The goal is to compare the approach under various tracking systems with different tracking accuracies.
Tango is developed by Google that uses visual-inertial odometry, to estimate the location of a device without GPS or any external referencing. It uses visual features with a combination of inertial measurements from accelerometer and gyroscope to track the movement of a device in 3D space. Lenovo Phab 2 Pro and Asus Zenfone AR are two examples of commercially available Tango phones.
Alternatively, the IMU sensor embedded inside a phone can be used to implement a step counter-based dead reckoning. A typical IMU system is comprised of accelerometer, gyroscope, and magnetometer for motion or orientation sensing. Following Zee [47], we implemented the step counting based on auto-correlation. Given the acceleration measurement a k t of user k at time t, the step counting is achieved by examining the periodic step patterns through normalized auto-correlation R k t (τ ) for a lag τ : where µ k t (τ ) and σ k t (τ ) are mean and standard deviation of the sequential acceleration measurements {a k t , a k t+1 , ..., a k t+τ −1 }.
The algorithm first identifies an optimal τ opt to maximize R k t (τ ). Then τ opt is used as a replacement of τ to count further steps. Similar to Zee [47], the sampling rate of the IMU is 50Hz, we therefore set the initial searching window τ to [40,100].
During the walking of a person, we assume the phone is always held in front of him. Therefore, we use the magnetometer reading to approximate the orientation of the user. Let c k t and θ k t be the step counting and the orientation of user k at time t respectively, the position (i.e., x k t and y k t ) of user k is determined by: where s is the step length, which is assumed to be fixed throughout the experiments. The estimation of the pose in odometry frame works in recursive fashion. The initial values of x and y are set to zero. The initial headings of different PDR systems are treated differently. For Tango-based PDR, the initial heading of a user is set to zero. For step counter-based PDR, the heading is determined by the in-built magnetometer based on geographic cardinal directions. The magnetic materials in the building might affect the accuracy of the orientation estimation. In the future, we would like to compensate for the orientation by incorporating the gyroscope readings [48]. The odometry-based edge is determined based on the relative translation and rotation between the sequential odometry measurements. For a user k, the rigid-body transformation (∆x k t , ∆y k t and ∆θ k t ) between the pose at time t − 1 and time t can be computed as:

C. RSS Thresholding
The time required to compute the similarity in Equation (2) grows linearly with the number of APs in the two fingerprints. The computational time can be significant in densely AP covered environment, which is the typical case in modern office or commercial buildings. A large amount of computational time can be saved if the size of the measurements can be reduced. Therefore, we propose to filter out the RSS observation with value below a threshold ϑ r .
Thresholding prunes observations with small RSS values, which represent spurious readings due to multiple propagation issues in indoor environment. In addition, larger RSS values indicate a location close to the access point with more confidence. These measurements are expected to better confine the location of the user. In the experimental section, we show that thresholding technique can provide a better accuracy while consuming less computational time.

D. Finding Loop Closure Candidates
To find the observation-based edge (i.e., constraint) between the non-consecutive poses in Equation 1, we need to perform loop closure detection. The observation-based edge consists of two different types of edges, namely similarity-based edge and turning-based edge. In our approach, each fingerprint carries the odometry information where the fingerprint is recorded (i.e., x, y, and the orientation θ of a user). We first compute the relative distance d(x m i , x n j ) and orientation θ(x m i , x n j ) between the odometric poses of two fingerprints F m i and F n j . If these values are smaller than pre-defined thresholds (50 meters and 0.3 radians for distance and orientation respectively), we compute the similarity s n,j m,i between them. We add a tuple < x m i , x n j , s n,j m,i > as a candidate of the loop closure if the similarity s n,j m,i exceeds a threshold ϑ s , which is one of the few parameters that has to be supplied by the user. The impact of ϑ s on the performance is not too critical, as shown in our experiments. In most cases, ϑ s = 0.7 gives good results. We reject the similarity with values smaller than ϑ s , to avoid false positive loop closures. To improve the accuracy of the system, we further check if this loop is a turning-based loop. We identify a turn by examining the orientation changes and checked the fitness of their respective tracks by a matching algorithm. If the fitness score is higher than a threshold, we consider this loop as a turning-based loop. The detail of the detection of turning-based loop can be found in Section III-G.

E. Model Training
To optimize Equation 1, an uncertainty estimation of the constraint is necessary for all edges in SLAM graph. For odometry-based edges, the parameter is obtained from the motion model. We now need to derive a model to represent the uncertainty of the observation-based edges. Our solution is to train such model by passing over the observation data (i.e., odometry and radio fingerprints), which is recorded by the smart phone as shown in Figure 1.
Our goal is to generate an uncertainty model to feature the distance variance of two radio fingerprints given their similarity. To build such a model, we need to know the true locations where the fingerprints are recorded or relative distance between the recorded positions, which is not possible without any external reference system. Although the error from odometry accumulates in the long term, it is sufficiently small for a short time of duration. In this work, we assume odometry is accurate enough for the distance traveled less than 100 meters, which is suitable for most inertial tracking platforms [48] [49] [50]. For example, authors in [49] evaluated the visual odometry with wide angle and fisheye cameras, and showed a relative positioning error of less than 1.4% with a distance of 538 meters traveled. Therefore, we compute the degree of similarity for close fingerprint pairs. These values are annotated with the distance between the two locations using the PDR system. As a result, we will get a set of K training samples: {s k , d k } K k=1 , where s k is the similarity and d k is the distance of the fingerprint pair. Figure 3 shows the scatter plot of distance versus similarity in one of the buildings. We then train a model which features the variance of distance given a similarity by binning. That is, for a similarity value s, we compute the variance of the samples that sites in the small interval r around s: where c(b) counts the number of samples in interval r. var(d|s) denotes the variance of the distance d given a similarity s. Although binning is a simple way for smoothing, the computation is efficient, since assigning the sample into a bin is straightforward. One example of the variance computed in two different buildings is shown in Figure 2(b). The resulted variance is stored in a look up table, which could be used in the second stage of SLAM, as shown in Figure 1.

F. Merging Tracks at Different Times
To leverage the power of crowdsourcing, we utilize the measurements captured from different users to generate a radio map of the environment. This involves the loop closure detection between different users in order to correct their paths using the power of crowdsourcing. The tracks recorded from different users are based on different reference systems, for example different starting positions. The determination of orientation is different for the two pedestrian dead reckoning systems. The Tango-based PDR estimates the orientation by visual-inertial odometry based on the starting pose and the step counter-based PDR determines the orientation based on the compass readings and is not relevant to any starting position. Therefore, these trajectories are needed to be merged into the same coordinate system to guarantee a robust loop closure detection between different users.
In this paper, we start the tracking by assuming all users passing by the same place. This is quite reasonable since users may pass through several key landmarks in an environment for example entrance of a building or the elevator. One might argue that in large buildings for example airport, not all users share the common place. It is possible to first build several sub-maps, and then merge them into a large and consistent map [51] [52] [53]. An edge is added to connect the first nodes in different tracks. For the transformation matrix z n,j m,i , we set x n,j m,i and y n,j m,i to zero and the covariance is obtained by checking the covariance table as detailed in Section III-E. Due to the omnidirectional characteristics of antennas, the facing of a user has very little impact on the radio signals, therefore the radio fingerprint does not deliver any orientation information. This is the reason why Section III-E does not model orientation variance with respect to the similarity. Based on two fingerprint observations, we have no knowledge about how accurate is the relative orientation between two poses, we therefore set θ n,j m,i to zero and give a very large covariance value (i.e., 1000) to the edge, meaning that we are not able to infer the relative angle from two radio fingerprint observations. For users starting from arbitrary locations, we refer to [54] [55] [56] [57] to merge the paths based on the radio measurements and activity landmarks in our future work.

G. Turning Identification and Matching
A typical indoor infrastructure often contains various landmarks, such as turnings, elevators, and staircases. These landmarks are unique in an existing infrastructure and can be used as a good feature for loop closure identification in a SLAM system. In this case, a loop closure can be claimed if two landmarks match each other. Due to the physical constraint of an environment, such kind of loop closure provides lower positioning uncertainty as compared to fingerprinting-based loops. For example, the size of an elevator is usually less than 3 meters, and the turning radius during human walking is smaller than a typical corridor width (i.e., 5 meters), while the positioning error using fingerprinting-based approach is usually larger than 5 meters.
Here we only focus on the turning features in a trajectory, which is regarded as one of the most common indoor landmarks. A slide window is used to produce segmentations of the track. In particular, we define a segmentation C k t of user k at time t as a collection of sequential poses with a window size of w, i.e., we check if there are turnings at these poses by examining the orientation change in segment C m i and C n j . If yes, we try to match the two segmentations C m i and C n j using ICP (Iterative Closest Point) [58]. If the fitness score (i.e., average of squared distances between the correspondence points) between C m i and C n j is smaller than a predefined threshold ϑ f , we regard loop < x m i , x n j > as the turning-based loop. Otherwise, this loop  closure is referred to as fingerprint-based loop, as shown in Figure 1. The transformation z n,j m,i of both types of loop is set to zero. We treat the covariance matrix Σ n,j m,i differently: for fingerprint-based loop, the covariance along x and y can be found at the looking up table computed previously in Section III-E; for turning-based loop, we set the covariance along x and y to 5.0, which is smaller than fingerprint-based loop (i.e., 8.0 in Figure 2(a) with the highest fingerprint similarity). The orientation covariance in Σ n,j m,i is set to 1000, meaning that we do not have any knowledge about the orientation of the two poses by the radio observations or the matching of two turnings. The details of turning identification and matching will be described in subsequent parts: 1) Turning Identification: We first segment the compass data and find the potential turnings [16]. For the pose x k t , we calculate the mean orientations for the poses with timestamps smaller and larger than t in the segmentation C k t , i.e., is higher than a threshold (for example π 3 as suggested in [16]), a turning is identified. The window size w here has the impact on the performance of turning detection and we show its impact on the accuracy in the experimental section. One example of the track and turnings detected are shown in Figure 4. A better approach to improve the accuracy of turning detection can be found in [59].
2) Turning Matching: The ICP aims to find a transformation (translation and rotation) between two point clouds that minimizes the sum of the square distance between the correspondence points. This approach has been extensively used to match 2D laser scans in the field of robotics.
To find the correct transformation using ICP, an appropriate initial transformation has to be provided, otherwise ICP will fall into the local minimum. Rather than using the global raw odometry for a segmentation C k t , we use the relative translation between x k t ′ and x k t , i.e., C t = {T Since the sampling rate of our pedestrian tracking system is too low (less than 1.0 HZ), we further interpolate the trajectory to get a large amount of locations for performing ICP. An illustration of the turning matching using ICP is shown in Figure 5.
We finally considers < x m i , x n j > as a valid match (i.e., turning-based loop) if the fitness score is smaller than a threshold ϑ f . Robust loop closure detection is essential to a SLAM system, as incorrect loop closures will ruin the consistency of trajectory and the map. Other heuristic approach can be applied to further examine the loops and filter out the suspicious ones. Authors in [60], for example, proposed an approach to group the close loop closures and check the temporal and spatial consistency for robust loop closure detection. However, this technique goes beyond the scope of this paper, hence, we add the loop closures without performing futher consistency check.

H. Pose Graph Optimization
The Equation 1, which represents a graph consisting of poses (i.e., nodes) and constraints (i.e., edges), is finally optimized through the pose graph optimization algorithm GraphSLAM. For the implementation, we choose Levenberg-Marquardt in g2o [23], which is freely available and is one of the state-of-the-art SLAM algorithms 1 .

A. Experimental Details
We program two smart phones (Lenovo Phab 2 Pro with Android 6.0.1 and Sony Xperia Z3 with Android 5.0.2) to receive the signal strength from APs and perform pedestrian dead reckoning. In particular, the Lenovo phone uses the Tango for position tracking and the motion tracking data is recorded every five seconds due to its high tracking accuracy. We implement the step counting on a Sony phone and record the step counting and the compass readings every one second. To evaluate the performance of the proposed approach, we conducted experiments on the Level 3 of Building 2 at Singapore University of Technology and Design with a size of 130m×70m (see Fig. 6). This environment is comprised of corridors, concrete walls, and wide open space. We asked a 1 https://github.com/RainerKuemmerle/g2o person to hold two phones (i.e., Lenovo Phab 2 Pro and Sony) and walk in the building along different paths with a regular walking speed. Four tracks were recorded at different times to show the power of the collaborative SLAM. For each track, the user started from the same position. The total distance traveled is 1906 meters with a duration of 2179 seconds and a number of 1702 unique MAC addresses are detected. This results in four log files with a duration of 687, 582, 439, and 471 seconds respectively. The step length s is fixed to 0.7m throughout this paper. Fig. 2(a) shows a snapshot during the experiment.
(h) Visualization of track from user4 using step counter-based PDR Fig. 8. A comparison between ground truth from point cloud-based SLAM, estimated track using our approach, and raw odometry of the three individual users using two different pedestrian dead reckoning systems (i.e., Tango and step counter). Threshold used to claim a loop closure based on similarity between two radio fingerprints. A large ϑ s will produce less loop closures and a small ϑ s will result in false loop closures. A setting of ϑ s = 0.7 is recommended in our approach. Window size to identify a turn. A large w will result in more false turnings and a small w is not able to infer the correct turnings. w = 40 is suggested in our approach.
Threshold used to claim a valid turning match. A large ϑ f will discard the true turning loop candidates and a small ϑ f will incorporate too many false turning loops. ϑ f = 0.5 is appropriate for the application.  III  EVALUATION OF THE SYSTEM PERFORMANCE WITH RESPECT TO DIFFERENT RSS THRESHOLDS ϑr . THE TABLE SHOWS THE POSITIONING ACCURACY  (MEAN, STANDARD

B. Ground Truth and Accuracy Comparisons
To extract the ground truth as comparison, we optimized the track from Tango using GraphSLAM taken 3D point clouds as input. We implement loop closure detection based on the point cloud library (PCL) [61]. We identify Harris keypoints in a pair of point clouds and compute the corresponding SHOT (Signature of Histograms of OrienTations) descriptors [62]. We match these descriptors with k-nearest neighbors algorithm (k-NN) and find an initial transformation using SVD (singular value decomposition). The transformation is further refined by ICP. If the number of matched points exceeds a threshold (half size of the point cloud), a loop closure is confirmed and added to the graph as constraints. We treat this optimized path as the ground truth to evaluate the accuracy of our system. We show the accuracy by the root mean square error (RMSE) between the ground truth and the estimation. Our experiments show that we are able to achieve an accuracy of 0.6 meters with Tango-based PDR and 4.76 meters of a step counter-based PDR with a size of 130m×70m, as shown in Figure 6. The optimized track is annotated with the radio measurement and can serve as the radio map for the positioning of another user. In Table II, we show the important parameters used in this paper and the remarks of how to choose these parameters. The final positioning error is calculated at the end of the process after the loop closure detection, turning matching, and pose graph optimization. Larger positioning errors are expected in a real time system, since we have to process the incoming data in a sequential way and provide pose estimation at regular intervals before loop closures are detected.
To implement a practical indoor localization system, the mechanism to deal with the change of the radio environment is a necessity. The evolution of the radio environment (for example adding or removing the access points) can be examined by looking at the signal variance at similar locations, as shown in [63] [64] [65] [66] [67]. Some MAC addresses might be static for a fixed duration of time, but are essentially mobile for example personal hotspots. A good way to address the mobile hotspots issue is to filter out the MAC addresses by the organizationally unique identifier (OUI), which is used to uniquely identify a vendor 2 . The MAC address from a phone manufacturer should be removed from the detection list to prevent the uncertainty of incorporating the additional mobile hotspot observations. Another approach to filter out the mobile hotspots is to look at the spatial relations of the detected positions of a particular MAC address [68] [69] [70].

C. Impact of Different RSS Threshold ϑ r
We examined the influence of RSS thresholding on the accuracy in this series of experiments. We set the similarity threshold ϑ s = 0.7 and use a binning size r = 0.2. We chose ϑ r values between -90 and -50 to evaluate the mean accuracy, as listed in Table III. As compared to the raw odometry, our approach can effectively reduce the accumulated odometry error: with the setting of ϑ r = −70, our approach improves the positioning accuracy by 90.4% and 66.3% for Tango (from 8.03m to 0.77m) and step counter (from 15.39m to 5.19m) respectively. In addition, the accuracy of the PDR has a very high impact on the accuracy achieved with our SLAM system: Tango shows a good motion tracking performance and we achieved an accuracy of 0.77m with a threshold ϑ r = −70. The accuracy achieved with Tango is better than state-of-theart fingerprinting-based approaches [1], [12]. While the step counter results in a large amount of accumulated odometry error and the accuracy obtained with our approach is worse (5.19m). A further investigation to the PDR system will help to improve the accuracy, which will be one of our future work. One has to note that the accuracy is achieved without training as opposed to the fingerprinting-based approaches, where a time-consuming phase to collect and annotate the fingerprints is prerequisite to guarantee a good positioning accuracy.
Table III also shows that we maintain a good accuracy with an RSS threshold between -75 and -65, while the computational time decreases considerably with the thresholding technique. As an example, for Tango-based system, a threshold of -70 reduces the computation time to 5.73 seconds as compared to a threshold of -90 (i.e., 24.28 seconds). At the same time, the accuracy even increases by 0.62 meters (error drops from 1.39m to 0.77m). A suitable threshold produces a good accuracy, as it will filter out the suspicious radio signals. However, a threshold larger than -65 leads to a bad result (for example, 1.24 meters of accuracy with ϑ r = −60 for Tango-based system). The ground truth, estimation, and odometry of individual tracks using two different pedestrian dead reckoning systems are visualized in Figure 8. A part of estimated trajectory and the constraints inferred are shown in Figure 7.

D. Impact of Different Similarity Threshold ϑ s
Next, we performed a series of experiments to examine the influence of accuracy with respect to different similarity thresholds ϑ r . We show the results in Table IV. We fixed RSS threshold ϑ r = −70 and a binning size r = 0.2. We increased the similarity threshold ϑ s from 0.1 to 0.95 to evaluate the accuracy and the number of constraints inferred. From Table IV, we can observe that the number of constraints is different for Tango and step counter-based PDR due to different sampling rates of the device (5 seconds for Tango and 1 second for step counter): Tango-based PDR offers a small number of constraints as compared to step counter-based PDR. In addition, the threshold has a high impact on the accuracy and the number of constraints. Applying a high threshold will result in a small number of constraints and a decrease of the accuracy. For Tango-based system, we obtain a mean accuracy of 0.77m with ϑ s = 0.7, which is an improvement of 86.3% as compared to the mean accuracy of 5.63m with ϑ s = 0.95. Yet, such an improvement is at the expense of a higher number of constraints added (i.e., 715 constraints with ϑ s = 0.7 as compared to 18 with ϑ s = 0.95). But the accuracy does not get improved with a threshold smaller than 0.6. One reason could be because a low similarity value will always come along with a very large covariance, and has very less strength to correct the odometric error. A setting of ϑ s = 0.7 seems to be a good trade off between the accuracy and the number of constraints inferred. Table V showed the accuracy by jointly optimizing the parameters ϑ s and ϑ r for Tango-based approach. As can be seen from this table, a careful examination of ϑ s and ϑ r will improve the accuracy. A too large or too small will obviously deteriorate the performance of our approach.

E. Impact of the Binning Size of Training
Next, we examined the influence of accuracy with respect to various binning sizes r. We chose RSS threshold ϑ r = −70 and similarity threshold ϑ s = 0.7. To evaluate accuracy under impact of different binning sizes, we set r to the following values r = {0.05, 0.1, 0.2, 0.4, 0.6, 0.8, 1.0}. In our approach, the uncertainty model is trained with all the collected data. We show a comparison of the results in Table VI. This table shows that the best choice of r is 0.2. The covariance estimated with a large r is usually too large to compensate for the error from the odometry. Optimizing r gives an improvement of 25.2% (0.77m and 1.03m for r = 0.2 and r = 1.0 respectively) for Tango-based PDR and 16.6% (5.19m and 6.23m for r = 0.2 and r = 1.0 respectively) for step counter-based PDR. Covariance of the loop is a key to optimize the pose graph, as it is the only information to measure how close the two locations are in a loop, therefore, a careful examination of the parameter will lead to an improvement of the accuracy. The covariance added here (see Figure 2(b)) is much smaller as compared to the accumulated odometry error (notice that the maximum positioning error of Tango and step counter in Table III are  31.55m and 41.23m respectively). This is why we are still able to correct the accumulated odometry error. The approach presented here provides a way to automatically calibrate the uncertainty model with the odometry measurement. The model generated in different environments might be slightly different, as shown in Figure 2(b). To evaluate the accuracy under the impact of different similarity models, Table VII compared the results using the similarity models produced from two different buildings, namely Building1 (the one used for the verification of the positioning accuracy) and Building2 regarding to Tangobased approach. As can be seen from this table, the two models provide similar positioning accuracy, which proves our assumption that the similarity model can be applied to different environments.

F. Impact of Turning Detection and Matching
We compared the accuracy with and without the integration of turning features in the next series of experiments. We fixed RSS threshold ϑ r = −70, similarity threshold ϑ s = 0.7, and binning size r = 0.2. We varied the setting of w and ϑ f to evaluate their impact on the accuracy. Figure 9 shows a comparison of the results. This figure shows that the accuracy can be improved by additional integration of turning features: we obtain an improvement of 22.1% for the Tango-based pedestrian dead reckoning (from 0.77m to 0.6m with w = 40 and ϑ f = 0.5) and 8.3% for step counter-based dead reckoning (from 5.19m to 4.76m with w = 40 and ϑ f = 0.5). The improvement of Tango is slightly higher as compared to the step counter-based system. Since the odometry error of Tango is smaller than step counter, the turning feature here exhibits great capability to correct the drift error of odometry. However, for step counter-based PDR, the error is dominated by the odometry and the turning feature shows less improvement to the accuracy as compared to Tango-based PDR.
The number of turnings detected with different settings of w is shown in Table VIII. The constraints are mostly from the fingerprinting matching. As can be seen from Table VIII, only 26 turnings are detected with w = 40, which is much less than the number of fingerprinting-based constraints (715 for Tango-based approach with ϑ s = 0.7 as shown in Table  IV). Due to the low sampling rate, Tango-based PDR leads to a small number of turnings as compared to the step counterbased PDR. A large value of w leads to an increasing number of turnings detected. From Figure 9, we can also observe that a window size w = 40 leads to the best accuracy for both systems. A too high or too small w obviously results in a less improvement to the accuracy.
In addition, Figure 9 shows that a too large or too small ϑ f leads to a decrease of the accuracy. A suitable fitness threshold ϑ f will help to remove the false turning-based loop   closures. A small ϑ f will not be able to identify true matched turnings and results in a small number of turning-based loops and therefore has less strength to improve the accuracy. A large ϑ f produces too many false turning-based loops, which leads to a deterioration of the result. As an example, for step counter-based PDR with w = 40, a setting of ϑ f = 0.5 gives an accuracy of 4.76m, which produces an improvement of 3.8% and 7.0% when compared to ϑ f = 10.0 (4.95m) and ϑ f = 0.02 (5.12m), respectively.

G. Computational Time
Finally, we evaluated the time consumption at each stage of our approach. The results are listed in Table IX. In our approach, we process the recordings in a batch matter, which means that we optimized the graph after all loop closures are identified. An Intel Core i5-4200M CPU with 2.5GHz frequency and 4GB RAM is used to process the measurements. We set ϑ r = −70, ϑ s = 0.7, r = 0.2, w = 40, and ϑ f = 0.5. As can be seen from Table IX, the entire data processing took 17.81 (6.08+5.73+5.93+0.07) seconds for tango-based dataset, which is almost 30 times faster than the data recording stage (544.75 seconds), while the processing time is much longer for step counter-based dataset (approx. 129.39 seconds, i.e., 23.58+72.34+31.82+1.65), due to its higher sampling rate. Additionally, optimization of the graph only took less than two seconds (0.07 and 1.65 seconds for Tango and step counter-based system respectively). In our current offline implementation, we compute the similarity of all pairs of Wi-Fi measurements in the entire dataset to find the potential loop closures. This module consumes too much time (72.34 seconds for the step counter version as shown in Table IX), and thus cannot be used for real time pose estimation. However, we believe the computation can be further optimized to make online implementation possible, e.g. we only need to compare the current Wi-Fi measurement with the previous measurements for the loop closure detection (estimated to be 72.34/2179 = 0.03 seconds), which is less than the current Wi-Fi sampling rate of one second interval. Nonetheless, we believe further optimization is needed to ensure online implementation in real time.
When more users are involved in the experiment, it will take longer time to run the algorithm due to the increasing number of nodes and the constraints in the graph. Still, our approach is efficient when compared to vision-based approaches, as vision-based approach requires heavy computational resources due to feature extraction and feature matching. In addition, there can be data association problems which will result in the loop closure failure. On other hand, the MAC address of the AP is unique. It is not necessary to run the optimization algorithm for each new Wi-Fi measurement. We suggest to run the optimization when a loop closure is detected or a certain amount of loop closures has been identified. Solutions to reduce the computational time can be found in [71] [72]. One might notice that the model training described in Section III-E takes long time. But this phase can be performed offline, and the learned model can be saved and applied to other users or different environments once it is generated.

V. CONCLUSIONS AND FUTURE WORK
In this paper, we presented a novel approach for collaborative simultaneous localization and radio fingerprint mapping (C-SLAM-RF) in unknown environments. The proposed system makes use of a pedestrian dead reckoning system and the RSS measurement from surrounding wireless access points. We further incorporate the motion features to improve the accuracy of the system. The proposed approach does not require any knowledge of the map and locations of the access points. The performance of our approach is evaluated in a large scale environment under two pedestrian dead reckoning systems with different motion tracking accuracies. Our results reveal that the accuracy of a pedestrian tracking system plays an important role in the accuracy of our approach. We obtained an accuracy of 0.6m and 4.76m for Tango and step counterbased pedestrian dead reckoning systems, respectively. The quality of the radio map will increase with more users involved in collecting the measurements due to the crowdsourcing nature of the proposed approach. One of our future work is to enhance the accuracy of step counter-based PDR by stride length estimation and the fusion of gyroscope measurement. Another direction would be the evaluation of the indoor positioning accuracy by applying the radio map constructed from our SLAM system.