GithubHelp home page GithubHelp logo

dbirman / robotcontrol Goto Github PK

View Code? Open in Web Editor NEW

This project forked from vdwel/robotcontrol

0.0 2.0 0.0 23 KB

A simple python library to control Dash and Dot robots on OSX and Linux

License: MIT License

Python 100.00%

robotcontrol's Introduction

RobotControl

A simple python library to control Dash and Dot robots from Wonder Workshop. It works on OSX and on Linux (on Linux it is not very stable yet)

This python library has been developed by using the AdaFruit BlueFruit LE sniffer to capture communication between the iPad and the Robots.

It might contain errors or might not work anymore in future release of the robot firmware.

Using this library is at your own risk.

Dependencies:

  • You must install the "Adafruit_Python_BluefruitLE"-library first (you can find it on github), use it with the Bluez version as described by the Readme from Adafruit
  • Your system should support bluetooth LE

Usage: from robot import *

Create a main function like this:

def main():
    global myRobot
    myRobot = robot(getRobotDevice("Dot" or "Dash"))
    your_robot_control_function()
    myRobot.disconnect()

and then start the main function with the following command:

ble.run_mainloop_with(main)

In your robot control function, you can execute commands on the robot like: dash.command(arg1, arg2, arg..)

For debugging, show all sensor data with the command: displaySensorData(myRobot) #where robot is your robot object (see example)

Read sensor data like: value = myRobot.sensor

When finished use the command: myRobot.disconnect()

Supported commands:

  • connect()
  • disconnect()
  • reset()
  • playSound(const sound) sound is a sound from the list below
  • playBeep(int tone, int time in ms) can also be used without the tone and time
  • drive(int distance in mm, int time in ms)
  • setWheelSpeed(int speed, int turnspeed) speed is between -400 and 400 turnspeed is between -500 and 500
  • stopWheels()
  • turn(int degrees, int time in ms)
  • moveHeadY(int degrees) -7 < degrees > 22
  • moveHeadX(int degrees) -135 < degrees > 135
  • colorFront(int red, int green, int blue)
  • colorLeftEar(int red, int green, int blue)
  • colorRightEar(int red, int green, int blue)
  • colorAll(int redFront, int greenFront, int blueFront, int redLeft, int greenLeft, int blueLeft, int redRight, int greenRight, int blueRight)
  • topLight(bool on)
  • tailLight(bool on)
  • eyeLights(int intensity, 12bit integer) Each bit represents a led, bit0 is top led, bit1 is led right from top led (when facing the robot)

Available sensordata:

  • leftDistanceSensor (int)
  • rightDistanceSensor (int)
  • rearDistanceSensor (int)
  • button0 (bool)
  • button1 (bool)
  • button2 (bool)
  • button3 (bool)
  • tilt (int)
  • lean (int)
  • soundLevel (int)
  • clap (booL)
  • headX (int)
  • headY (int)
  • leftWheel (int)
  • rightWheel (int)
  • zRotationAcceleration (int)
  • deltaZRotationAcceleration (int)
  • deltaXRotationAcceleration (int)
  • deltaYRotationAcceleration (int)
  • zAcceleration (int) between -2040 and +2040
  • soundDirection (int)
  • leftSensorSeesDot (bool)
  • rightSensorSeesDot (bool)
  • unknown1 (int)
  • robotSerial (string)

Sounds:

  • HI
  • HUH
  • UHOH
  • OKAY
  • SIGH
  • TADA
  • WEE
  • BYE
  • HORSE
  • CAT
  • DOG
  • DINOSAUR
  • LION
  • GOAT
  • CROCODILE
  • ELEPHANT
  • FIRESIREN
  • TRUCKHORN
  • CARENGINE
  • CARTIRESQUEEL
  • HELICOPTER
  • JETPLANE
  • BOAT
  • TRAIN
  • BEEPS
  • LASERS
  • GOBBLE
  • BUZZ
  • AYYAIYAI
  • SQUEEK
  • MYSOUND1
  • MYSOUND2
  • MYSOUND3
  • MYSOUND4
  • MYSOUND5
  • MYSOUND6
  • MYSOUND7
  • MYSOUND8
  • MYSOUND9
  • MYSOUND10

robotcontrol's People

Contributors

vdwel avatar dbirman avatar

Watchers

James Cloos avatar  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.