Check for inf readings is performed by large values
e.g. while self.get_right_laser() <= 10*laser_R_set:
Attached print screen from the code and the shell
In red frame you will find the laser reading you requested.
Also you can see that the condition is valid and while loop in logic since the code continues.
The print (“Stop, I’m close to the wall”) is presented in the shell
Regarding the infinite process during task3, evaluates when the robot is completely outside the room
self.get_front_laser() > 1.0
The robot is going outside the room (see picture. robot area), the robot stops and the codes stops and exits (see picture, shell area)
this condition is not performed at all after exiting the room and in fact not after turning toward the exit.
I’m well aware that the robot is not starting task3 from task2 finish point but it may well be a mistake but not code error that makes the check process to get stuck.
I read this entire post, so decided to help you out since you seem to be stuck for more than 10 days(?).
You can check for infinity values with python simply by if var == float(“inf”) or if var != float(“inf”).
For task1.py you must get all the readings except inf values and report the maximum and minimum of non-inf values.
For task2.py just reset your simulation, move as far as the front wall and stop within 1 meter and just turn 90 degrees (roughly - need not be exact 90 degree) to face the exit.
VERY IMPORTANT task3.py starts off from the final position of task2.py. Just create the two functions get_laser_readings() and main() working. Make sure when you have exited the room / walls and all your laser scan values read inf as ranges.
If all the above are working, the gradebot/autograder will succeed. As it did for me!
You have infinite attempts, so why take the certificate now if you can improve your score?
By the way, your score will not be printed on your certificate, I believe. So, improve your answers, get a 100% and request TheConstructSim team to update your score (this step is only for your satisfaction) and then you can get your certificate.