Giter VIP home page Giter VIP logo

roomba's Introduction

Roomba

Roomba 530 navigation using ESP8266 and MPU-9250. Motion tracking with Python.

Build

The Roomba 530 uses the iRobot Roomba 500 Open Interface Specification (ROI). The Arduino library that supports that is available here: http://www.airspayce.com/mikem/arduino/Roomba/

This program is using 19200 baud for communication to the Roomba. To set the baud rate: When powering on Roomba, hold down the Clean/Power button. After about 10 seconds, Roomba plays a tune of descending pitches.

Circuit board (top view): Circuit

Configure WiFi

The ESP8266 will automatically connect to the last used access point based on configuration saved in flash memory.
If this is the first time connecting (or the access point is unavailable), this program will create a soft access point with SSID: roomba10 and Password: carbondioxide. Connect with a WiFi client and browse to http://roomba10.local to access the program.

To configure the ESP8266 to use an existing access point, browse to http://roomba10.local/config, and enter the SSID and PW. The STA IP is the assigned address on the network:

Wifi

The ESP8266 will automatically connect to that network on reboot.

Calibration (Compensation)

The MPU-9250 is sitting close to the Rooma, in a distorted magnetic field. To compensate, access http://romba10.local/calibrate:

Calibrate

Select direction for Roomba rotation and press start. When the Roomba stops rotating refresh the page to view the results. The Bias values seem to vary quite a bit, so you may need to manually adjust for best results. Enter values and press Set.

Track

To track the position of the Roomba, place a contrasting color on the Roomba - something not visible anywhere else in the camera view - and use scripts/track.py (requires Pygame: https://www.pygame.org/wiki/GettingStarted). Click to select the color; a line will be drawn connecting the centroid of the color as the Roomba moves. Press "w" to save the image. Two image files are created:

Track

Patterns

Patterns are defined in steps.h. Eact step of the pattern is a 6-digit number: 2 digits of command and 4 digits of data:

int stepCommand = Pattern[stepMode].Steps[rStep]/10000;	
int stepData    = Pattern[stepMode].Steps[rStep]%10000;

The basic commands are:

  case 0:   rStep = stepData; roombaStatus = 0; break;
  case 20:  driveDistance(stepData); break;
  case 21:  driveDistance(-stepData); break;
  case 22:  driveVelocity(stepData); break;
  case 30:  turnAngle(stepData); break;
  case 39:  turnNoStop(stepData); break; // turn without stopping
  case 40:  arcAngle(stepData); break;
  case 50:  setArcRadius(stepData); break;
  case 51:  decArcRadius(stepData); break;
  case 52:  incArcRadius(stepData); break;
  case 99:  stopMotion(); break;

Bugs

There's a 0/180 problem: when the Roomba is pointing 180 degrees and the command is rotate to 0... it doesn't.

roomba's People

Stargazers

 avatar  avatar  avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.