In the commented out directions for HW3-6, we are told to incorporate noise into steering by choosing our steering angle from a Gaussian distribution of steering angles. For bearing, we are supposed to just add some noise from a Gaussian distribution. We aren't given any specific instructions for incorporating noise into distance.
I tried it both ways (separately): choosing the distance from a Gaussian distribution (centered at our true distance) and also adding noise from a Gaussian distribution (centered at 0). They both had distance_noise set as their variances. I was surprised to find that they performed differently. It turns out adding the noise gives slightly better results than when the distance is chosen from a Gaussian distribution. The comparison was made by computing the True/False rate of their checker over 2000 runs. The difference was ~88% for adding noise and ~84% for taking the measurement out of a Gaussian.
I can't see why one should be better than the other in this situation. Can anyone explain the difference? Also, which is the one more true to reality? I submitted my assignment with the better results, but that's not to say that's how things play out in the real world.
UPDATE: I reran the program 10,000 times each and for the "n+random.gauss(0,noise)" case I got 90%, but for the "random.gauss(n,noise)" case I got 80.88%.
To be sure that I get the question right. What you are saying is, that n+random.gauss(0,noise) is not the same as random.gauss(n,noise)?
I checked the implementation of gauss (python 2.7) in random.py:
def gauss(self, mu, sigma):
As you see, mu is added at the end, so there is basically no difference between n+random.gauss(0,noise) and random.gauss(n,noise). If I misunderstood your question, then please clarify
answered 09 Mar '12, 16:51
I can't see how it can be better?
2000 runs is probably not enough.
Changing the mean of a Gaussian just seemed to move its graph along the x axis, the shape of the distribution was the same. So you'd expect if random.gauss(0, 5.0) is returning +/- 25, say, that (50, 5.0) will return 25 to 75.
As for the real world, "it depends" is probably the best answer.
But in the real world your robot or car isn't likely to travel large distances without a sense and resample step in any case. So it might be that at road speeds with typical sensing and resampling rates it works.
In my point of view they are exactly the same. I wouldn't say that 4% difference is a conclusive result. If you try running the test again (2000 more times) maybe you will get inverted results.
answered 10 Mar '12, 03:20