|
I observed that in a significant number of cases the noise added to either the steering angle or the distance will produce either a steering angle larger than the max_steering_angle or either a negative distance. Anybody else observe this behavior? Normal? Abnormal? Should I remove checking? Traceback (most recent call last): Edit: I would like to upload an histogram of the distance distribution, however it seems I haven't the rights to. To summarize, it is almost certain I will get negative distance values in a run with test case 2. EDIT2: Clarification required. Are the steering_noise, distance_noise and bearing_noise variances or standard deviations? EDIT3: Clarification here: http://www.udacity-forums.com/cs373/questions/16527/variance-vs-standard-deviation-ambiguity-in-hw-3-6 Summary: steering_noise, distance_noise and bearing_noise are STANDARD DEVIATIONS not variances. |
|
A negative distance should be very unlikely, with a distance noise of 5.0, and a [planned] forward motion of 20.0. If you are seeing negative values regularly, I think you need to check the calculation where the noise is used. +1. In the code the motion is 12.0, not 20.0. Where did you get the 20.0 value from? And here is the link to the histogram for a normal distribution with mean 12.0 and standard deviation 5.: http://www.4shared.com/photo/TJx8pw_r/hw3-6_histogram.html?refurl=d1url EDIT: I see, I checked again the video and Sebastian is showing the test part with 8 iterations and distance of 20. However, in my sample of code when clicking on the NEXT button, I am having 6 iterations and distance of 12. So, seems the video and the code aren't the same. Also, the steering angle shown in the video is 2pi/10, while in the code it is 2pi/20. 1
Test case one says:
Test case two says:
so distances 12 and 20, and steering angles for 2 pi / 20 and 2 pi or 10 are used. Your histogram shows, you can go negative with a base distance of 12, but it should not happen very often. I am also not sure your histogram was generated correctly. I did a search on wolframalpah.com with "gaussian distribution mean 12 variance 5". That shows standard deviation as sqrt(5). The notes at the top of the sample code say the noise values are variance, not standard deviation. So your chart should use a standard deviation or sqrt(5), not 5. The graph on the wolframalpha page shows dropping to basically zero at about 5.5 and 18.5. Here is a link to that page: 2
Well, thanks I now know where is the confusion. In the notes you have the following comment:
So, this clearly let you think random.gauss(0, self.bearing_noise) is taking variance as the second argument while the official documentation on http://docs.python.org/library/random.html says random.gauss(mu, sigma) is taking standard deviation as the second argument. If you look at the code for measurement_prob(), you will see Sebastian is updating the error with the following formula:
So, here the self.bearing_noise is in fact the standard deviation. Now, what about steering_noise and distance_noise? Conclusion, the comment itself is wrong. A good way to include noise centered at zero is not to use random.gauss(0, self.bearing_noise) it is to use random.gauss(0, sqrt(self.bearing_noise)). Can Andy clarify if the provided values are standard deviation or variance?Answered here http://www.udacity-forums.com/cs373/questions/16527/variance-vs-standard-deviation-ambiguity-in-hw-3-6 Noise is standard deviation, not variance. The comment is wrong. |
|
But the world isn't cyclic...according to the comments at the start of the code |