Our more sophisticated implementations employed sensor processing and control theory:
Wall Following: We implemented a wall-following algorithm that used the minimum laser scan value from the right half of the robot's LIDAR array (elements 180-359) to determine distance to the wall. A PID controller from the simple-pid library maintained a constant 1.0-meter distance from the wall, adjusting the angular velocity to steer toward or away from the wall as needed.
Person Following: For this behavior, we combined object detection (by finding the centroid of non-infinite LIDAR points) with position tracking. The algorithm calculated the global position of the detected object and used a PID controller to steer the robot toward that position while maintaining an appropriate following distance.
Obstacle Avoidance: This system combined odometry data with LIDAR scans to navigate toward a target while avoiding obstacles. The algorithm created vectors pointing away from detected obstacles (weighted by proximity) and combined them with the target direction vector to determine the optimal path.