RSS-based Cooperative Localization and Orientation Estimation Exploiting Directive Antenna Patterns

In this paper, we propose a factor-graph-based cooperative positioning algorithm that uses RSS radio measurements and accounts for the directivity of the antennas. This is achieved by modeling the directivity with a parametric antenna pattern and jointly estimating position and orientation of the agents. We propose two different approaches whereas the first one uses a continuous representation of the orientation state and the second one a discrete representation. We validate our proposed methods with simulations and measurements in a static sensor network with more than 900 agents in an indoor environment and show that the positioning accuracy can be improved significantly by considering the influence of orientations.


I. INTRODUCTION
For the Internet-of-things (IoT), location awareness is a key aspect for various applications [1], [2]. One example are large, static networks, which are gaining importance in logistics, industry and retailing [3], [4]. They are used to label and identify goods and can be utilized to find packages, tools or products of interest. Conventionally, the positions of these objects have to be added to a database manually, which is highly inefficient. This problem can be avoided by using a technology that allows to infer the positions of the objects using measurements to base stations with known positions (anchors) and measurements in-between the objects (agents) in the network, employing cooperative localization algorithms [2], [5]- [9]. Cooperative localization leads to an improvement of positioning accuracy while preventing the use of a highdensity anchor deployment as needed for non-cooperative localization [5], [10], [11]. Many localization systems in IoT scenarios use time-of-arrival (ToA) [8], [12], angle-of-arrival (AoA) [13], [14] or received signal strength (RSS) measurements [15], [16]. ToA-based and AoA-based methods have often a higher localization accuracy compared to RSS-based methods [17]. However, they require exact synchronization [12], [18] or coherent processing [11], [19], which can only be achieved with expensive equipment. In spite of the high localization performance, for real applications, cost efficiency is one of the key aspects for a technology to be widely used. Therefore RSS measurements are an obvious choice for low-cost sensors with limited power supply. Based on the RSS, one can get an estimate of the distance between the sensors, which can be used to infer the positions of the agents [20]. However, in indoor environments characterized by severe multipath fading, only a low positioning accuracy is achieved, with a large number of outliers, due to the high uncertainty of the measurement data. Furthermore, obstructed line-of-sight (OLOS) results in large fluctuations of the pathloss exponent. The RSS model is very sensitive to these fluctuations leading to large ranging errors. To overcome these impairments, much effort is put into the development of robust RSS-based localization methods.

A. State of the Art and Related Work
An important aspect of RSS-based localization is the difference between non-model-based and model-based approaches, which have various advantages and disadvantages. Non-modelbased approaches are for example fingerprinting [21], [22] and machine learning [23]- [25]. Fingerprinting consist of an offline training phase and an online localization phase. In the training phase, measurements are acquired at known positions and stored in a database. Localization is performed by comparing measurements to labeled measurements stored in the database. The main disadvantages of non-model-based approaches are the requirement of a large number of labeled measurements, collected in time-consuming measurement campaigns, and that the database can only be used for the according environment, i.e., the trained model based on the database does not generalize to other environments [26]. The same is true for machine learning based approaches. However, their main advantages are that they generalize to arbitrary models and that their feed-forward execution has rather low computational complexity, in comparison to fingerprinting and also to model-based approaches.
Model-based approaches do not require training data and they are more or less independent of the surrounding environment as long as the chosen model agrees well with the measured data. There exists a variety of different modelbased approaches for RSS-based localization. In [27], [28] an algorithm has been introduced that utilizes an antenna array with known orientation and antenna pattern to measure the RSS differences, allowing to exploit the AoA non coherently. Another example are ranging methods [20], [29], which use a path-loss model to estimate the distance in-between the involved nodes. Methods that include the possibility to receive OLOS measurements in the modelling process can counteract the degradation due to multipath and path-loss variations [30], [31]. A different approach for achieving a more robust RSSbased localization takes additional effects like the radiation pattern of the antennas into account [32]- [34].
For large sensor networks with multiple measurements inbetween the sensors, cooperative localization is a common approach for estimating the states of static and mobile agents. A requirement for cooperative localization is that agents can interact with each other and exchange information about their state. This can be achieved in a distributed or centralized manner [7], [8]. Theoretical performance limits for cooperative localization can be found in [11], [35], [36] based on the equivalent Fisher information. When dealing with large networks, full cooperation is sometimes not wanted, due to resource limitations with regard to energy consumption, measurement time, and computational power. In these cases, selecting highly informative cooperating partners can be essential since at some point increasing the set of cooperating partners does not increase the positioning performance any more [11], [37], [38]. For range-based CL, there exists a variety of different approaches like convex optimization [20] or a fully Bayesian treatment of the problem as in [8], [39]- [43]. In [44], the authors use only angular information based on coherent antenna array processing for cooperative localization. To estimate the states of the agents in a Bayesian framework, factorization of the joint agent states probability density function (PDF) is essential to reduce the complexity. A common approach for visualizing the factorization is by using a factor graph [45], [46]. Based on the factor graph representation of the problem, one can use message passing algorithms like parametric or nonparametric belief propagation to iteratively estimate the states of the agents [8], [39], [44], [47]. Cooperative localization algorithms that use RSS measurements and are based on message passing are given in [48], [49]. Taking into account additional information like the radiation pattern of the antennas in the modeling process and in the message passing scheme, and therefore extending a range-based cooperative localization algorithm, is a logical step in the search for robust RSS-based localization.

