{'fraction_non_alphanumeric': 0.03929490988314518, 'fraction_numerical': 0.008714596949891068, 'mean_word_length': 4.145943742356298, 'pattern_counts': {'":': 0, '<': 0, '<?xml version=': 0, '>': 2, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 3, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
Wireless Indoor Simultaneous Localization and Mapping Using Reconfigurable Intelligent Surface

Indoor wireless simultaneous localization and mapping (SLAM) is considered as a promising technique to provide positioning services in future 6G systems. However, the accuracy of traditional wireless SLAM system heavily relies on the quality of propagation paths, which is limited by the uncontrollable wireless environment. In this paper, we propose a novel SLAM system assisted by a reconfigurable intelligent surface (RIS) to address this issue. By configuring the phase shifts of the RIS, the strength of received signals can be enhanced to resist the disturbance of noise. However, the selection of phase shifts heavily influences the localization and mapping phase, which makes the design very challenging. To tackle this challenge, we formulate the RIS-assisted indoor SLAM optimization problem and design an error minimization algorithm for it. Simulations show that the RIS assisted SLAM system can decrease the positioning error by at least 31% compared with benchmark schemes.


I. INTRODUCTION
To enable location and sensing based services in future 6G networks such as [1] and [2], simultaneous localization and mapping (SLAM) technique is a promising solution. Specifically, the SLAM technique uses sensors such as camera, laser, or antennas to sense the surrounding area and estimates the location of the agent equipped with these sensors. Recently, wireless SLAM which uses antennas to exploit the multipath effect of the wireless signals for SLAM has attracted much attention [3]. Unlike vision SLAM which uses cameras and fails in dark environment, wireless SLAM is robust to light conditions. Besides, the wireless SLAM is cost effective because the antennas are cheap and existing wireless infrastructures can be leveraged.
In the literature, various wireless SLAM methods have been discussed. For example, in [3], the authors proposed Channel-SLAM, which considers both scattering and reflection effects of multipath components (MPCs). A range-only SLAM method using time of arrival (TOA) was designed in [4]. However, the performance of aforementioned SLAM systems highly depends on the quality of MPCs. If the MPC amplitude is not strong enough compared to the noise, the estimated TOA and angle of arrival (AOA) of this MPC will have significant errors, leading to a lower SLAM accuracy [5].
Fortunately, the reconfigurable intelligent surface (RIS) has been proposed as a promising tool to control the wireless environment, which can be used to address this issue [6], [7]. An RIS is a type of plane material consisting of many homogeneous elements, which can be coated on the surface of walls or ceilings. The RIS has the capability to shape radio waves impinging upon the surface by changing the phase shift of each element. In this way, the indoor propagation environment can be customized according to the requirements of SLAM systems, and thus, the accuracy can be improved.
In this paper, we consider a SLAM system assisted by the RIS. While the agent moves in the room, it transmits signals and receives signals carrying information of the surrounding environment at the same time, and the RIS enhances the strengths of received signals to reduce the impact of noise. New challenges have arisen in the RIS-assisted SLAM system. The first challenge lies in the way of collaboration between the RIS and the mobile agent. Secondly, due to the heavy impact of the selection of phase shifts on the localization and mapping algorithm, it is challenging to select phase shift of the RIS that can significantly improve the performance of wireless SLAM system from enormous number of possible phase shifts.
In response to the above challenges, we propose an RISassisted SLAM protocol to coordinate RIS and the mobile agent, and formulate an optimization problem aiming at minimizing the agent positioning error. The optimization problem is solved by an error minimization algorithm, which consists of two sequential phases: phase shift optimization phase and localization and mapping estimation (LME) function optimization phase. The phase shift is optimized by an iterative optimization approach, and LME function is optimized by adjusting the weight of MPCs according to the amplitudes of the received signals optimized in the previous phase. Simulation results show that the positioning error can be reduced by at least 31% using the proposed scheme.
The rest of the paper is organized as follows. In Sec. II, we provide the indoor SLAM scenario and the received signal model. An RIS-aided SLAM protocol is proposed in Sec. III. In Sec. IV, an optimization problem aiming at improving the SLAM performance is proposed, and an error minimization algorithm to efficiently solve the formulated problem is designed. In Sec. V, we present the simulation results and discussions. Finally, conclusions are drawn in Sec. VI.

II. SYSTEM MODEL
In this section, we first introduce the indoor SLAM scenario, and then provide the received signal model.

A. Indoor SLAM Scenario
As shown in Fig. 1, we consider an indoor SLAM scenario consisting of an RIS on the ceiling, an RIS controller, several obstacles, and a mobile agent equipped with a controller, a single-antenna transmitter (Tx) and a multiple-antenna receiver (Rx). As the agent moves in the room, it will transmit signals and analyze the received signals in order to locate itself and map the surrounding environment at the same time.
Specifically, to obtain its location and the map information, the agent first communicates with the RIS controller to adjust the RIS phase shifts. Next, the agent simultaneously emits signals to the environment and records the received signals. The received signals contain MPCs produced by the reflection and scattering of the obstacles and the RIS. The location of the mobile agent and environment information can be extracted from these MPCs. In addition, by leveraging the ability of the RIS to adjust wireless channels, the power of MPCs via the RIS can be strengthened, bringing better SLAM performance.

B. Received Signal Model
Assume that the Rx is equipped with L antennas, and the signal s(t) emitted by the Tx reaches the Rx via P (t) multipath channels. Thus, the signals received by the l-th Rx antenna at time t can be written as [8] where h i,l (t, τ ) denotes the channel impulse response (CIR) of the i-th multipath channel, and n(t) denotes white circular symmetric normal distributed receiver noise with variance σ 2 n . In the following, we model the impulse response of channels via the obstacles and RIS. Two types of obstacles are considered, i.e. reflectors and scatters [3]. Let R and S denote the sets of all the reflectors and scatterers, respectively. The reflectors are smooth surfaces like walls where the incident signals change the propagation direction following the reflection law. As illustrated in Fig.2 (a), channel 1 is the signal path from the Tx to the Rx via reflector R 1 , and the incident angle θ i is equal to the reflection angle θ r . The CIR of channel 1 from Tx antenna to the l-th Rx antenna can be expressed as [8]: where G is the antenna gain, λ is the wavelength of the signal, φ 1 (t) denotes the AOA, b l (φ 1 (t)) is the response of the l-th receiving antenna with regard to the phase center, R is the reflection coefficient of R 1 , d 1 is the propagation length of channel 1, and δ(τ ) denotes the delta function. Note that this CIR is equivalent to the CIR from the virtual transmitter (VT), which is the mirror image of the TX. Different from the reflectors, the scatters are small objects that will radiate the energy of incident signals in all directions. As shown in Fig. 2(a), channel 2 is the signal path from the Tx to the Rx via scatterer S 1 , and its CIR from Tx antenna to the l-th Rx antenna can be expressed as is [8] where σ 1 is the radar cross-section of the scatterer S 1 , d T,S1 is the distance between Tx and scatterer S 1 , d S1,R is the distance between S 1 and Rx, and d 2 = d T,S1 +d S1,R is the propagation length of channel 2. Besides, channel 3 is the propagation path from Tx to the Rx via scatterer S 1 and reflector R 1 , and its CIR can be calculated based on (2) and (3). Similar to the MPC via channel 1, the MPC via channel 3 can be treated as being transmitted by a virtual scatterer (VS) with an additional delay d T,S1 introduced by the additional path [3]. The VS is also the mirror image of physical scatterer(PS) S 1 with the additional path same to channel 2. Similar to the definition of PS and VS, we can define RIS and VRIS. Since the locations of PS, VS, RIS and VRIS are fixed, they can be viewed as landmarks for localization and mapping, which will be introduced in Sec.

IV.
As for RIS, suppose it is composed of N × M elements. channel (n, m) in Fig. 2(b) is the multipath channel from the Tx to the l-th Rx antenna via the element in row n and column m, and its gain can be written as [9]: α n,m,l = λ GGRF (θ t n,m , φ t n,m )F (θ r n,m,l , φ r n,m,l )dxdy 8π 3/2 r t n,m r r n,m,l × e −j2π(r t n,m +r r n,m,l ) λ where G R denotes the RIS element gain, F (θ, φ) denotes the radiation pattern of RIS in direction (θ, φ). (θ t n,m , φ t n,m ) and (θ r n,m,l , φ r n,m,l ) denote the directions from the RIS to the Tx and the Rx, respectively. d x and d y are width and length of an RIS element, respectively. A is the reflection coefficient of the RIS element, and ξ n,m is the phase shift caused by the reflection of the (n, m)-th element. We assume that each element has H possible phase shifts with uniform interval ∆θ = 2π/H. Thus, we have ξ n,m = h n,m ∆θ, where h n,m ∈ {1, 2, ..., H}. r t n,m and r r n,m,l denote the distances from the (n, m)-th element to the Tx and the l-th antenna of Rx, respectively.
As the MPCs from the Tx to the Rx via different RIS elements will overlap at the Rx 1 , the N ×M channels from Tx to the Rx via N ×M elements can be substituted by channel 4 in Fig. 2. By applying the far-field model 2 , we have proved in Appendix A that the CIR of channel 4 is given by where (θ t , φ t ) and (θ r , φ r ) denote the directions from the RIS center to the Tx and Rx, respectively. d T,RIS and d RIS,R are the distances from RIS center to Tx and Rx, respectively. d 3 = d T,RIS + d RIS,R is the propagation length of channel 3. z n,m denotes the position of the (n, m)-th element. z t and z r denote unit vectors in directions (θ t , φ t ) and (θ r , φ r ), respectively.

III. RIS ASSISTED SLAM PROTOCOL
In this section, we propose an RIS assisted SLAM protocol, where the RIS and the agent are coordinated to improve the SLAM performance. The process of the positioning protocol is illustrated in Fig. 3. We divide the timeline into cycles with duration δ. In each cycle, the optimization, communication, measurement acquisition, localization and mapping steps are conducted sequentially.
Optimization: In the first δ O seconds of the k-th cycle, the agent selects the optimal phase shifts Ξ k = 1 The maximum delay of MPCs from the Tx to the Rx via different RIS elements can be approximated by D/c, where D is the size of the RIS. In this paper, we use an RIS with 6 × 6 elements and working frequency at 10GHz, and the maximum delay is about 0.3ns. Since the accuracy of mainstream devices is 0.5ns [10], the MPCs via different elements are indistinguishable at the Rx. 2 The far-field region of an RIS is d > 2D 2 /λ [9], where d is the distance between the Tx/Rx and the RIS center. For the RIS used in this paper, its farfield region is d > 0.54m. Since the RIS is on the ceiling and the agent is moving on the ground, the Tx and Rx are always in the farfield of the RIS. Communication: In the next δ C seconds, the agent transmits a signal carrying the information of Ξ k to the RIS controller, and the phase shifts of RIS will be set as Ξ k .
Measurement Acquisition: After the RIS phase shifts are adjusted, the agent transmits signal s(t) for SLAM, and the Rx records the received signal y k (t) at the same time.
Localization and Mapping: In this step, the location of the agent p k a , the velocity v k a , and the map M k are estimated using received signal y k (t), map M k−1 , the position of the agent p k−1 a , the velocity v k−1 a , and the optimal f k .

IV. LOCALIZATION ERROR MINIMIZATION
In this section, we first formulate the optimization problem aiming at minimizing the agent position error, then propose an error minimization algorithm to solve the formulated problem.

A. Problem Formulation
The objective of the optimization problem in each cycle is to minimize the agent localization error. Let p k a andp k a denote the real and estimated agent location in the k-th cycle, respectively, the optimization problem can be formulated as Notice that Ξ k and f k are heavily coupled, so it is hard to jointly optimize them. As a result, we decompose (6a) into two sub-problems by separating the optimization of Ξ k and f k . These two sub-problems are described as follows: Phase shift optimization: Given f k , the optimization subproblem for Ξ k can be given by LME function optimization: Given a phase shift vector, the optimization sub-problem of f k can be expressed by Since the real location of the agent is unknown, it is difficult to directly optimize RIS phase shifts with the positioning error (7a) as the optimization objective. Alternatively, for the optimization of RIS phase shifts, we use Cramer-Rao lower bound (CRLB) to approximate the positioning error, which is widely used in assessing the performance of the a SLAM system [11]. Suppose that the variable to be estimated is denoted by ι, andι denotes the estimation of ι, the CRLB can be expressed as CRLB(ι) = J −1 (ι), where J (·) is the Fisher information matrix (FIM) [11]. The optimization of Ξ k is discussed in detail in Sec. IV-B1. For the optimization of f k , we adjust the parameters of it according to the amplitude of the received signals to minimize the agent positioning error. Detailed optimization method of f k can be found in Sec. IV-B2.

B. Algorithm Design
An error minimization algorithm is proposed to solve the formulated problem in the k-th cycle. The algorithm contains two phases, i.e., the phase shift and LME function optimization phases, where Ξ k and f k are optimized sequentially.
1) Phase Shift Optimization Phase: As mentioned above, the objective of phase shift optimization is turned into the minimization of CRLB, so the phase shifts optimization problem in the k-th cycle can be expressed as: ) T ] T , where real(α k ) and imag(α k ) denote the real part and the imaginary part of the vector of channel gain α k , respectively. (·) [1:2]×[1:2] denotes the submatrix which consists of the first two rows and columns of the original matrix. Since the position of the agent p k a = (r k x , r k y ) is two-dimensional, where r k x and r k y denote the x and y coordinates of the position of the agent, respectively, the objective function (9a) represents the sum of CRLB of variables r k x and r k y . The expression of the objective function (9a) is given by the following proposition: Proposition 1: The objective (9a) can be expressed as: where ζ 2 is the effective bandwidth of s(t) [11]. ν k i and κ k i are parameters related to the i-th channel. Specifically, assume that there are N i obstacles (or RIS) in the propagation channel, which divide the i-th channel into N i + 1 segments, ν k i = yj/ x 2 j + y 2 j + z 2 j , where (x j , y j , z j ) denotes the direction vector of the j-th segment.
Proof: See Appendix B. As the CRLB is non-convex, we design an optimization algorithm based on genetic algorithm (GA) to minimize CRLB, which is referred to as CRLB-GA. At the beginning, we randomly choose K phase shift vectors to form the population set P, which is denoted by P = {Ξ 1 , ...Ξ K }. A phase shift vector Ξ = [ξ 1 , ...ξ N ×M ] in P is referred to as an individual, and an element ξ i in Ξ is called a gene. Next, we iteratively update the individuals in the population. Specifically, the algorithm contains C A iterations, and the following three steps are executed sequentially in each iteration.
Selection: We first calculate the adaptability of each individual in set P, and the adaptability of the j-th individual can be expressed as Next, Q individuals with the highest adaptability will be selected as elite individuals, denoted by P e , and they will be preserved for the next cycle.
Gene cross: In this step, we first choose two individuals as parents from P, and the probability of choosing the jth individual is is proportional to its adaptability. Then, we randomly choose a number i ∈ [1, M N ], and the genes from i to M N in the chosen parents are exchanged to generate two new individuals, which are referred to as the child individuals. This step will be repeated for (K − Q)/2 times, and the generated K − Q child individuals are denoted by C.
Gene mutation: For each child in set C, its genes will mutate at a low probability. Specifically, each gene of a child may change to h∆θ, h ∈ {1, ...H} at probability p m . After that, the set P e and C will merge to generate the new population set P.
2) LME Function Optimization Phase: The localization and mapping function f k consists of two steps, i.e. the data association step and the position and map estimation step. In the first step, we link MPCs received by the Rx with PT, VT, PS, RIS, VS, or VRIS. In the next step, we design a particle filter based method to update the location of agent and the map, and the particle filter based method is optimized based on Ξ k to promote its performance.
Data Association: First, we use a three-layer full-connected neural network to eliminate MPCs related to PT and VTs, this is because both PT and VTs are moving during the SLAM process, which cannot be utilized to locate the agent [12].
Next, the MPCs are divided into L groups based on their AOAs, and each cluster is corresponding to a PS, VS, RIS, or VRIS. The VS (or VRIS) can be associated to PS (or RIS) using the geometry method in [13]. Here, the RIS (or VRIS) is treated as an ordinary PS (or VS). Besides, each group will be associated to a landmark based on the TOA and AOA [13].
Finally, we decide which landmark is the RIS, which is necessary for the phase shift vector optimization phase. Let p k i,RIS denote the probability that the i-th landmark is RIS in the k-th cycle. Based on Bayes updating, we have where α k denotes the amplitudes of MPCs extracted from the received signal y k , p(α k |L i is RIS) denotes the probability to receive α k if the i-th landmark is RIS. When k = 1, we set p 1 i,RIS = 1/L, ∀i. The landmark whose p k i,RIS is the biggest will be regarded as the RIS in the k-th cycle.
Position and Map Estimation: The position and map estimation algorithm is based on the particle filter method [3]. The basic idea of particle filter is to use a set of weighted particles to represent the probability distribution of the locations of the agent and landmarks, and update the weights of particles based on the received signals. To update the weights of particles, we need to first extract TOAs τ and AOAs φ from MPCs obtained during measurement acquisition. Since MPCs with different amplitudes α have different estimation errors of TOAs τ and AOA φ [5], we will optimize the weights of these MPCs in the particle filter to reduce the positioning errors and improve the algorithm performance.
The particle filter consists of N ap agent particles. Each agent particle represents a possible pose of the agent and has multiple landmark particle sets. The l-th landmark particle set of the i-th agent particle contains N lp,i,l particles. Each particle represents a possible position of the landmark. In the following, we show how the position and map estimation algorithm update the weights of the particles: • Agent particle transition: In this step, the pose r k a = [p k a , v k a ] is updated using the discrete time white noise acceleration model proposed in [3].
• MPC weight calculation: Assuming that N M P C MPCs are received in the temporal cycle, and the average amplitude for these MPCs is denoted by α ave , the weight ρ i for the i-th MPC can be calculated by ρ i = α i /α ave .
• Weight update of landmark particles: Assuming that the j-th landmark of the i-th agent particle associates with the MPC set V, the landmark particle weights can be updated by where MPC n denotes the n-th MPC,φ k andτ k are the AOA and TOA calculated using the position of the m-th landmark particle and the i-th agent position, σ φ and σ τ denote the corresponding variances.
• Weight update of agent particles: The weight of the i-th agent particle w k i is updated by the weights of its landmark particles, which can be written as follows [3]: where N L,i is the number of landmarks of the i-th agent particle.
• Normalize and resample: For all the agent and landmark particles, their weights are normalized. Then, the sets of landmark and agent particles are resampled to discard particles with weights close to 0. The resample rate of a particle is proportional to its weight. Algorithm 1 LME function for cycle k Input: measurement z k , map M k−1 , the pose of agent r k−1 a , landmark set L k−1 Output: Map M k , the pose of agent r k a ,landmark set L k 1: Associate each measurement z k with a landmark in L k−1 . 2: Update the pose r k a of agent particles. 3: Calculate the weights ρ for all MPCs. 4: Set the weight w k i,j,m of all landmark particles using (13). 5: Set the weight w k i of all the agent particles using (14). 6: Normalize w k i,j,m , w k i and resample all particles. 7: Calculate r k a and L k by weighted summation of agent particles and landmark particles. 8: Build map M k using updated L k • Agent and landmark update: The pose of the agent in the temporal cycle r k a can be obtained by the weighted sum of all the agent particles, and the positions of landmarks L k is calculated by weighted sum landmark particles, respectively.
• Map building: The map contains information about positions of reflectors, scatterers and the RIS. The positions of RIS and scatters in the map can be directly obtained from L k . As for the location of reflectors, the geometry method proposed in [13] can be used.
The LME function is summarized in Algorithm 1.

