scieee AI-readable full text Open interactive document viewer

TrackInFactory: a tight coupling particle filter for industrial vehicle tracking in indoor environments

Silva, Ivo Miguel Menezes; Pendão, Cristiano Gonçalves; Torres-Sospedra, Joaquín; Moreira, Adriano

Abstract

Localization and tracking of industrial vehicles have a key role in increasing productivity and improving the logistics processes of factories. Due to the demanding requirements of industrial vehicle tracking and navigation, existing systems explore technologies, such as LiDAR or ultra wide-band to achieve low positioning errors. In this article we propose TrackInFactory, a system that combines Wi-Fi with motion sensors, achieving submeter accuracy and a low maximum error. A tight coupling approach is explored in sensor fusion with a particle filter (PF). Information regarding the vehicle's initial position and heading is not required. This approach uses the similarity of Wi-Fi samples to update the particles' weights as they move according to motion sensor data. The PF dynamically adjusts its parameters based on a metric for estimating the confidence in position estimates, allowing to improve positioning performance. A series of simulations were performed to tune the PF. Then the approach was validated in real-world experiments with an industrial tow tractor, achieving a mean error of 0.81 m. In comparison to a loose coupling approach, this method reduced the maximum error by more than 60% and improved the overall mean error by more than 20%.

Full text