B. Contributions
In this paper, we develop a Bayesian message passing algorithm for cooperative localization based on a factor graph that includes the directivity of the antennas to exploit AoA information in a non-coherent way. We propose two different methods for estimating position and orientation of the agents in a Bayesian framework. The first method estimates the position and the orientation in a continuous parameter space, using a particle-based representation of the states [50], [51]. The second one uses a discrete parameter space for the orientations and continuous parameter space for the positions. We develop a factor graph representation for both methods. The estimation of positions and orientations is based on the marginal posterior PDFs of the states, which are calculated using belief propagation. We validate our proposed methods with simulations and real RSS measurements for more than 900 agents in an indoor environment and show that the positioning accuracy can be improved significantly by considering the influence of orientations. To the best of our knowledge, the use of angle information by utilizing directive antennas has not been investigated for cooperative localization. The advantage of this approach is that we have a more realistic model for the RSS measurements. However the disadvantage compared to the standard path-loss model is that the antenna pattern has to be known or estimated and the orientation of the nodes has to be estimated as well for the antenna pattern to be useful. The key contributions of this paper are as follows.
• We develop a Bayesian message passing algorithm based on a factor graph for joint cooperative position and orientation estimation.
• We compare the inference models for a continuous and a discrete representation of the orientation state.
• We use a parametric antenna pattern and estimate model order and parameters based on the measurements.
• We give a comprehensive analysis of the presented algorithms using synthetic and measured data. We would like to highlight that the focus of this paper is on static networks, however, it is straightforward to extend the proposed algorithms to a dynamic scenario as shown in [8]. We organize the remainder of this paper as follows. In Section II, we state the system model and introduce the measurement model. The difference between the continuous and the discrete representations of the orientation state as well as the likelihood function is explained in Section III. In Section IV we give an introduction on belief propagation and develop the proposed algorithms. The results of numerical experiments and measurements are reported in Sections V and VI, where we also explain how we determine the antenna pattern. Section VII concludes the paper.

II. SYSTEM MODEL
We consider a set of static cooperating agents C with unknown positions and orientations (|C| is the number of agents) and a set of anchors A with known positions and orientations (|A| is the number of anchors). For this we define two types of measurements: (i) measurements between anchors and agentsz a,i with a ∈ A and i ∈ C and (ii) measurements in-between agents z i,j with i ∈ C and j ∈ D i with D i ⊆ C being the set of agents that cooperate with agent i. The stacked vector of all anchor measurements is written asz = [z 1,1z1,2 . . .z 1,|C|z2,1 . . .z |A|,|C| ] T which can also be written asz = [z a,i ] a∈A,i∈C . The stacked vector of all measurements in-between agents is given as z = [z i,j ] i∈C,j∈D i . Each node (agent or anchor) has a fixed position and orientation and a known antenna pattern (which does not vary with time). We assume that the antenna patterns of the nodes are all identical.

A. Agent State Model
The state of the ith agent, denoted θ i ∈ R 3×1 is defined as θ i = [x i ϕ i ] T and consists of its position x i = [x i y i ] and the orientation ϕ i . Note that the anchor state is defined in the same way, however, it is assumed to be known. The vectors θ and z denote the stacked vectors of all agent and anchor states and all measurements (between agents and anchors and agents and agents) respectively, where θ = [θ 1 . . . θ |C| , θ |C|+1 . . . θ |C|+|A| ] T and z = [z T z T ] T . The joint posterior PDF is given as with the joint likelihood f (z|θ) and the prior of all agent and anchor states f (θ).

