What is the behavior?

The robot repeatedly checks to see if there is an object in front of it, using an ULTRASONIC SENSOR.
Ultrasonic is similar to a radar, and means that a silent invisible wave is sent out in front of the sensor, and when it bounces back, the robot can tell how far away something is.
If it senses an obstacle, then the robot will do a specified action (for example: turn left), if not, the robot keeps checking and continues the action it has been doing.

How do you program the behavior to complete the behavior?

Add a repeat block and add a switch block within the repeat block.
Edit the switch block to use the ultrasonic sensor.
Set the distance to how far you want to stay away from an obstacle.
Place a move forward block in the half of the switch block which has a picture of a mountain next to it.
Place the behavior that you want the robot to perform when near an obstacle in the other half. (For example, go backward.)

What is a real-world application for the behavior?

Military robots: detecting walls to not run into them, mapping out rooms, spying on enemies, scouting ahead of a road, or detecting objects.
Household robots: detecting walls so it does not run into things while vacuuming a room.
A guide cane using ultrasonic sensors to detect obstacles for blind people. [1] This could help the 99 percent of visually impared Americans that do not own a guide dog.

Video demonstration of the behavior:

[1] ftp://ftp.eecs.umich.edu/people/johannb/paper72.pdf

colors and fonts by