GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - dailab/roomba-python: library and demo for the roomba

BranchesTags
Open more actions menu

Latest commit

 

History

23 Commits
23 Commits

Folders and files

NameName
Last commit message
Last commit date
.vscode
.vscode
 
 
conf
conf
 
 
img
img
 
 
.gitignore
.gitignore
 
 
LICENSE
LICENSE
 
 
README.md
README.md
 
 
create.py
create.py
 
 
demo.py
demo.py
 
 
desk-control-speech.sh
desk-control-speech.sh
 
 
game.py
game.py
 
 
roomba-connect.sh
roomba-connect.sh
 
 
roomba-control-speech.sh
roomba-control-speech.sh
 
 
roomba-control.sh
roomba-control.sh
 
 
starwars.py
starwars.py
 
 

Repository files navigation

Python Roomba

Python 2.7 scripts to control the Roomba via serial cable. This work is based on the script from this course. I adjusted it a bit to get access to the light bump in the Create 2 and my Roomba 770.

Dependencies

You need pyserial to run this script.

pip install pyserial

or

easy_install pyserial

Tester

I added a file to control the roomba with the wasd-keys. For that you also need pygame installed. Just run

python game.py

and a window with some information about the current sensor values like the one below:

game.pu

Move the Roomba around with w/a/s/d.

Use as library

The main class is create.py which contains everything to talk to the Roomba. To use it write sth like:

import create
import time
robot = create.Create(ROOMBA_PORT)
robot.printSensors() # debug output
wall_fun = robot.senseFunc(create.WALL_SIGNAL) # get a callback for a sensor.
print (wall_fun()) # print a sensor value.
robot.toSafeMode()
robot.go(0,100) # spin
time.sleep(2.0)
robot.close()

For more information read the original tutorial. The list of all available sensors is here.

My setup

I tested these scripts using this cable and a Roomba 770. I tested the code on a Mac and on a RaspberryPi with debian (you need to change the PORT to tty.USB0 on the Pi) If the Roomba does not connect properly, check the cable first, then check if the port is correct, and then check if the baud rate in create.py is correct.

Known issues

The odometer data is nonsense. I assume that there are bugs in the computation because its off way too much to count it as cumulative error.

About

library and demo for the roomba

Resources

Readme
Artistic-2.0 license
Activity
Custom properties

Stars

0 stars

Watchers

3 watching

Forks

0 forks
Report repository

Releases

Packages

Contributors

Languages

You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.