B. Measurement Model
We use RSS measurements to infer position and orientation of the agents. For that purpose, we model the RSS as a combination of the distance-depending path-loss and the influence of the orientation of the agents which have performed the measurements. The measurement between two nodes i and j is conditioned on the measurement model M . In general the measurement model is a discrete random variable, taking values of model indices k = {1, 2, . . . , N M }. The members of the set are indicating different models with N M being the number of models. In this section, we assume that the model M = k as well as the model parameters are known. Different models are discussed in Section VI-B. The measurement conditioned on the model index k has the form of with the distance-depending path-loss L k , the resulting change of the RSS in dependency of the orientation of the agents Ψ k and a noise term that is assumed to be Gaussian distributed as n i,j ∼ N (0, σ 2 k ). We make the common assumption that interfering multipath components, which lead to fading, as well as shadowing are only described by the noise term [52, Section 3.9.2]. The distance-depending path-loss in dB is given as where n k and P k are the path-loss exponent and the reference path-loss at distance d 0 of model k respectively [5]. The distance between the nodes is given as where · indicates the Euclidean norm. The resulting change of the measured signal strength, which depends only on the orientation of two agents, can be written as the sum of the two antenna patterns evaluated at the corresponding angles φ i,j and φ j,i as where φ i,j is the angle between agent i and agent j with respect to the orientation ϕ i of agent i and φ j,i is the angle in-between agent j and agent i with respect to the orientation ϕ j of agent j. The generic model of an antenna pattern is indicated asΨ k (ξ k , φ). The graphical representation of a measurement in-between two agents can be seen in Fig. 1. The model parameters of the antenna patternΨ k are stacked in the vector ξ k = [ξ k,1 , . . . , ξ k,N k ] T with N k being the number of parameters of the kth antenna pattern. We define the angle between two nodes as The used antenna patterns are introduced in Sections V and VI.

III. INFERENCE MODELS
In this section we introduce two different inference models to estimate position and orientation of the agents based on their marginal PDFs. The first one is referred to as "continuous inference model" since it uses a continuous representation for the agent positions and orientations. The second inference model is called "discrete inference model", where the only difference to the continuous inference model is that the orientation estimation is performed with a set of discrete orientations instead of a continuous parameter space.
Since we are estimating position and orientation based on the marginal posterior PDF of each agent state, we define at this point the not-integrate and not-sum notations as mentioned in [45]. Instead of indicating which variables are marginalized over, we define the ones over which we do not sum or integrate. For example if h(·) is a function that depends on the continuous variables θ 1 , θ 2 and θ 3 and g(·) is a function that depend on the discrete variables Φ 1 , Φ 2 and Φ 3 , the notintegrate and not-sum for θ 3 and Φ 3 are defined as where O is the domain of Φ i .

A. Continuous inference model
For the continuous inference model, we factorize the joint posterior PDF in (1) as since the measurements between nodes are independent of each other. The factorization consists of the prior PDF f (θ i ) of agent state i, the likelihood function f (z a,i |θ i ; θ a ) which is a function of ith agent state and parametrized by the ath anchor state (which is known) and the "cooperation" likelihood function f (z i,j |θ i , θ j ) which is a function of the ith agent state and jth agent state with i = j. Since the states of the anchors are exactly known and independent of all other states, we can rewrite (7) as where f (θ i |z) is the marginal posterior PDF of the ith agent state given all anchor measurements. In the Section IV the factor graph representation of this equation will be described.
With the help of the not-integrate notation in (5), the marginal posterior PDF of state θ i is given by where dθ ∼i denotes the marginalization of all states θ except θ i .

B. Discrete inference model
For the discrete inference model, we have a continuous state of the ith agent, denoted x i ∈ R 2×1 , which consists of its position The probabilities for the discrete orientations of agent i are indicated by a probability mass function (PMF) as p(Φ i ). The joint posterior PDF is given as with x = [x i ] i∈C and Φ = [Φ i ] i∈C being the stacked vector of all position states and discrete orientation states, respectively. The joint posterior PDF factorizes into which consists of the prior PDF of the position states, the prior PMF of the orientation states as well as the likelihood functions regarding measurements to anchors and to cooperating agents. We want to mention that for the discrete inference model, we evaluate the likelihood for every possible combination of orientations between agent i and agent j out of the set of discrete orientations O. Given the definitions in (5) and (6), the marginal posterior PDF of agent i can then be written as where Φ ∼i and dx ∼i denote the marginalization of all states except of Φ i and x i , respectively.

C. Likelihood
We define the model parameter vector for measurement model k as ϑ k = [P k , n k , ξ T k , σ k ] T that consists of the reference path-loss P k at distance d 0 , the path-loss exponent n k , the model parameters of the antenna pattern ξ k and the shadowing standard deviation σ k . For a Gaussian noise model given in (2), the likelihood function can be written in the form of and Note that model k as well as the parameters ϑ k are assumed to be known which results in a likelihood function that depends only on the states of the nodes The different models as well as the estimation of the parameters are discussed in Section VI-B.

