|
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) MY TEST: r = robot() print r r.set_noise(bearing_noise, steering_noise, distance_noise) print r.sense(0) print r.sense() r.move([pi/8.0,10]) print r print r.sense(0) print r.sense() THE OUTPUT: [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! |
|
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. |