2022 Robotics & Software Engineering

Hacking a Neato

A comprehensive project to repurpose and program a Neato robot vacuum for custom behaviors including teleoperation, autonomous navigation, wall following, person following, and obstacle avoidance using ROS and Python.

Control Modes

5

Different behavior implementations

Framework

ROS

Robot Operating System integration

Sensors

LIDAR

360° scanning for environment mapping

The Challenge

Programming a Neato robot vacuum to perform multiple autonomous behaviors presented unique opportunities to explore robotics control systems. The project involved creating intuitive teleoperation controls with reliable stop mechanisms, developing precise motion control for predictable movements and turns, and implementing sensor processing algorithms to detect walls and objects effectively.

Building robust PID controllers for smooth wall-following behavior required careful tuning to maintain consistent distance from walls while navigating around corners and obstacles. Additionally, designing a finite state machine to coordinate complex behaviors demanded thoughtful architecture to ensure smooth transitions between different operational modes and reliable performance across various environmental conditions.

Neato Electronics

Neato Robot Vacuum Electronics

The Solution

We developed a comprehensive set of controllers and algorithms to enable diverse robot behaviors, including WASD keyboard teleoperation with explicit stop commands, a square-driving algorithm with timed maneuvers and motion pauses, and wall-following using PID control and right-side LIDAR data. The system also incorporated person-following via object detection and position tracking, along with obstacle avoidance using vector-based navigation.

Each behavior required specific implementation strategies to ensure reliable operation. The teleoperation system used ROS publishers to send velocity commands based on keyboard input, while the square-driving routine incorporated sleep commands with stop signals between movements. Wall-following utilized the minimum value from the right half of the LIDAR scan (elements 180-359), and person-following included both object detection and position tracking in global coordinates. The obstacle avoidance system combined target vectors with weighted obstacle-avoidance vectors to determine optimal navigation paths.

How It Works

Our teleoperation implementation used the WASD keys for intuitive control, mapping "W" for forward movement, "A" for counterclockwise rotation, "S" for backward movement, and "D" for clockwise rotation. Early testing revealed that the robot wouldn't stop when keys were released, requiring us to implement explicit stop commands triggered by any other key press. For programmed movements, we implemented a loop with sleep commands that alternated between forward motion and 90° turns, adding explicit stop commands with 0.5-second pauses between movements to ensure clean transitions.

Our more sophisticated implementations employed sensor processing and control theory. The wall-following algorithm 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, with a PID controller maintaining a constant 1.0-meter distance from the wall. For person following, we combined object detection by finding the centroid of non-infinite LIDAR points with position tracking, calculating the global position of the detected object and using a PID controller to steer the robot toward that position while maintaining an appropriate following distance.

The obstacle avoidance 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. This approach enabled the robot to navigate complex environments while maintaining its intended trajectory.

Neato State Transition

Neato State Transition Diagram

Finite State Control

The finite state machine combined object following and wall following behaviors, designed to drive up to a cylindrical object, align to it, and circle around it. The system implemented state transitions based on object detection and proximity, creating smooth transitions between different behavior modes while incorporating safety features to stop the robot when no object is detected.

The behavior switching logic operated on clear conditions: when no object was detected, the robot stopped its motors; when an object was detected at a distance greater than 1.1 meters, the robot engaged object following mode; and when an object was detected at a distance less than 1.1 meters, the robot would turn 90 degrees left and then engage wall following mode. Each state used dedicated control algorithms optimized for the specific task, with transition conditions based on real-time sensor feedback.

Performance Results

The wall following system successfully followed walls at a constant 1-meter distance, handling both inside and outside corners effectively. The robot was capable of steering 180 degrees around protruding walls, with the PID controller preventing oscillations common in simpler proportional controllers. The system demonstrated reliable performance in the simulated maze environment, proving the effectiveness of the control algorithms.

The person following behavior accurately detected and tracked object position in global coordinates, steering smoothly toward the tracked object while adjusting speed based on distance to target. The robot successfully stopped at appropriate distances from objects and performed reliably when object detection was active. The combination of these behaviors created a robust autonomous navigation system capable of complex interactions with its environment.