Instructions
5. Obstacle Avoidance
Now, add a loop block to tell the rover how long to explore and gather data. In the example below, a repeat for the next (20) (minutes) block is used.
Within the loop, add in two if-do blocks. For this investigation of the planet we are going to tell the rover to explore the new planet, avoid obstacles while logging temperature and humidity readings.
The first if-do block will be for the obstacle avoidance. This is similar to the visual survey lesson. The example shown below connect distance sensor (<) (5) (in) block to the if- and turn (135) degrees to the (left) block + drive (forward) to the do-.