Rescuer: Try It Out

3. Troubleshoot

If your robot doesn’t make it to the exit, where does it get stuck or take a turn that you hadn’t expected? Can you work out why it made that decision?

To help you work out why your rescuer robot is getting lost, you can instruct your robot to report all the decisions that it is making in your notebook immediately prior to every instruction to turn left, turn right or drive forward.

To do this, you can use the log() template function that we have written for you to display the left-facing and front-facing data used by the robot to make its decisions and a simple print statement to report the action that is about to be taken.

The following is an example of how you can follow the robot's decision making.