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.udacityforums.com/cs373/questions/16527/variancevsstandarddeviationambiguityinhw36 Summary: steering_noise, distance_noise and bearing_noise are STANDARD DEVIATIONS not variances.AchilleTalon 
Yes, it seems like negative distances are in principle possible given this model. Maybe some of the noise is due to very high winds. Thom Blake 
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. Phil Duby1 +1.
(09 Mar '12, 02:40)
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/hw36_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.
(09 Mar '12, 14:01)
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:
(09 Mar '12, 15:40)
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?
(09 Mar '12, 16:01)
Answered here http://www.udacityforums.com/cs373/questions/16527/variancevsstandarddeviationambiguityinhw36 Noise is standard deviation, not variance. The comment is wrong.
(10 Mar '12, 13:41)

But the world isn't cyclic...according to the comments at the start of the code David L Sprague 
You are right but it doesn't matter and here is the proof : First for the oreintation:we all know that pi/2 is equavielent to 3pi/2 and pi/4 is equavelent to 7pi/4 so generaly theta is equavielent to 2pi  theta and what % (num1%num2) operator do is it asks it self what number should i subtract from num1 to be devisable by num2 2nd for positionhere we apply the same analysis sence the world is cyclic so for world with size 100x100 we have the following x = 12 is equavellent to x = 88 , y = 1 is equavelent to 99 and so on Ahmed Asim 2
Actually, the robot world in this assignment is documented to not be cyclic, and move() does not wrap around as the earlier assignments did.
(09 Mar '12, 02:39)
Read the comment for world size in the homework. This world is NOT cyclic. The initialization makes sure the random starting position is within those world boundaries, but movement is allowed outside of that.
(09 Mar '12, 02:39)
