2022 Robotics & Control Systems

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 required overcoming several technical challenges:

  • Creating intuitive teleoperation controls with reliable stop mechanisms
  • Developing precise motion control for predictable movements and turns
  • Implementing sensor processing algorithms to detect walls and objects
  • Building robust PID controllers for smooth wall-following behavior
  • Designing a finite state machine to coordinate complex behaviors
Neato Electronics

The Solution

We developed a comprehensive set of controllers and algorithms to enable diverse robot behaviors:

  • WASD keyboard teleoperation with explicit stop commands
  • Square-driving algorithm with timed maneuvers and motion pauses
  • Wall-following using PID control and right-side LIDAR data
  • Person-following via object detection and position tracking
  • Obstacle avoidance with 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
  • The square-driving routine incorporated sleep commands with stop signals between movements
  • Wall-following used the minimum value from the right half of the LIDAR scan (elements 180-359)
  • Person-following included both object detection and position tracking in global coordinates
  • Obstacle avoidance combined target vectors with weighted obstacle-avoidance vectors

Teleoperation & Basic Movement

Our teleoperation implementation used the WASD keys for intuitive control:

Keyboard Control: We mapped "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.

Square Driving: For programmed movements, we implemented a loop with sleep commands that alternated between forward motion and 90° turns. After discovering that the robot would continue its previous movement while starting the next command, we added explicit stop commands with 0.5-second pauses between movements to ensure clean transitions.

Advanced Behaviors

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.

Neato State Transition

Neato State Transition

Finite State Control

State Machine Design

  • Combined object following and wall following behaviors
  • Designed to drive up to a cylindrical object, align to it, and circle around it
  • Implemented state transitions based on object detection and proximity
  • Created smooth transitions between different behavior modes
  • Incorporated safety features to stop the robot when no object is detected

Behavior Switching Logic

  • No object detected → Stop motors
  • Object detected & distance > 1.1m → Object following
  • Object detected & distance < 1.1m → Turn 90° left, then wall following
  • Each state used dedicated control algorithms optimized for the specific task
  • Transition conditions based on real-time sensor feedback

Wall Following Results

  • Successfully followed walls at a constant 1-meter distance
  • Handled both inside and outside corners effectively
  • Capable of steering 180° around protruding walls
  • PID controller prevented oscillations common in simpler proportional controllers
  • Demonstrated reliable performance in the simulated maze environment

Person Following Results

  • Accurately detected and tracked object position in global coordinates
  • Steered smoothly toward the tracked object
  • Adjusted speed based on distance to target
  • Successfully stopped at appropriate distance from the object
  • Performed reliably when object detection was active