IV. MESSAGE PASSING ALGORITHMS
In a Bayesian framework, we estimate position and orientation of each agent based on the marginal posterior PDFs. Since a straightforward computation of the marginal posterior PDFs (9) and (12) is infeasible, we perform message passing by means of the sum-product-algorithm rules on the factor graph that represents our statistical model. This so called "belief propagation" yields approximations ("beliefs") of the marginal posterior PDF in an efficient way [45], [46]. It gives the exact marginal PDF for a tree like graph but provides only an approximate marginalization if the underlying factor graph has cycles [45]. In this case, the belief propagation scheme becomes iterative and there exist different orders in which the messages can be calculated. We have chosen that in each iteration, the beliefs of all agents i ∈ C are updated in parallel. In the following section, we derive the belief propagation message passing scheme for the continuous and the discrete inference models based on the factor graphs in Fig. 2.

A. Belief propagation for continuous model
Based on the factor graph for the continuous inference model given in Fig. 2a, we define the message passing scheme to approximate the marginal posterior PDFs. For a better readability, we use the following short hand notation: The factor f ij f (z i,j |θ i , θ j ) represents the likelihood function with respect to the involved agents i and j whereas f i f (θ i ) a∈A f (z a,i |θ i ; θ a ) represent prior information of the ith agent state and information from the anchor measurements. Additionally, we define µ θ i →f ij as the message from variable node θ i to factor node f ij , µ f ji →θ i as the message from factor node f ji to variable node θ i and µ f i →θ i as the message from factor node f i to variable node θ i . The belief of the state of agent i is written as m(θ i ) and is calculated by multiplying all the incoming messages at variable node θ i like which are determined by marginalizing out all involved states except the state represented by the variable node of interest.
Since the factor graph has loops, a direct evaluation of (15) is not possible. Therefore we have to use an iterative message passing scheme where the belief of the state of agent i at message passing iteration u ∈ {1, . . . , U } is given by using the beliefs of the agents j ∈ D i from the previous itera- For the purpose of implementation, we can define the belief after incorporating the anchor measurements of the ith agent state as since the states of the anchors have no dependency on other variables and are exactly known. With this definition (16) can be written as which leads to the same form as in (15). We use a particlebased implementation [8] to approximate the calculations in (18) where the proposal densities for agent i and agent j at message passing iteration u areb (0) (θ i ) and b (u−1) (θ j ) respectively. Usingb (0) (θ i ) in the particle-based implementation has the benefit that the particles are more condensed in the region of interest due to resampling after information from measurements to anchors is included. The estimation of the ith agent position and orientation is based on their marginal posterior PDF f (θ i |z) and is determined by the according minimum mean-square error (MMSE) estimator [53], i.e., where the agent marginal posterior PDF f (θ i |z) is approximated up to a normalization constant by the belief b (U ) (θ i ). This algorithm is an expansion of the sum-product algorithm for a wireless network (SPAWN) introduced in [7] for static networks. In contrast to the traditional SPAWN, the orientation is included in the state representation.
B. Belief Propagation for discrete model Based on the factor graph for the discrete inference model given in Fig. 2b, we define the message passing scheme to approximate the marginal posterior PDFs. The difference to the case with continuous orientations is that we separate variable node θ i into two variable nodes x i and Φ i . Those variable nodes have no direct dependency but influence each other via connecting factors. The orientation variable node Φ i represents a discrete random variable which can take values of the finite set O = {φ 1 ,φ 2 , . . . ,φ N O } with the number of discrete orientations given as N O . The belief of the different states, which approximates the marginal posterior PDF, can be computed by multiplying all incoming messages at the different variable nodes respectively. For a better readability, we use the following short hand notation: The factor represents the likelihood function with respect to the involved agent pair whereas factors x a , Φ a )dx i represent prior information of the ith agent state and information from the anchor measurements. Additionally, we define µ x i →f ij as the message from variable node x i to factor node f ij , µ f ji →x i as the message from factor node f ji to variable node x i , µ Φ i →f ij as the message from variable node Φ i to factor node f ij and µ f ji →Φ i as the message from factor node f ji to variable node Φ i . The belief of variable node x i is given 20) and the belief of variable node Φ i as by multiplying all incoming messages at the variable nodes respectively, which again are determined by marginalizing out all involved states except the state represented by the variable node of interest. Since the factor graph has loops, we can not calculate the messages at once but we have to approximate them iteratively. The approximate belief of the states x i and Φ i at message passing iteration u can be written as and with b (u) (Φ i ) being a PMF with N O entries. The initial beliefs b (0) (x i ) and b (0) (Φ i ) are proportional to the prior PDF f (x i ) and to the prior PMF p(Φ i ), respectively. As in the previous section, we define a belief for x i and Φ i after incorporating the anchor measurements as since the states of the anchors have no dependency on other variables and are exactly known. With this definition, (22) and (23) can be written as The beliefs in (26) and (27) provide insights about the choice of proposal densities to efficiently represent regions of posterior PDF with high density. It can be also observed how the belief of the orientation state of the previous iteration influences the belief of the position state and vice versa. Since we have a mixture of discrete and continuous probabilities, the marginalization to obtain the messages is performed by integrating over the continuous state x j and the summation over the discrete state Φ j . The estimation of the ith agent position and orientation 1 is performed by their marginal PDF f (x i |z) and marginal PMF p(Φ i =φ j |z), respectively, and determined by the according MMSE estimators, i.e., where the agent marginal posterior PDF f (x i |z) and PMF p(Φ i =φ j |z) are approximated up to normalization constants by the beliefs b (U ) (x i ) and b (U ) (Φ i ), respectively.
V. EVALUATION OF ALGORITHMS In this section, we study the performance of the two proposed methods based on simulations in a static 2D scenario. In addition, we compare it to the case where the orientation of the agents is known and to the classical SPAWN [7], [8], using an RSS measurement model without considering the orientation, similar to [49]. In the following we will refer to it as RSS-SPAWN. An example for why the orientation is neglected could be, if the antenna pattern is not known or if it is not known that the RSS depends on the orientation of the nodes. The true agent and anchor positions are uniformly drawn for each realization on a support area of 5 × 5 m. For the subsequent simulations, we use 100 agents and 10 anchors. In the following, we define the model parameters for model 1 (k = 1). The path-loss parameters are given as n 1 = 1, P 1 = −11 dB with the reference distance d 0 chosen to be 0.1 m. The antenna pattern is given as a simple sinusoidal of the form ofΨ with the amplitude ξ 1,1 = 3.36 dB and the antenna orientation ξ 1,2 = 0.11 rad which shows the deviation of the maximum of the antenna pattern from the true orientation. In this section, anchors have a uniform antenna pattern with 0 dB gain. The resulting variation of the measured signal strength, which depends only on the orientation of two agents is given as Ψ 1 (ξ 1 , φ i,j , φ j,i ) = ξ 1,1 cos(φ i,j + ξ 1,2 ) + ξ 1,1 cos(φ j,i + ξ 1,2 ) (31) To determine the marginal posterior PDFs of the agent states, we use a particle-based belief propagation implementation [8] to cope with multimodal distributions.

