I am stuck. It seems like my functions move and sense both work well! Yet, I cannot seem to get either of the two test cases to work. Below is how I tried to test my functions, and below that is the output I got. It seems right to me. Yet, my code doesn't work when I run it in either of the two test cases. After hours and hours I need a hint or some feedback. From what is below, does it seem like my functions are working correctly? (I am new to python and programming in general)
r = robot()
r.set_noise(bearing_noise, steering_noise, distance_noise)
[x=98.539 y=72.225 orient=2.9426]
[1.789941734142201, 0.83143434899682944, 6.2073800961397936, 4.858777250229493]
[1.9061385508961166, 0.87548989086415929, 0.27913135700035602, 4.7692528026139129]
[x=82.396 y=73.891 orient=3.1348]
[1.8114322113021917, 0.73779931010396638, 5.9830996144865036, 4.1259231987578717]
[1.76619478266442, 0.72160124078836407, 5.8582556808143087, 4.1367433229995934]
To me it seems like all three noises are working correctly. Is that correct? And if so, how come the test cases don't work, if all we have to do is correctly implement the noises into the move and sense functions?
Thank you so much for your help!
asked 11 Mar '12, 01:07
Taking a quick look at the output, you are moving the robot a distance of 10 but the x coordinate has moved by approx 16. You should check your move function.
answered 11 Mar '12, 01:16
Don't forget that r.move() should return a new robot rather than modifying the existing one. When you do that, you should make sure that the newly created robot has the same properties as the old one (length and noise values). I'd start by checking that...
answered 11 Mar '12, 01:20