Behavior:Wall Following
Jump to navigation
Jump to search
| Wall Following | |
|---|---|
| Type | Behavior (Algorithm) |
| Requires Capabilities | Capability:Time-of-Flight Sensing or Capability:Ultrasonic Sensing, Capability:Differential Drive |
| Enables Activities | Activity:Maze Solving |
| Difficulty | Beginner |
| Status | Stub - Algorithm not yet implemented |
Wall Following is a behavior (algorithm) that maintains a constant distance from a wall while moving parallel to it.
Overview
This is a stub page. This behavior is not yet implemented in any BRS robot. This page exists to:
- Document the algorithmic concept
- Invite community members to implement it
- Provide a starting point for algorithm design
Required Capabilities
This behavior requires:
Enables Activities
Implementing this behavior enables:
Algorithm Outline
Wall following uses distance sensing and proportional control:
- Measure distance to wall
- If distance < target: turn away from wall
- If distance > target: turn toward wall
- Drive forward
For maze solving, consistently follow left or right wall until exit is reached.
Pseudocode
# Wall Following
TARGET_DISTANCE = 20 # cm
while True:
distance_to_wall = read_distance_sensor()
error = distance_to_wall - TARGET_DISTANCE
turn_adjustment = error * gain # Proportional control
left_speed = BASE_SPEED + turn_adjustment
right_speed = BASE_SPEED - turn_adjustment
set_motors(left_speed, right_speed)
Implementation Challenges
- **Corners**: Detecting and handling inside/outside corners
- **Gaps**: What to do when wall disappears (doorways, openings)
- **Obstacles**: Handling objects protruding from wall
- **Sensor placement**: Angled sensors vs perpendicular sensors
Contributing
Want to implement this behavior? Here's how:
- Study the algorithm outline above
- Implement in your language of choice (MicroPython, C++, Arduino)
- Test on a robot with the required capabilities
- Create an Implementation page (e.g.,
YourRobot:Wall Following Implementation) - Update this page with algorithm refinements
- Share working code on GitHub
See Also
- Behaviors - All behaviors
- Capabilities - Hardware required
- Activities - What this enables
- Robotics Ontology - How behaviors fit into BRS knowledge structure