A. Experiment 1: Random Orientation
In this analysis, we show for the four previously mentioned methods, how the accuracy of the positioning performance depends on the number of particles. This corresponds to the achieved resolution of the continuous state. The orientations of the agents are drawn uniformly in the range of [0, 2π). For the method that uses the discrete inference model, we perform the evaluation with two different sets of orientations which consist of four and eight equally-spaced members in the range of [0, 2π), respectively. For a set of four, it results in O = {0, π/2, π, −π/2}. The results are shown in Fig. 3 for three different measurement uncertainties σ = [1, 3, 6] dB and 500 simulation runs per point. We can see that using the discrete inference model has the highest benefit at a low number of particles. The reason for this behavior is that, for a low number of particles, the resolution of the joint state for continuous orientations is too low to correctly estimate the position and the orientation of the agents. For discrete orientations, this effect is not so severe since the resolution of the orientation is determined by the discrete orientations. Therefore, if the continuous state of the agent positions is already well enough represented with particles, increasing the number of particles will only lead to a minor decrease of the positioning error. For that reason, we neglect the evaluation of 20000 particles for the discrete inference model since the results in Fig. 3 show already a converged behaviour of the RMSE at a lower number of particles. Above some number of particles, the method using the continuous inference model outperforms the discrete one. This is due to the fact that the resolution of the orientation of the discrete method is limited by the discrete orientations if the true orientations are not in the set of discrete orientations ϕ i / ∈ O. Therefore using eight discrete orientations has a much better performance in terms of positioning and orientation accuracy compared to using four discrete orientations since eight equally spaced orientations approximate the continuous orientation space better. By using different measurement uncertainties, we can better see the difference in performance of the investigated methods. At this point we want to mention that reducing the measurement uncertainty but still neglecting the orientation, has nearly no impact on the performance in terms of RMSE. This is due to the bias that occurs when generating the data with an antenna pattern

