A.s.a. H. learns that (a robot's) collisions correlate with increased pain and damage.
It also learns that sweeping the ultrasonic (obstacle) sensor back and forth correlates with having fewer collisions as compared with having a fixed directed ultrasonic sensor. A.s.a. H. then learns to sweep it's sensor, looking for obstacles and spending more time attending to this particular input channel.
Alternatively, if the robot has a single fixed mounted sensor it may learn to make small repeated left and right turns as it advances forward.