V. SIMULATION RESULTS
In this section, we present the performance of the proposed SLAM system. The layout of the indoor SLAM scenario is shown in Fig. 1. The size of the room is 6m×6m×3m. The RIS is on the plane z = 3, and its center is at (3, 3, 3)m. A scatterer is positioned at (2,1,1)m. The reflection coefficient of the reflectors is set to 0.85 and the scatterer is a sphere whose radius is 5cm. The agent starts from (0, 0, 0)m with velocity v =(0.0707, 0.0707, 0)m/s. The distance between antennas Tx and Rx on the agent is 0.1m, and Tx transmits signal with frequency f c =10 GHz. The RIS is composed of 36 elements, and the element separation is 0.015m. Each element has 4 possible phase shifts with ideal amplitude ratio, i.e. r=1. The agent moves for 600 cycles, and each cycle takes 0.1s. The number of particles for agent is 2000, the number of particles for each landmark is 6000. Fig. 4(a) shows the gains of channels α via RIS with optimized phase shifts, random phase shifts, and a scatterer versus the distance between them and the agent. The scatterer is a sphere equal to the size of the RIS, and is also placed at (3, 3, 3)m. We can observe that the gain of channel via the RIS with optimized phase shifts is significantly larger than those of channels via the RIS with random phase shifts and the scatterer. This indicates that after optimizing the phase shifts of the RIS, the strengths of multipaths via the RIS can be significantly enhanced to improve the SLAM performance. Fig. 4(b) shows the positioning root mean square error (RMSE) ε of the agent versus the signal to noise ratio (SNR). The SNR can be calculated by SNR = ||Y (t)|| 2 LU σ 2 n , where Y (t) . We can find that under different SNRs, the agent position RMSEs of all other three schemes are larger comparing to RIS with optimized phase shifts scheme, which means RIS enhanced the performance of the SLAM system. Fig. 4(c) illustrates the positioning RMSE ε of the agent and the RIS versus the size of RIS. It can be observed that with the size of RIS goes up, the MMSE of agent decreases, showing that larger RIS can better enhance the performance of SLAM system.

VI. CONCLUSION
In this paper, we have designed an RIS-assisted wireless indoor SLAM system. We have proposed channel models of the wireless environment containing RIS. We have introduced and an RIS-aided SLAM protocol to coordinate RIS and the agent. Based on the protocol, we formulated the optimization problem for SLAM. To solve the optimization problem, we have designed a particle filter based localization and mapping algorithm. It can be concluded from the simulation results that the RIS can significantly enhance the amplitude of channels comparing to scatters. Moreover, the RIS assisted SLAM system can reduce the estimation error of the agent by 0.1m comparing to the non-RIS wireless SLAM system.