B. Complexity Analysis
In this section we give an estimate of the complexity of the investigated methods depending on the number of agents |C| and the number of particles N P . For the continuous inference model, the complexity is of the order O c (|C| 2 × N P ) whereas for the discrete inference model, we have an additional quadratic dependency on the number of discrete orientations |O| which results in O d (|C| 2 × N P × |O| 2 ). We validate this estimate by measuring the computation time of Experiment 1. The results are shown in Fig. 4. We can see the strong increase in computation time for the discrete methods compared to the continuous ones. The ratio of the computation time between different methods is approximately the same as calculated with our assessment. The discrepancy regarding known orientation compared to the RSS-SPAWN implementation is due to some extra calculations which include transformations from Cartesian to polar coordinates. The difference in-between continuous and known orientation can be explained with the additional orientation estimation, which leads to an increased amount of calculations.

C. Experiment 2: Increased Number of Orientations
We show in Section V-A that for the discrete inference model, the number of particles has only a small impact on the localization performance compared to the fully continuous algorithm. Increasing the number of possible orientations on the other hand, yields an improvement of the accuracy of estimating position and orientation since more hypotheses can be evaluated. The result for that analysis is depicted in Fig. 5. It shows the dependency of the positioning and orientation RMSE on the number of orientations for 1000 and 2000 particles using σ = 1 dB and evaluated for 500 simulation runs. The discrete orientations are equally spaced in the range of [0, 2π). A disadvantage of increasing the number of orientations is that it results in a higher computational complexity as shown in Section V-B.

D. Experiment 3: Prior Knowledge of Orientation
For this investigation, we look at the case where prior information about the orientation of the agents is available. This could be the case if, due to the geometry of the scenario, only certain orientations of the agents are possible. An example could be mounting the agents on parallel shelfs or on other objects. For the simulations, we draw the orientations of the 100 agents at random out of the set of four possible orientations O = {0, π/2, π, −π/2} where 0 rad corresponds to the positive x-axis and π/2 rad to the positive y-axis. Those orientations are used as prior knowledge for both described algorithms. This means that the proposal density for the continuous orientations is a discrete uniform distribution, which consists of O. Using the discrete inference model results in only testing true possible combinations of orientations. In Fig. 6, we show the RMSE given position and orientation estimates for a varying number of particles and different uncertainties of the measurement model. We can see that the algorithm which uses the discrete inference model outperforms the algorithm using the continuous inference model especially for a small measurement uncertainty and a small number of particles.

VI. EVALUATION WITH MEASURED DATA
In this section, we evaluate the proposed algorithms with data recorded at a measurement campaign in a library at TU Graz. For this purpose, we extend the algorithms to work for 3D scenarios. The used nodes are electronic shelf labels. To validate the results for the measurement campaign, we compare them to a synthetic scenario with the same geometrical structure and model parameters as for the real scenario. The definition of the scenario, which is used in both cases, is given in the Section VI-A. The model selection for the antenna pattern as well as the parameter estimation for pathloss and antenna pattern is given in Section VI-B. The results for the synthetically generated data are shown in Section VI-C whereas the results for the measurement campaign are shown in Section VI-D.

A. Scenario
The scenario is a section of a library where the nodes are mounted on six shelfs as shown in Fig. 7. We use 960 nodes which are equally spaced on four different heights, ranging from 0.