IEEE TRANSACTIONS ON SYSTEMS, MAN, AND CYBERNETICS: SYSTEMS, VOL. 52, NO. 7, JULY 2022 4151 TrackInFactory: A Tight Coupling Particle Filter for Industrial Vehicle Tracking in Indoor Environments Ivo Silva , Cristiano Pendão , Joaquín Torres-Sospedra , and Adriano Moreira ,Member, IEEE Abstract—Localization and tracking of industrial vehicles have a key role in increasing productivity and improving the logistics processes of factories. Due to the demanding requirements of industrial vehicle tracking and navigation, existing systems explore technologies, such as LiDAR or ultra wide-band to achieve low positioning errors. In this article we propose TrackInFactory, a system that combines Wi-Fi with motion sensors, achieving submeter accuracy and a low maximum error. A tight coupling approach is explored in sensor fusion with a particle filter (PF). Information regarding the vehicle’s initial position and heading is not required. This approach uses the similarity of Wi-Fi samples to update the particles’ weights as they move according to motion sensor data. The PF dynamically adjusts its parameters based on a metric for estimating the confidence in position estimates, allowing to improve positioning performance. A series of simulations were performed to tune the PF. Then the approach was validated in real-world experiments with an industrial tow tractor, achieving a mean error of 0.81 m. In comparison to a loose coupling approach, this method reduced the maximum error by more than 60% and improved the overall mean error by more than 20%. Index Terms—Bayesian filtering, dead reckoning (DR), indoor positioning, indoor tracking, industrial vehicle, industry 4.0, particle filter (PF), sensor fusion, tight coupling (TC), Wi-Fi- based positioning. I. INTRODUCTION VEHICLES have an important role in the distribution of materials in industrial environments, thus current and future generation factories (Industry 4.0) can benefit from tracking these vehicles to increase productivity, improve logistics processes and enable device intercommunication. Besides, materials can be tracked along the supply chain by continuously monitoring the position of the vehicles carrying them, Manuscript received October 21, 2020; revised February 24, 2021 and April 30, 2021; accepted June 14, 2021. Date of publication July 6, 2021; date of current version June 16, 2022. This work was supported in part by the FCT— Fundação para a Ciência e Tecnologia within the Research and Development Units Project Scope under Grant UIDB/00319/2020; in part by the Ph.D. Fellowship under Grant PD/BD/137401/2018; and in part by the Ministerio de Ciéncia, Innovación y Universidades under Grant PTQ2018-009981. This article was recommended by Associate Editor R. Cui. (Corresponding author: Ivo Silva.) Ivo Silva, Cristiano Pendão, and Adriano Moreira are with the Algoritmi Research Centre, University of Minho, 4800-058 Guimaraes, Portugal (e-mail: iv[email protected]; [email protected]; [email protected]). Joaquín Torres-Sospedra is with the UBIK Geospatial Solutions S.L., 12006 Castellón, Spain (e-mail: [email protected]). Color versions of one or more figures in this article are available at https://doi.org/10.1109/TSMC.2021.3091987. Digital Object Identifier 10.1109/TSMC.2021.3091987 improving internal and external logistics. With the rapid development of research in this area [1], [2], there are already autonomous vehicles as well as hybrid vehicles (can be humanoperated and also operate autonomously) in factories, which can benefit from positioning and tracking. Positioning of industrial vehicles can have two distinct applications, namely, continuous tracking and monitoring of the vehicle’s position as it operates (main focus of this work), and as support for navigation of autonomous vehicles [3], [4]. Both applications have similar requirements, including coverage of the entire operating area (factory plant), submeter accuracy (or better for navigation), low maximum error, availability and high reliability. The reliability of a positioning system is especially important for the localization of vehicles, as it defines if the provided estimates can be trusted. A positioning system with low reliability can provide very accurate estimates as well as estimates with large error, without providing any feedback as to whether those estimates are accurate or not. Conversely, a reliable positioning system is able to determine if a position estimate has a high/low error associated, i.e., if the position estimate can be trusted. For many years, the localization of vehicles has been supported by GPS in outdoor environments, however, GPS does not properly operate indoors due to the attenuation and distortion caused by the building structure. Among the available solutions for indoor positioning, Wi-Fi fingerprinting is widely used. Wi-Fi fingerprinting works on a simple principle where the radio environment at each particular position is defined by a unique fingerprint, i.e., a set of signal strength measurements [5]. A previously collected radio map (RM), composed of Wi-Fi samples (WSs), is used to obtain the similarity between each RM sample and an online WS, then an estimator algorithm [e.g., k-nearest-neighbor (kNN) or a weighted kNN variant] is used to find a position estimate. Although Wi-Fi networks are already present in most buildings, even factories, enabling Wi-Fi fingerprinting, it usually provides a mean positioning error between 2 and 4 m with a presence of punctual large errors higher than 10 m [6]. Even though Wi-Fi may provide an absolute position, it is not effective for tracking vehicles, due to significant variation between position estimates and due to low accuracy. Alternatively, vehicles can be tracked using dead reckoning (DR) by exploring sensors, such as inertial measurement units (IMUs) and wheel encoders. DR depends on knowledge about the initial pose (position and heading), which must be estimated using other methods, and it suffers from cumulative errors that affect IMU sensors, causing drift in the This work is licensed under a Creative Commons Attribution 4.0 License. For more information, see https://creativecommons.org/licenses/by/4.0/ 4152 IEEE TRANSACTIONS ON SYSTEMS, MAN, AND CYBERNETICS: SYSTEMS, VOL. 52, NO. 7, JULY 2022 estimated trajectory. Sensor fusion of Wi-Fi with motion sensors allows to benefit from both approaches while minimising their drawbacks. To overcome the main challenges of indoor vehicle localization, we propose TrackInFactory, a solution for the localization and tracking of industrial vehicles based on a particle filter (PF) that performs the sensor fusion in a novel way. The PF comprises a set of particles which weights represent position probabilities and uses a set of methods to update particle’s states and replace the ones with lower weights with new ones. Data fusion is applied using a tight coupling (TC) approach at the measurement level by combining raw measurements from each sensor (Wi-Fi, IMU, and encoder) to provide an estimated position. Entire coverage of the factory plant is provided by Wi-Fi, which allows to obtain an initial position. Then, Wi- Fi, heading and displacement samples allow the PF to update the particles states considering noise in the sensors. The PF is capable of estimating the position and heading of the vehicle, continuously. Besides, it can be easily adapted to various types of manually operated or autonomous industrial vehicles. We have recurred to simulation to validate our approach before conducting experiments in the real-world with a real industrial vehicle in a factory-like environment. This article introduces two main novel contributions to the use of PFs for sensor fusion in Wi-Fi-based indoor positioning. First, Wi-Fi data is fused with motion data using a TC approach that maximizes all the available Wi-Fi information. Second, a new method is introduced to dynamically update the particles’ weights using a new reliability metric that defines the confidence of each position estimate. Moreover, a significant additional contribution of this article is the real-world experiments conducted in an industrial scenario with an industrial tow tractor, that allowed to compare the performance between the proposed solution and a loose coupling (LC) solution. II. RELATED WORK Different technologies may be used for the localization of industrial vehicles depending on the application requirements, being the cost, accuracy and reliability the most important factors when choosing the technology. The localization of industrial vehicles indoors may resort to camera vision, ultrasounds, magnetic, laser ranging (LiDAR), ultra wide-band (UWB), RFID, Wi-Fi, or Bluetooth. These technologies are often combined with motion sensors using sensor fusion to improve positioning performance. Additional details about real-time localization systems in industrial settings can be found in [7]. UWB systems are used for vehicle localization in [2] and [8]. In [2], UWB is combined with GPS to provide indoor/outdoor positioning of industrial vehicles. Sensor fusion is performed with a PF, achieving an average error of 0.16 m in simulations. A drawback of this solution is that it depends on line-of-sight propagation and it is expensive due to the use of UWB. Wu et al. [9] proposed an indoor positioning system (IPS) for mobile robot localization that does not depend on additional infrastructure because positioning relies on the magnetic field and LiDAR data. The initial position is obtained from magnetic fingerprinting while a finer position is obtained by laser scan matching. The empirical experiments performed in an area of 57×19 m revealed an RMSE of 1.43 m considering that the initial pose is known. RFID has been explored in [3] and [10] for mobile robot localization. In [3], passive tags placed on walls of the space are detected by a robot equipped with RFID antennas. The robot’s pose is obtained from the sensory fusion of RFID with odometry, using a similarity sensor model. Experiments have revealed a mean error of 0.14 m in an area with around 230 m2. Both solutions are complex to scale for larger buildings due to the installation of RFID tags and since they can also suffer from interference from Wi-Fi or Bluetooth. Although UWB, LiDAR and RFID technologies can meet the demanding requirements of indoor tracking of industrial vehicles, they are expensive. Alternatively, Wi-Fi is low-cost and ubiquitous since it is present in most buildings, including factories, thus it is an ideal technology for deployments that take advantage of already existing infrastructure. Wi-Fi has been explored for localization in industrial environments to improve productivity in [11] and [12], and explored for vehicle tracking in [13] and [14]. The IPS for vehicles based on Wi- Fi fingerprinting [14] uses a raw data smoothing technique to feed a classifier based on neural networks, which can deal with noisy Wi-Fi signal strength measurements. This solution achieved a mean error of 2.25 m in performed tests. Traditionally, sensor fusion for positioning can be performed using LC or TC approaches. In LC, sensor fusion is performed at the position level, i.e., positions obtained from distinct estimators are combined into a new estimate. In TC, measurements from each sensor are combined in an algorithm to generate a unique estimate. Different Bayesian techniques have been explored in the literature about sensor fusion in indoor positioning, namely, the Kalman Filter (KF) [15], the extended KF (EKF) [16], and the PF [2], [3], [17]. KF models the uncertainty to be Gaussian distributed, hence it is suitable for problems where the noise in data tends to be Gaussian and uni-modal. EKF, a variation of the KF for nonlinear problems, is used in GPS and navigation as well as in the positioning of mobile robots [16]. Similarly to the EKF, the unscented KF (UKF), is used in nonlinear problems. The PF is a subset of Monte Carlo methods suitable for nonlinear and non-Gaussian problems because it does not assume linearity and Gaussian nature of noise in data. Some advantages of the PF are [17]: many particles represent several possible positions hypotheses simultaneously; it can work with different sensor types, motion dynamics and noise distributions; and, it is simple to implement. Even though the PF is computationally expensive, it is possible to adjust the number of particles, adapting it to the available computing resources. In recent years, researchers have been working on novel approaches aiming to merge Wi-Fi with DR. Some systems adopt PFs to locate pedestrians using Wi-Fi+PDR [18], [19]. Other systems explore simultaneous localization and mapping (SLAM) techniques for indoor localization, e.g., in [20], a graph is used to combine Wi-Fi fingerprinting with DR information from a phone. Loop closure and turn detection SILVA et al.: TrackInFactory: TC PF FOR INDUSTRIAL VEHICLE TRACKING IN INDOOR ENVIRONMENTS 4153 Fig. 1. TC and LC approaches. are used to correct the estimated trajectory and eliminate cumulative errors from motion sensors. In experiments conducted in an area of 130 ×70 m, this solution achieved an accuracy of 0.6 m and 4.76 m with Tango-based PDR (high motion tracking accuracy using visual-based odometry) and step-counter-based PDR, respectively. In our approach, TC sensory fusion of Wi-Fi and motion data takes advantage of the fusion at the measurement level. It offers a good cost-benefit balance as it leverages existing WLAN infrastructure to provide coverage of the entire operational area and uses motion sensors to allow continuous tracking. In alternative to trajectory correction techniques, such as loop closure, the proposed solution takes advantage of the PF and a novel reliability metric that dynamically adjusts the particles’ weights based on Wi-Fi similarity. In summary, using accurate sensors (e.g., LiDAR) or technologies (e.g., UWB or RFID) for indoor localization leads to high positioning accuracy, but is expensive. On the other hand, low-cost solutions, such as Wi-Fi, are ubiquitous but have low accuracy. The wide adoption of PFs in previous works has shown they are suitable to combine Wi-Fi data with other sensors for indoor localization. In this article, we take advantage of previous knowledge and use a PF with a novel TC approach for industrial vehicle tracking, an area of indoor positioning that lacks significant contributions. III. TRACKINFACTORY:PARTICLE FILTER BASED ON TIGHT COUPLING This section introduces TrackInFactory, an IPS based on a PF that combines Wi-Fi fingerprinting with DR for more accurate and reliable position estimates. A. Tight Coupling Versus Loose Coupling Since the Wi-Fi RM covers the entire area of the building and each particle represents the probability of the vehicle to be at a certain position, Wi-Fi has an important role in updating particles’ weights. Wi-Fi fingerprinting can be used either to provide a position estimate [Fig. 1(a)] or to obtain a set of similarities between the operational WS and the reference samples of the RM [Fig. 1(b)]. Both outputs can serve as input for the PF, being the Wi-Fi position estimate related to a LC approach, whereas the set of similarities related to a TC approach. The LC approach, explored in [21]–[23], combines a Wi-Fi position estimate with data from other sensors in the fusion algorithm. For instance, a Wi-Fi fingerprinting method based on kNN first computes the similarity between the WS and the reference samples from the RM. Then, a position estimate is obtained based on the most similar WSs and is combined with data from other sensors to produce a more accurate position estimate. Large errors are usual in Wi-Fi-based positioning due to different signal propagation effects, hence this approach has the additional challenge of trying to eliminate the large positioning errors. The TC approach has been explored in [18] (using Wi-Fi) and in [3] (using RFID). In a TC approach based on Wi-Fi, the similarities between a new WS and the RM are computed. Then, the similarities are used in updating the particles’ weights. Each particle has a weight based on the similarity of its closest reference point (RP). In contrast with the LC approach, which only considers a small set of RM samples, this approach considers the entire RM, therefore it benefits from all available information. Moreover, since TC does not rely on a position estimate, it is less influenced by large positioning errors. B. Particle Filter PFs are one of the best tools to solve nonlinear, non- Gaussian problems, especially because noise is non-Gaussian in heading observations (due to magnetic disturbances that affect the heading provided by the IMU [24]) and in Wi-Fi signal strength measurements. Another advantage of PFs is that floor plans can be easily integrated, which is important for indoor vehicle tracking, as it allows to define navigable areas (spaces where vehicles operate), consequently, position estimates are improved by removing particles that hit walls or obstacles. PFs are based on the idea that a set of particles represents the belief of the vehicle being in a position and comprise three iterative steps named predict, update, and resampling. In the predict step, particles states are estimated based on the previous particle state and a motion model, taking into account the noise models of each sensor. In the update step, particles’ weights are updated according to measurements from the sensors. After initialization, particles spread throughout the space before they start converging into a position where it is more likely for the vehicle to be at. This is achieved by assigning different weights to particles, being that particles that are closer to the vehicle’s position have higher weights, conversely, particles further from the vehicle have lower weights. Lower weight particles are removed in the resampling step, and new particles are created by cloning higher weight particles. Finally, the position and heading of the vehicle are estimated based on the set of particles with higher weights. Fig. 2 represents the main algorithm of the proposed PF. It starts with the particles’ initialization, then waits for samples from sensors (displacement, heading or Wi-Fi). Particles move according to heading and displacement measurements considering noise. Upon receiving a new WS, the particles’ weights are updated and then the particles are subject to resampling. The vehicle’s position and heading are updated after this process. 4154 IEEE TRANSACTIONS ON SYSTEMS, MAN, AND CYBERNETICS: SYSTEMS, VOL. 52, NO. 7, JULY 2022 Fig. 2. PF main algorithm. A particle is defined as pi=(w,x,y,z,h,ho), where w represents the weight of the particle, x,y, and z1represent the position coordinates of the particle, hrepresents the heading and ho represents the heading offset, necessary to estimate the heading of the vehicle (see Section III-C). C. Initialization Particles are created around the positions where it is more likely for the vehicle to be at, to minimize large initial errors due to particles being uniformly dispersed throughout the operational area. Before creating particles, an absolute position is necessary to determine where to place them. Wi-Fi fingerprinting allows to obtain an absolute position, however, there is a certain probability to have a high error in the initial position. To minimize the initial error, access points (APs) signal strengths of the first few WSs are averaged into a merged WS (only received signal strength indicator (RSSI) values of detected APs are considered), to increase the probability of placing the particles closer to the real position [25]. The similarity between the averaged sample and all RM samples is obtained, resulting in a list of samples ordered by similarity. Particles are created around the positions (RPs) where the most similar RM samples were collected. As the initial heading of the vehicle is unknown, each particle has an initial heading offset (ho) randomly set. Once particles start moving, the ones with the correct heading offset will remain alive because they have higher weights, hence after a few iterations particles converge to the correct heading. Algorithm 1 describes how particles are created around RPs where the merged WS is more similar. See Section III-D1 for details about the initial particles’ weights. 1For simplicity, the vehicle is assumed to move in a plane, therefore with constant z. Algorithm 1 Particles Initialization Input rm - radio map, set of WSs ws - sample of averaged RSSIs of first MWSs knumber of RPs where particles will be created around N- total number of particles ({N∈Z|N>k}) Output P- set of all particles. 1: procedure PARTICLES INITIALIZATION 2: P={} 3: S=dsim(rm,ws)//compute Manhattan distance (dissimilarity) between samples of rm and ws 4: RPs =set of kRPs from Sthat are more similar with ws 5: np =N/#(RPs)//number of particles to be created around each RP 6: for rp ∈RPs do 7: sn=normalized similarity between ws and rp,defined in Eq. 2 8: for i=1∈{1... np}do 9: w←sn 10: x←rp.x+rand(0,r) 11: y←rp.y+rand(0,r) 12: z←1 13: h←0 14: ho ←rand(−π, π) 15: p←(w,x,y,z,h,ho) 16: P←P∪{p} D. Sampling The prediction and update steps are performed simultaneously when new sensor samples are obtained. The prediction is based on the propagation of particles according to heading and displacement samples, which consider noise modelled after the IMU and encoder, respectively. Therefore, whenever a new heading or displacement sample is collected, the sampling process includes the predict (added noise) and the update (new observations) in the same step (Section III-D2). The update step also includes the process to update the particles’ weights, which is based on the particle’s current state and the latest WS. 1) Update Particles’ Weights: Wi-Fi ensures absolute positioning coverage of the entire operational area, therefore it is used to update particles weights as it allows to assign higher weights to particles that are closer to the most probable positions, and lower weights to particles that are further away from the most probable positions. In this context, the RM is defined by RM = {(ρ1,ws1),...,(ρ m,wsm)}, which is the set of mWSs, each associated to the position ρwhere it was collected. Each WS, defined as ws ={RSSI1,...,RSSIn}represents the set of received RSSI values detected by a Wi-Fi interface. In Wi-Fi fingerprinting, a position estimate is usually obtained by computing the centroid of the most similar RM samples. While this estimated position can be used to update the weights of the particles (LC), this approach does not use all the available information (set of all the similarities between the new WS and all the RM samples, defined as S={s1,...,sm}. SILVA et al.: TrackInFactory: TC PF FOR INDUSTRIAL VEHICLE TRACKING IN INDOOR ENVIRONMENTS 4155 Fig. 3. Normalized similarity between a WS and RM samples. Statistically, RM samples that are more similar to the WS are the ones closer to the true position of the WS, as depicted in Fig. 3. In our approach, the set of all similarities is used when updating particles weights (TC). Two fingerprints are compared using a distance (dissimilarity) or similarity function, e.g., Manhattan, Euclidean or Minkowski distances, or the cosine similarity. We have opted for the Manhattan distance since it showed good performance in Wi-Fi fingerprinting [26]–[28]. The expression that defines the distance between a WS and a RM sample, obtained with the Manhattan distance, is presented next s= n  i=1RSSIrm i−RSSIws i(1) where RSSIirefers to the signal strength of APifrom the RM sample (rm) and the Wi-Fi sample (ws). If an AP is missing either in the RM sample or the WS, a default RSSI value of −90 dBm is used. Once this is performed for all samples of the RM, the Manhattan distance is normalized and converted into the Manhattan normalized similarity, defined as sn=max(S)−s max(S)−min(s)(2) where Srepresents the set of all distances between the WS and all RM samples. Fig. 3 shows an example of the normalized similarity between a WS and the RM samples. Areas with higher similarity are depicted at the top and bottom of the figure. If the traditional LC approach were used, the centroid could fall in an area with low similarity (black triangle), which is displaced with respect to the real location of the WS. This issue does not exist in a TC approach because it considers all available information and it does not depend on the estimated position. The particles’ weights have an important role in the PF as they define which particles are removed in the resampling process, and they are used when estimating the vehicle’s position and heading. The weight of a particle is defined as wt=wt−1∗(1−α) +sn∗α(3) where wt−1represents the previous particle weight, snrepresents the normalized similarity, and α, a factor used to define how much the latest available Wi-Fi information affects the particles’ weights. Fig. 4. Assigning a similarity value to each particle. The normalized similarity (sn) component of the particle’s weight is obtained from the nearest RP as shown in Fig. 4. As the particle’s weight depends on its closest RP, a dense RM with a low distance between neighbouring RPs (e.g., 1×1m grid), will improve the system performance because it ensures that the particle’s closest RP is always at a distance lower than the grid size. A RM with a larger distance between RPs can also be adopted as long as its density is increased using log-distance path loss (LDPL) [5], or other techniques to interpolate RSSI values. 2) Displacement and Heading: Continuous tracking of the vehicle’s position is achieved by updating particles’ positions and headings using the data provided by the encoder and IMU sensors, which measure the displacement and heading (orientation), respectively. For each new displacement sample, particles’ positions are updated as follows: xt=xt−1+(dt+nd)×sin(ht) yt=yt−1+(dt+nd)×cos(ht)(4) where xt−1,yt−1represent the previous position of the particle, dtrepresents the displacement (in meters) with respect to the previous reading, htrepresents the heading, and ndis a zero-mean Gaussian distributed random variable added to the displacement measurement. When a particle hits a wall or obstacle in this step, its weight is set to zero. The selected AHRS IMU (see Section V-B) estimates AHRS orientation data using its algorithms, which take advantage of reference vectors (i.e., gravity and the earth’s magnetic field) to compensate for gyroscopes integration drift, resulting in more reliable orientation data (lower drift), provided in Euler angles (roll, pitch, and yaw). Particles’ headings are updated when a new IMU sample is received ht=θt+nθ+ho (5) where θtrepresents the heading (yaw) measurement from the sensor at instant t,nθis a zero-mean Gaussian distributed random variable and ho represents the heading offset (necessary to estimate the initial heading, see Section III-C) of the particle. 4156 IEEE TRANSACTIONS ON SYSTEMS, MAN, AND CYBERNETICS: SYSTEMS, VOL. 52, NO. 7, JULY 2022 E. Resampling After updating particles’ weights, particles are subject to resampling. Particles with weights lower than a given threshold are removed and new particles are created from the subset of particles with higher weights. In order to improve heading estimation and cope with drift in the heading, which is cumulative over time, new particles have a new heading offset based on the higher weight particle that was selected to be copied. This process is described in Algorithm 2. Removing particles with lower weights has the purpose of reducing the time it takes the particles to cluster around the most likely position. In contrast, the removal of these particles is also a disadvantage of this resampling method because it may lead to particle impoverishment, which occurs because of the reduction of truly distinct particles. Once the particles with lower weights are removed (line 2, Algorithm 2), the algorithm enters a loop (line 3, Algorithm 2) to create new particles until a total of Nparticles exists in P. We adopted the multinomial resampling method [29], where particles are randomly selected according to their weight, using the weight as the probability of being selected (line 5, Algorithm 2). This allows higher weight particles to be selected with higher frequency than the ones with lower weights. Since we consider the particle’s previous weights when updating the particle’s weight, our PF does not follow a standard implementation in resampling where weights are normalized, to sum up to one, and all particles have the same weight of 1/N. Instead, newly created particles that are copies of particles with higher weights inherit the original particle’s weight. In the unlikely case that all particles have weight lower than wth, only 70% of particles are replaced to ensure that there is particle diversity and avoid particle impoverishment. In the initialization process, a random heading offset is assigned to each particle and, as the PF starts converging, particles that were initialized with the correct heading offset will have a higher probability of being selected and copied in this process, which will allow all particles to converge into similar heading offset values. In the resampling process, new particles are created with a new heading offset to compensate for heading drift (line 6, Algorithm 2). F. Vehicle’s Position and Heading The vehicle’s pose is estimated from the weighted average of particle’s positions and headings V(x,y,z,h)=N i=1pi(x,y,z)×pi.w N i=1pi.w tan−1N i=1sin(pi.h)×pi.w N i=1cos(pi.h)×pi.w.(6) G. Confidence in Position Estimates and Dynamic α Larger positioning errors may occur during the first iterations after initialization because the initial position and heading are unknown. During this period, Wi-Fi should have a higher influence on particles’ weights because it will result Algorithm 2 Resample Particles Input wth - weight threshold, particles with weight lower than it are removed nho - zero-mean Gaussian distributed random variable, to minimize drift and improve heading estimation Output P- set of resampled particles 1: procedure RESAMPLE PARTICLES 2: P=list of particles with weights higher than wth 3: if #P== 0then 4: //If all particles have weights lower than wth 5: P=list of 30% of particles with higher weights 6: while #(P)<Ndo (multinomial resampling) 7: //create copies of particles from P 8: p=particle selected from Pusing its weight as probability 9: ho ←p.ho +nho //particle’s heading offset composed of the original particle offset + noise component 10: p←(p.w,p.x,p.y,p.z,p.h,ho) 11: P←P∪p//add copied particle to the set of resampled particles in removing particles in areas where it is less likely for the vehicle to be at. As particles are dispersed throughout the space during the first iterations of the PF, higher weights will be attributed to particles in areas where it is more likely for the vehicle to be, and lower weights to particles that are in unlikely positions. Since Wi-Fi defines how particles’ weights are updated, it also has an important role to minimize drift in the heading. The αparameter, introduced in Section III-D1, defines how much the particle’s weight is influenced by the Wi-Fi similarity. We devised a mechanism in which a confidence measure is used to define the value of α. When the confidence is lower (meaning that a higher positioning error might exist), a larger value is assigned to αwhich gives a higher influence to Wi-Fi. This mechanism is continuously performed since the initialization step. The dispersion of particles ϑ(in meters), defined as the average distance between the particles’ positions and the PF estimated position, is given by ϑ=1 N N  i=1 d(V,pi)×wi(7) where Vis the PF estimated position, pirepresents the ith particle position and wirepresents the particle’s weight. The dispersion is used to define a metric of confidence as C(ϑ) =−1 rmax ϑ+1,0≤ϑ<rmax 0,ϑ≥rmax (8) where rmax defines the maximum allowed dispersion (in meters) between particles. We defined rmax =4m, since, even for tracking, more than 4 m radius is a significant area to have confidence about the position of the vehicle. The confidence was modelled after an empirical analysis of the particles’ dispersion in simulations, as described in SILVA et al.: TrackInFactory: TC PF FOR INDUSTRIAL VEHICLE TRACKING IN INDOOR ENVIRONMENTS 4157 Section IV. Upon our analysis, we found that when the cloud of particles is smaller (lower dispersion), there is usually higher confidence associated. Moreover, when the dispersion of particles is larger (e.g., during first iterations) the positioning error tends to be higher. The confidence measure has to be a reliable indicator of whether there is a large error in position estimates, hence we have conducted experiments with synthetic data to define the appropriate function that defines the confidence. In Section IV-E we show the correlation between the confidence and the positioning error, demonstrating that the confidence function is reliable. Even though αcould be a direct translation of the confidence value, i.e., α=1−C, it would greatly impact the PF estimated position, as Wi-Fi would have too much influence on particles’ weights resulting in large errors. Since large positioning errors occur when α≥0.6 (see Section IV-C), was decided to use the next expression to ensure that when confidence is low, Wi-Fi does not have too much importance α=0.6−0.6×C.(9) We have used simple (linear) models for Cand αin our implementation, because they have been effective in simulations, but we intend to explore other models in future works. IV. SIMULATION Simulations were performed to tune the PF parameters before running tests in a real environment. Initially, we created a simulated environment and generated synthetic data of displacement, heading and Wi-Fi measurements, affected by noise and drift in the heading. Finally, the proposed PF was tested and its parameters tuned to achieve the best results. A. Simulation Scenarios Two simulation scenarios were considered, one representing an empty building (50 ×20 m), without obstacles, and another representing a building with the same dimensions but with space restrictions (the vehicle cannot navigate in some areas). Six trajectories were considered in these experiments: three random trajectories (RTs) and three loop trajectories (LTs). The purpose of RT is to show that the PF is capable of converging, even without any space restrictions, and the purpose of LT is to show how the PF performs in a realistic scenario, with obstacles and space restrictions. Each RT is defined by a random movement with a travelled distance of approximate 500 m. Each LT is defined by a cyclic movement, where the vehicle performs several laps in a predefined trajectory and has an average travelled distance of about 1750 m. B. Synthetic Data As TrackInFactory depends on data from Wi-Fi and motion sensors, it is necessary to emulate them by generating synthetic data (heading, displacement and Wi-Fi) synchronized in time. To achieve that, it was assumed that the vehicle follows a trajectory from point A to point B at a constant speed of 1 m/s, then it stops for 1 s at B, before proceeding to the next point. A trajectory is composed of several points. Based on the output of sensors to be used, sampling rates of heading, displacement and Wi-Fi were defined as 20, 50, and 1/2 Hz, respectively. Wi-Fi scanning in the 2.4-GHz frequency range usually takes more than 1.5 s to collect the signal strength values, hence it was decided that WSs were generated every 2 s. A displacement sample is defined as ds =l+nds (10) where lrepresents the true traveled distance and nds represents a zero-mean Gaussian random distribution that we defined as N(0, 0.004 m). Heading samples are generated as hs =β+nhs +φ(11) where βrepresents the true absolute heading, nhs represents a zero-mean Gaussian distributed random variable, and φ represents the cumulative drift defined in degrees per hour, meaning that drift increases over time, hence after one hour drift has a value of φdegrees. We defined nhs =N(0,10◦) and φ=20◦/h. A simple model based on LDPL was used to calculate signal strength values of APs. A signal strength value is defined as RSSI =RSSI0−10 ×η×log10(ξ) +nrssi (12) where RSSI0represents the RSSI value at 1 m distance of the AP, ηrepresents the path loss exponent, ξrepresents the distance between the AP and the point where the signal strength is estimated, and nrssi is a zero-mean Gaussian distributed random variable. We defined RSSI0=−40 dBm, nrssi =N(0,4dBm), and η=2. Both RM samples, as well as WSs of trajectories, were created using this model. The RM of the simulation scenario comprises 20 WSs at each RP for a 1x1 m grid of RPs. In the definition of noise components (nhs and nds) and drift in the heading (φ), we assumed that the sensors produced more noise than normal (industrial-grade) sensors, to test the proposed solution under challenging conditions. The Wi-Fi noise component was defined considering that Wi-Fi signals have high variability in indoor environments, due to multipath and other propagation effects. C. Analysis of Results Using Constant α Before modeling the confidence function, described in Section III-G, we studied how αaffects results, using a constant αin all trajectories. The PF was run three times for each trajectory, using different random seeds. Table I (top part) shows the overall positioning error that includes position estimates of all runs of LT and RT trajectories. The Euclidean distance between the estimated and true positions was used as the error metric. A clear deterioration of results was observed for α≥0.6. This suggests that in the long run, the latest WS should have a low influence over the particles’ weights, therefore we defined the value of α(9) varying between 0 and 0.6 as a function of the confidence. When the confidence is high, αis low, and vice-versa. This approach is important in the warm-up period during which Wi-Fi has more importance while the particles are still converging into a position and heading where it is 4158 IEEE TRANSACTIONS ON SYSTEMS, MAN, AND CYBERNETICS: SYSTEMS, VOL. 52, NO. 7, JULY 2022 TABLE I POSITIONING RESULTS (IN METERS)OF SIMULATED TRAJECTORIES FOR DIFFERENT α(TOP)AND wth (BOTTOM)VALUES more likely to be the true vehicle’s pose. After the warm-up period, confidence tends to be high, hence αwill be lower. D. Analysis of Weight Threshold wth We also analyzed the PF performance for different values of the weight threshold (wth) used in the resampling process. In this process, if the weight threshold is too low, particles will move freely in RT trajectories or will move freely until they hit walls or obstacles in LT trajectories. If it is too high, too many particles are removed in the resampling process. Based on the previous results, we conducted the same experiment for LT and RT trajectories using α=0.2 and tested different values of wth to understand how this parameter affects results. Table I (bottom part) shows the overall positioning error that includes position estimates of RT and LT trajectories, obtained for different wth values. When wth =0.7 it achieves the best mean, P75th,P99th and maximum error, therefore it is the selected value for wth in experiments, including the ones of Section IV-C. As expected, the PF performance degrades when wth is too high, i.e., for wth ≥0.8 the PF removes an excessive amount of particles in resampling, hence the PF is not able to converge. E. Simulation Results The following results consider αas a function of C,as described in Section III-G. Each trajectory was run three times, as previously. Positioning error statistics include all position estimates since t=0, including the initial warm-up period. In Table II, we show the positioning results of LTs, RTs and all trajectories. In comparison with the constant αresults, the major improvement was observed in the overall maximum error from 6.93 m (for α=0.2) to 5.95 m, besides, all other performance metrics are also improved. Also, better results are achieved in LT, in comparison to RT, because many particles are removed when they hit walls or obstacles. This filters out those particles that are in a less-likely situation where the vehicle suddenly jumps to an area that is not linked to the previous positions and, therefore, improving positioning. Conversely, the positioning error is larger in RT because particles are more dispersed, and they are removed in the resampling process or when they hit the limits of the open-space building. TABLE II POSITIONING RESULTS OF RT, LT, AND ALL TRAJECTORIES USING A DYNAMIC α(IN METERS) Fig. 5. Density plot of position error versus confidence. F. Positioning Error Versus Confidence Fig. 5 depicts a density plot of the positioning error versus confidence, considering all position estimates of all simulations. It shows that there is a relationship between the confidence (given by the dispersion of particles) and the positioning error, where the vast majority of position estimates with high confidence (>0.8) have positioning errors lower than 1 m. There is a strong negative correlation between the positioning error and confidence, which is statistically significant, rPearson =−0.70,p=0.0. A logarithmic scale is used in the color scale of Fig. 5 to better represent these results. G. Parameters Based on the simulation process and preliminary experiments with the vehicle prototype (see Section V-B), we have defined the parameters of the PF used in simulations and realworld experiments. In the initialization process we have set N=3000, M=3, and k=6. The random variables characterizing noise in the displacement and heading were defined as nd=N(0,0.01 m)and nθ=N(0,1◦), respectively, based on sensor’s datasheet information. In the resampling process, wth =0.7 and nho =N(0,2◦)were used. V. REAL-WORLD EXPERIMENTS We performed experiments with an industrial vehicle in a factory-like building. First, we mapped and affixed tags to the floor to be used as RPs in the testing scenario. Second, we have equipped the vehicle with a positioning module. Finally, we performed experiments to evaluate our solution in a real environment. SILVA et al.: TrackInFactory: TC PF FOR INDUSTRIAL VEHICLE TRACKING IN INDOOR ENVIRONMENTS 4159 Fig. 6. PIEP building at University of Minho. Fig. 7. Floor plan of testing scenario—RPs (gray squares) and the installed APs according to their model, network standard and height (z). A. Testing Scenario Experiments were conducted at the PIEP building (at the University of Minho) which measures approximately 50 by 20 m and is more than 8 m high. The PIEP building is dedicated to research on plastic polymers, hence it is similar to a factory plant with large open spaces, large machinery and metal objects (injection molds), as shown in Fig. 6. Fig. 7 shows RPs where RM samples were collected (gray squares), the positions and specifications of the APs present in the building (colored squares and diamonds), and the navigable areas (places where the vehicle can operate). The distance between adjacent RPs is 1 m in most cases. Also, we affixed tags to the floor marking RP locations which allowed collecting ground truth using a video camera (pointed to the floor) to register the time when the vehicle has passed over a tag. It took about 180 min. to build the RM with 178 RPs, considering 40 s to collect 20 WSs at each RP and 30 s to move the vehicle to a new RP. B. Vehicle Prototype We have installed a positioning module in a tow truck (Toyota BT Movit TSE300) used to transport materials in factories. Fig. 8 shows the integrated positioning module composed of a Raspberry Pi Model 3B as well as the following sensors: four Edimax EW-7811un external Wi-Fi interfaces; an Xsens MTi-300 AHRS IMU to measure the heading; and, a U.S. Digital A2 absolute encoder to measure the displacement. The encoder sensor is attached to the back of the vehicle with a custom mount. We use multiple Wi-Fi interfaces since signals of distinct Wi-Fi interfaces are poorly correlated [25], which allows to average signal strength values into a merged WS. Fig. 8. Industrial vehicle (tow tractor) used in tests. (a) (b) (d)(c) (e) (f) Fig. 9. Comparison between DR and PF estimated trajectories. (a) DR trajectory 1. (b) PF trajectory 1. (c) DR trajectory 2. (d) PF trajectory 2. (e) DR trajectory 3. (f) PF trajectory 3. The positioning module can be easily installed in other types of vehicles because it operates independently of the vehicle, but, it still depends on coupling the encoder to the vehicle. C. Results Carried tests with the industrial tow tractor included three trajectories with a duration of 15, 15, and 7 min, respectively. The total distance covered over all trajectories sums up to approximately 775 m. Fig. 9 displays the DR and PF trajectories. The DR trajectories were obtained using an initial position and heading of the vehicle, while in the PF trajectories the initial pose was unknown. Drift in the heading is present in all DR trajectories. Conversely, the PF can compensate for the drift as shown by the PF estimated trajectory. This is possible due to the removal of particles that hit walls or obstacles and also because the heading offset of particles is updated in the resampling process. In order to compare TrackInFactory to the LC approach in [21], Fig. 10 shows how the positioning error varies over