Giter Club home page Giter Club logo

robopython's Introduction

robopython

Documentation Status

Robo Wunderkind Python API - BLED112 USB Dongle Required

Official Robo Wunderkind Modular Robotics Kit Python Interface

For more information about Robo Wunderkind please visit https://www.robowunderkind.com/

Python 2.x Supported Python 3.x Supported

Upcoming Features

  • New Module integration such as Servo, Motor, Hinge, and Camera
  • Fuzzy Logic Filter for Sensors/States

Getting Started

  • Install with: pip install robopython
  • from robopython import Robo
  • Create an instance of Robo object by doing: my_robo = Robo("BLE Name")
  • Test Functionality by playing a sound with: my_robo.System.play_sound(0)

Chrome OS

  • Update to latest Chrome OS
  • Set into Developer Mode
  • $ sudo dev_install python
  • Install ChromeBrew: https://skycocker.github.io/chromebrew/
  • crew install freestyle
  • pip install robopython
  • Run python as sudo for robopython to work

Troubleshooting

If you get an error saying No BGAPI compatable device is detected please insert the BLED112 USB dongle or switch USB ports If problem persists you can identify the COM port explicitley with my_robo = Robo("BLE Name", COM PORT)

robopython's People

Contributors

jonrobo avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

oe2wnl larsmei

robopython's Issues

Improve documentation build process

It would be desireable to delete the docs/_build folder from this repo as it always gets generated by make.bat (add a .gitignore file)

I am sure the process of updating https://robopython.readthedocs.io can be automated when some file under docs changes.

This would automate the whole documentation publishing process

Description / About

Please add a general description / About in the README and/or docs indicating what robopython actually is? Is it a new programming language? Is it python bindings to some robotics library? Which one and what robots/platforms are supported etc etc.
Thanks.

Key Error

Hi,
yesterday I was able to connect withe the USB dongle to the Robo and I was able to run all of your provided demo scripts.

Todaynothing is working anymore...

For example if I want to run this:

from robopython import Robo

BLE_Name = "ROBO"
Robo = Robo(BLE_Name)
print Robo.battery_level()

I receive the following:

PS C:\Users\Patrick> & C:/Python27/python.exe c:/Users/Patrick/Documents/robo_test1.py
Running on Windows, please ensure your BLED112 dongle is plugged in
Traceback (most recent call last):
File "c:/Users/Patrick/Documents/robo_test1.py", line 4, in
Robo = Robo(BLE_Name)
File "C:\Python27\lib\site-packages\robopython\robopython.py", line 44, in init
self.BLE = BLED112(self.name, com_port)
File "C:\Python27\lib\site-packages\robopython\ble_robo.py", line 28, in init
self.connect_ble()
File "C:\Python27\lib\site-packages\robopython\ble_robo.py", line 110, in connect_ble
self.scan()
File "C:\Python27\lib\site-packages\robopython\ble_robo.py", line 84, in scan
devices = self.adapter.scan()
File "C:\Python27\lib\site-packages\robopython\pygatt\backends\bgapi\bgapi.py", line 328, in scan
self.expect(ResponsePacketType.gap_end_procedure)
File "C:\Python27\lib\site-packages\robopython\pygatt\backends\bgapi\bgapi.py", line 534, in expect
return self.expect_any([expected], *args, **kargs)
File "C:\Python27\lib\site-packages\robopython\pygatt\backends\bgapi\bgapi.py", line 582, in expect_any
self._packet_handlerspacket_type
File "C:\Python27\lib\site-packages\robopython\pygatt\backends\bgapi\bgapi.py", line 709, in _ble_evt_gap_scan_response
name, data_dict = self._scan_rsp_data(args['data'])
File "C:\Python27\lib\site-packages\robopython\pygatt\backends\bgapi\bgapi.py", line 508, in _scan_rsp_data
constants.scan_response_data_type[field_value[0]])
KeyError: 38

The same happens if I try it on my MacBook (where it was working yesterday)

Do you have a tip for me what could be wrong ?

How to use this library?

The code i am trying to execute is:

from robopython import Robo

BLE_Name = "tom"
Robo = Robo(BLE_Name)
print Robo.battery_level()

but i does not print the battery level.

Instead i get this errror:

Running on Linux, please ensure your BLED112 dongle is plugged in
Connected to RW_tom!
Exception in thread Thread-6:
Traceback (most recent call last):
File "/usr/lib/python2.7/threading.py", line 801, in __bootstrap_inner
    self.run()
File "/usr/lib/python2.7/threading.py", line 754, in run
    self.__target(*self.__args, **self.__kwargs)
File "/home/pi/.local/lib/python2.7/site-packages/robopython/pygatt/backends/bgapi/bgapi.py", line 600, in _receive
    bytearray(args['value']))
File "/home/pi/.local/lib/python2.7/site-packages/robopython/pygatt/device.py", line 226, in receive_notification
    callback(handle, value)
File "/home/pi/.local/lib/python2.7/site-packages/robopython/robopython.py", line 207, in handle_rx_data
    self.update_build(read_data)
File "/home/pi/.local/lib/python2.7/site-packages/robopython/robopython.py", line 246, in update_build
    name = self.build_map[idx][idy].name
AttributeError: 'NoneType' object has no attribute 'name'

From what i understand:

  1. I was able to connect via bluetooth: Connected to RW_tom! (in that moment it also plays a sound)
  2. I was not able to call any method on Robo

may you give me some guidance how to proceed?
Can you give me a hint what the problem might be?

OS Info:

  • Distributor ID: Raspbian
  • Description: Raspbian GNU/Linux 10 (buster)
  • Release: 10
  • Codename: buster

Python Version:

  • Python 2.7.16

Kernel Info:

  • Linux raspberrypi 4.19.75-v7+ #1270 SMP Tue Sep 24 18:45:11 BST 2019 armv7l GNU/Linux

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.