B. Determination of Antenna Pattern
In this section, we explain how the measurement model is selected and how the model parameters are estimated. We assume that the positions and orientations of the nodes are known. We use a parametric representation of the antenna  pattern with an unknown number of parameters. The measurements conditioned on the model M=k can be seen in (2). The set of used nodes for the parameter estimation is indicated as S, where |S| is the number of used nodes. The measurements in-between nodes are indicated as z i,j with i ∈ S and j ∈ K i with K i ⊆ S being the set of nodes that cooperate with node i. Since the positions and orientations of the involved nodes are known, the likelihood function in (13) does not depend on θ and can be written in the form of f (z i,j |ϑ k , M =k). For a known model, the parameters are estimated by maximizing the likelihood function aŝ We solve (32) in an iterative manner where one iteration consists of first estimating the path-loss parameters, then the parameters for the antenna pattern, and at last the shadowing standard deviation. This is repeated until some convergence criterion is reached. To determine which model M out of a set of possible models is more likely to have generated the data z, we are interested in the posterior of the models given as The evidence of all models f (z) is hard to calculate. Therefore we are only looking at the ratio between the posterior distributions of the models which has the benefit that the evidence of all models cancels out. This is the so called odds ratio [54], [55]. The odds ratio O k,j between two models M = k and M=j with k, j ∈ M is defined as and favours model k if O k,j > 1. Using marginalization, we can rewrite the likelihood given model M=k in (34) as with f (ϑ k ) being the prior PDF of the parameters of model k. Assuming that the prior is flat in the region of interest, we can approximate that integral using the Bayesian information criterion (BIC) [56]. This leads to with the number of parameters N ϑ k , the number of measurements N z and the parameters that maximize the likelihood function asθ k , which can be calculated by solving (32). With the BIC given in (36), we can calculate the odds ratio in (34), assuming that all models are equally probable. Note that since the models differ only in terms of the antenna pattern, finding the most probable model is equivalent to finding the most probable antenna pattern (see (2)). We will use this criterion to compare two different antenna modelsΨ k with one another. The models are given as where the overall influence on the measurement can be calculated using (4). The models are chosen by looking at the data in Fig. 8a. Note thatΨ 1 is fully included inΨ 2 and thatΨ 2 is a harmonic extension ofΨ 1 . Evaluating the BIC shows with overwhelming evidence that model 2 is favoured, i.e.Ψ 2 models the data more precisely. The parameters for the antenna pattern models given in (37)  be seen in Fig. 8b. Evaluating the BIC for M =1 and M =2 given this data set, results again in a strong favouring of model 2 which is expected since the data is generated with model 2.
The estimated parameters for model 2 are very close to the generating model parameters. If less data are available and if the data have a sufficiently large variance, model 1 would be preferred over model 2. We want to mention at this point that the estimated model for the antenna pattern based on the measured data is not the actual antenna pattern of the nodes but an effective pattern that depends also on the environment in which the measurements are performed. We estimate the model parameters based on all available measurements (global parameters) but it is also possible to determine them based on a subset of nodes (see Section VI-F). We do not look into further detail regarding at which number and placement of nodes the antenna pattern can be estimated correctly. Since model 2 (M =2) is favored, we use model 2 andθ 2 for the following analysis.

C. Synthetic Results
To gain insight how the algorithms perform in such a structured scenario, we evaluate 50 simulation runs regarding measurements between nodes. The synthetic data is generated with model 2 andθ 2 . The model parameters for the evaluations are estimated with regard to (32) based on the synthetically generated data. For the discrete inference model, we test four orientations O = {0, π/2, π, −π/2}, which correspond to prior knowledge that the nodes can only be mounted on shelfs such that the orientation is normal to the possible segments of the shelfs (see Fig. 7). We use 1000 particles to represent the state of each agent. For the continuous inference model, we use different proposal densities for the orientation. The first one is a uniform distribution in the range of [−π, π) and the second one a discrete uniform distribution which consists of O. For each proposal density, we perform 50 simulation runs with a number of particles N P of 1000 and 4000. To achieve a proper evaluation, we compare the proposed methods to the case where the orientation of the agents is exactly known and to the case where the orientation is completely neglected which corresponds to the classical RSS-SPAWN implementation. The latter one coincides to a model mismatch which would be the case if the antenna pattern is not known or if it is not known that the RSS depends on the orientation of the nodes. For both comparisons, we use 1000 and 4000 particles.
In Fig. 9, we show the cumulative frequency (CF) of the position error in meters and the CF of the absolute orientation error in degree. It can be seen that estimating position and orientation leads to a significant improvement of the positioning accuracy compared to neglecting the orientation. An interesting aspect of this result is that prior information about the orientation has not so much impact on the positioning performance of the algorithm that uses the continuous inference model. The main influence is, as mentioned in Section V-A, on the number of particles which corresponds to the resolution of the state. This behaviour cannot be seen for the angular error. Here, using prior knowledge of the orientation leads to an advantage regardless of the number of particles. For the same resolution of the position state, the algorithm that uses the discrete inference model clearly outperforms the other approaches. It is also very close the ground truth with fixed orientation. Compared to the method with the discrete inference model, the algorithm with the continuous inference model, 4000 particles and prior information about the orientation has a slightly better performance in terms of the positioning error. Regarding the orientation error, using the discrete inference model results in much more correctly estimated orientations but also in more outliers which reduces the overall performance. A summary of the results is given in Table I. In addition to the evaluation with known orientation, we perform another evaluation of the algorithm with the true model parameters and known orientation, which is called 'gold standard'. The results show that there is nearly no difference in terms of the positioning RMSE in between the two analyses. It indicates that the model parameter estimation works properly. Note that if the orientation is neglected, the second part of (14) is omitted. When estimating the parameters using (32), it results in a larger shadowing variance since it has to account for the variations caused by the antenna pattern.

