2
\$\begingroup\$

I am trying to implement a particle filter for coupling gyro and electronic compass for better measuring device orientation. [related question]

I understand my state vector would contain the absolute angle and turn-rate and my observation vector contains the readings for the same from the compass and gyro.

In my transition model, I just use the constant turn-rate assumption plus random noise to move the particles to their next states. Then, when I get a set of readings (angle and turn-rate from the sensors) in the next time instant, how do I assign weights to the particles? Is there a systematic procedure to assign the weights for a state vector containing multiple variables or should I just calculate it based on the difference between the predicted value and the observed value for both compass and gyro?

i.e.: weight(particle X) = RMS(angle(Particle X) - angle(sensor), rate(Particle X )- rate(sensor)), and then normalize all the readings?

EDIT:

Let me explain my problem a little further. I am working on the basis that the electronic compass alone is subjected to magnetic interferences in the indoor environment and hence the gyro should be used along with it to improve the accuracy of orientation.

Now, these magnetic interferences will form the external/environment noise of the process and will definitely be non-Gaussian, since they are bound to be biased towards the side of the metallic structure. That is why I chose the Particle filter over say, the Kalman filter although it is the most preferred method. So when I really don't know the pdf of the noise, then how do I estimate the likelihood that a predicted value is equal to a real value (which would be its weight, right?)

Assuming a normal distribution in this case would not work, because it would give me wrong probabilities for particles. Atleast, this is what I understand; please correct me if I'm wrong.

\$\endgroup\$

1 Answer 1

2
\$\begingroup\$

No, it's not a stupid question. Reweighting (or resampling) particles is non-trivial for any "fun" problem. Weighting is typically performed by computing the likelihood of the particle fitting the observation. See page 28 here. This link and this link give reasonable discussion on particle resampling.

These links assume you can easily compute the likelihood a particle corresponds to the observations. For ease, we typically assume the likelihood can be expressed as a normal distribution (i.e. with a mean and a variance). Since your observations are comprised multiple dimensions, you might use the multivariate version of the normal distribution.

\$\endgroup\$
5
  • \$\begingroup\$ Thank you for the reply. I have looked at two of those papers before. They don't really provide a method to actually compute the weights. \$\endgroup\$
    – Imelza
    Commented Feb 14, 2011 at 6:48
  • 1
    \$\begingroup\$ Let me explain my problem a little further. I am working on the basis that the electronic compass alone is subjected to magnetic interferences in the indoor environment and hence the gyro should be used along with it to improve the accuracy of orientation. \$\endgroup\$
    – Imelza
    Commented Feb 14, 2011 at 6:49
  • 1
    \$\begingroup\$ Now, these magnetic interferences will form the external/environment noise of the process and will definitely be non-Gaussian, since they are bound to be biased towards the side of the metallic structure. That is why I chose the Particle filter over say, the Kalman filter although it is the most preferred method. So when I really don't know the pdf of the noise, then how do I estimate the likelihood that a predicted value is equal to a real value (which would be its weight, right?) \$\endgroup\$
    – Imelza
    Commented Feb 14, 2011 at 6:49
  • 1
    \$\begingroup\$ To address the first comment regarding "how": p.122 of the book "Probabilistic Robotics" by Thrun, Burgard, and Fox, 2005 gives a good example of sampling. \$\endgroup\$ Commented Feb 14, 2011 at 14:50
  • 1
    \$\begingroup\$ The weighting is used to focus or shape the particle distribution. You can still use a particle filter without weighted resampling, but this implies a larger number of particles are needed. As for the noise affect, take some data to determine the influence of metallic structures. A Weibull distribution or a gaussian distribution with a non-zero mean might fit the data well enough to proceed. \$\endgroup\$ Commented Feb 16, 2011 at 4:04

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.