johnsu01 (johnsu01) wrote,
johnsu01
johnsu01

  • Music:

Control Roomba with Python

Lemonodor has a Python fragment demonstrating the Roomba serial interface API (recently released by the manufacturer). A vacuuming robot that you can program in Python? That sounds pretty fun to me.

You can download the specs from iRobot's hacker page.

In fact, reading the spec, the Python is right in there.

This one looks good:

"Enables unrestricted control of Roomba through the SCI and turns off the safety features." (Does this include the Asimov Laws? Muhahaha...)

As does:

Controls Roomba's drive wheels. The command takes four data bytes, which are interpreted as two 16 bit signed values using twos-complement. The first two bytes specify the average velocity of the drive wheels in millimeters per second (mm/s), with the high byte sent first. The next two bytes specify the radius, in millimeters, at which Roomba should turn. The longer radii make Roomba drive straighter; shorter radii make it turn more. A Drive command with a positive velocity and a positive radius will make Roomba drive forward while turning toward the left. A negative radius will make it turn toward the right. Special cases for the radius make Roomba turn in place or drive straight, as specified below.

It can even play simple MIDI songs.

LJ Tags: python roomba robots

Tags: python, robots, roomba
Subscribe
  • Post a new comment

    Error

    default userpic
    When you submit the form an invisible reCAPTCHA check will be performed.
    You must follow the Privacy Policy and Google Terms of use.
  • 0 comments