D. Measurement Results
In this section, we evaluate the proposed algorithms with real data resulting from the measurement campaign introduced  in Section VI-A. The path-loss model and the antenna pattern are estimated as explained in Section VI-B. We perform the same evaluation of the algorithms as for the synthetic scenario. For the discrete inference model, we use 1000 particles and four orientations O = {0, π/2, π, −π/2}. Regarding the method which utilizes the continuous inference model, we use a uniform distribution in the range of [−π, π) and a discrete uniform distribution that consists of O as proposal densities. Each proposal density is evaluated with 1000 and 4000 particles. Additionally, we compare to the case of known orientation and the RSS-SPAWN which completely neglects the orientation. The agent state is represented with 1000 and 4000 particles. The CF for the positioning error as well as for the absolute orientation error are given in Fig. 10. Note that the largest outlier is at 5.5 m. The results are summarized in Table  II. We can see an improvement in terms of the positioning accuracy compared to a simple path-loss model but the benefit is not as large as expected from the synthetic results. An interesting aspect of the results is, that even though the results with neglected orientation are in good accordance with the theoretical results, we were not able to capture all additional effects with the antenna pattern correctly. One explanation for this discrepancy is that we use an antenna pattern based on the statistics of the measurement. We did not perform any calibration or measurements in an anechoic chamber previous to the measurement campaign. Also the assumption that all antenna patterns are the same does not have to be true due to varying parameters in the production chain and a strong influence of the metal shelves. Nevertheless, our results show that it is possible to achieve a position RMSE below one meter with measurements from low-power and low-bandwidth sensors in an indoor environment with many OLOS conditions.

E. Increased number of anchors
In this section, we investigate the impact of doubling the amount of anchors on the positioning performance, which results in one anchor at the lowest and one anchor at the highest level at each corner of a shelf (see Fig. 7). We perform the same calculations as in the previous sections for synthetic and measured data. The comparison for both cases is given in Table I and Table II, respectively. We can see that doubling the number of anchors has only a small impact on the positioning accuracy. The number of cooperative measurements is N C = |C| × (|C| − 1)/2 and the number of anchor measurements N A = |A| × |C|. In this scenario N C N A which means that most of the information about the position of the agents is gained due to cooperation.

F. Parameter estimation with subset of nodes
In this section, we show how estimating the model parameters based on a subset of nodes influences the overall positioning performance. For that purpose, we split the scenario in 15 equally spaced areas in which the model parameters are estimated based on (32). Each area has a length in the xdirection of 3.5 m and a width in the y-direction of 1 m. The center of an area is in the middle of a corridor (see Fig. 7). For each estimated parameter set, we use 4000 particles to evaluate the whole scenario. In addition, we investigate the influence on the positioning performance if only the path-loss is estimated in each area and if the parameters of the antenna pattern in each area are estimated based on the global pathloss. The global parameters are determined with respect to all nodes in the scenario. The results in terms of the cumulative frequency of the positioning error can be seen in Fig. 11. Note that the largest outlier for the results with local path-loss is at 12 m. The results show that using only a locally estimated path-loss and neglecting the antenna pattern has the worst performance. Using the global estimate for the path-loss and local estimates for the antenna pattern has no real performance gain compared to using only locally estimated parameters. The global parameter set achieves the highest positioning accuracy but using local estimates of the parameters leads to comparable results, which indicates that it should be beneficial to develop an algorithm that jointly estimates position, orientation, and the model parameters.

VII. CONCLUSION
In this paper, we propose two methods for jointly estimating position and orientation of a cooperative network based on factor graphs. The first method uses a continuous representation of the orientation state whereas the second one uses a discrete representation. We employ RSS-based ranging with an RSS model that depends also on the orientation of the nodes. This directivity is modelled via an antenna pattern. We validate our proposed methods with simulations and real measurements for more than 900 agents in an indoor environment and show that the positioning performance can be increased significantly. We achieve a position RMSE below 0.80 m on an area of 112 m 2 and a height of 1 m. The large number of agents leads to a large number of measurement per agent with less influence of outliers, since it is possible to represent the statistics of the measurements more precisely. We also investigate the impact of estimating the model parameters in subregions of the scenario on the overall positioning performance. We see that global and local parameter estimation achieve comparable results. Our current research focuses on including the estimation of the model parameters in the belief propagation algorithm. Possible directions of future research could deal with the question how to reduce the number of measurements to minimize the energy consumption.