playi / wonderpy Goto Github PK
View Code? Open in Web Editor NEWOfficial Public Python API for working with Wonder Workshop robots
License: MIT License
Official Public Python API for working with Wonder Workshop robots
License: MIT License
There are no clear instruction like for the eyeing is saying (pattern and brightens) how many arguments and how to write it
I'm trying to install this on a Debian 9. Installation is failing with the following:
Collecting pyobjc-framework-SystemConfiguration==5.1.1 (from PyObjC->WonderPy==0.1.0)
Using cached https://files.pythonhosted.org/packages/72/d0/5d6b99d8b93bb8cf81f47ff1931b80c79b8528d45008acd7778eb7b21d86/pyobjc-framework-SystemConfiguration-5.1.1.tar.gz
Complete output from command python setup.py egg_info:
Traceback (most recent call last):
File "", line 1, in
File "/tmp/pip-install-mKqB76/pyobjc-framework-SystemConfiguration/setup.py", line 19, in
[ 'Modules/_manual.m' ],
File "pyobjc_setup.py", line 389, in Extension
os_level = get_os_level()
File "pyobjc_setup.py", line 203, in get_os_level
pl = plistlib.readPlist('/System/Library/CoreServices/SystemVersion.plist')
File "/usr/lib/python2.7/plistlib.py", line 75, in readPlist
pathOrFile = open(pathOrFile)
IOError: [Errno 2] No such file or directory: '/System/Library/CoreServices/SystemVersion.plist'
----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-install-mKqB76/pyobjc-framework-SystemConfiguration/
Should include but is not necessarily limited to:
When I installed the Adafruit_Python_BluefruitLE outside of my virtualenv, the example program could not find it.
Running
pip install git+git://github.com/playi/Adafruit_Python_BluefruitLE@928669a#egg=Adafruit_BluefruitLE
after
virtualenv --python=/usr/bin/python2.7 --no-site-packages venv
worked better for me.
this may function with the current AdaFruit library, we haven't had a chance to test.
When running the example on Mac 11.6.1 with python 3.8.2, the following exception occurs the moment Dash is switched on.
$ python 01_hello_world.py
Disconnecting any connected robots..
Searching for robot types: (all) with names: (any).
matching robots: 0 non-matching robots: 0 .......... 2022-02-26 15:50:21.182 python[60257:22632289] *** Terminating app due to uncaught exception 'OC_PythonException', reason: '<class 'AssertionError'>: <memory at 0x10f2d9400>'
*** First throw call stack:
(
0 CoreFoundation 0x00007fff205d71db __exceptionPreprocess + 242
1 libobjc.A.dylib 0x00007fff20310d92 objc_exception_throw + 48
2 _objc.cpython-38-darwin.so 0x0000000104ce8a60 PyObjC_FreeCArray + 0
3 _objc.cpython-38-darwin.so 0x0000000104ce233d -[OC_PythonObject forwardInvocation:] + 733
4 CoreFoundation 0x00007fff2053efd6 forwarding + 819
5 CoreFoundation 0x00007fff2053ec18 _CF_forwarding_prep_0 + 120
6 CoreBluetooth 0x00007fff309e5271 -[CBCentralManager handlePeripheralDiscovered:] + 1703
7 CoreBluetooth 0x00007fff309e7048 -[CBCentralManager handleMsg:args:] + 811
8 CoreBluetooth 0x00007fff309d9037 -[CBManager xpcConnectionDidReceiveMsg:args:] + 177
9 CoreBluetooth 0x00007fff309d8f73 __30-[CBXpcConnection _handleMsg:]_block_invoke + 66
10 libdispatch.dylib 0x00007fff202ba623 _dispatch_call_block_and_release + 12
11 libdispatch.dylib 0x00007fff202bb806 _dispatch_client_callout + 8
12 libdispatch.dylib 0x00007fff202c15ea _dispatch_lane_serial_drain + 606
13 libdispatch.dylib 0x00007fff202c20e0 _dispatch_lane_invoke + 417
14 libdispatch.dylib 0x00007fff202c7a08 _dispatch_main_queue_callback_4CF + 613
15 CoreFoundation 0x00007fff20599f18 CFRUNLOOP_IS_SERVICING_THE_MAIN_DISPATCH_QUEUE + 9
16 CoreFoundation 0x00007fff2055c112 __CFRunLoopRun + 2755
17 CoreFoundation 0x00007fff2055af8c CFRunLoopRunSpecific + 563
18 Foundation 0x00007fff212ec607 -[NSRunLoop(NSRunLoop) runMode:beforeDate:] + 212
19 libffi.dylib 0x00007fff2da458f5 ffi_call_unix64 + 85
20 ??? 0x000000011060b750 0x0 + 4569741136
)
libc++abi: terminating with uncaught exception of type NSException
Abort trap: 6
the trick here is a BTLE python library.
I was planning to use this because your crappy program doesn't support threads. But oh no no, you think Mac OS is just too good. I can't use this for my class because we use the superior Windows OS here
I bet your API Isn't even updated to work with Mac OS Mojave you silly Mountain Lion nerd.
I am using MacOS 11.1 and Python 3.9.1 64-bit. When I try to import WonderPy
, I get an error:
Traceback (most recent call last):
File "<pyshell#0>", line 1, in <module>
import WonderPy
File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/WonderPy/__init__.py", line 1, in <module>
from . import core # noqa
File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/WonderPy/core/__init__.py", line 1, in <module>
from wwCommands import WWCommands # noqa
ModuleNotFoundError: No module named 'wwCommands'
Is there a way to use this package in Python 3?
I'm using Mac 10.13 and 10.14 ,but they both can't recognize the Dash through BlueTeeth
Please help me
I got the following when trying to pip install WonderPy
.
$ python -V
Python 2.7.9
$ pip -V
pip 1.5.6 from /Users/jcandan/.pyenv/versions/2.7.9/lib/python2.7/site-packages (python 2.7)
$ pip list
Adafruit-BluefruitLE (0.9.9)
future (0.16.0)
pip (1.5.6)
setuptools (7.0)
wsgiref (0.1.2)
$ pip install WonderPy
Downloading/unpacking WonderPy
Downloading WonderPy-0.1.0-py2-none-any.whl (497kB): 497kB downloaded
Downloading/unpacking PyObjC (from WonderPy)
Downloading pyobjc-4.2.2-py2-none-any.whl
Cleaning up...
Exception:
Traceback (most recent call last):
File "/Users/jcandan/.pyenv/versions/2.7.9/lib/python2.7/site-packages/pip/basecommand.py", line 122, in main
status = self.run(options, args)
File "/Users/jcandan/.pyenv/versions/2.7.9/lib/python2.7/site-packages/pip/commands/install.py", line 278, in run
requirement_set.prepare_files(finder, force_root_egg_info=self.bundle, bundle=self.bundle)
File "/Users/jcandan/.pyenv/versions/2.7.9/lib/python2.7/site-packages/pip/req.py", line 1265, in prepare_files
req_to_install.extras):
File "/Users/jcandan/.pyenv/versions/2.7.9/lib/python2.7/site-packages/pip/_vendor/pkg_resources.py", line 2291, in requires
dm = self._dep_map
File "/Users/jcandan/.pyenv/versions/2.7.9/lib/python2.7/site-packages/pip/_vendor/pkg_resources.py", line 2484, in _dep_map
self.__dep_map = self._compute_dependencies()
File "/Users/jcandan/.pyenv/versions/2.7.9/lib/python2.7/site-packages/pip/_vendor/pkg_resources.py", line 2517, in _compute_dependencies
common = frozenset(reqs_for_extra(None))
File "/Users/jcandan/.pyenv/versions/2.7.9/lib/python2.7/site-packages/pip/_vendor/pkg_resources.py", line 2514, in reqs_for_extra
if req.marker_fn(override={'extra':extra}):
File "/Users/jcandan/.pyenv/versions/2.7.9/lib/python2.7/site-packages/pip/_vendor/_markerlib/markers.py", line 113, in marker_fn
return eval(compiled_marker, environment)
File "<environment marker>", line 1, in <module>
NameError: name 'platform_release' is not defined
Storing debug log for failure in /Users/jcandan/.pip/pip.log
"distance_front_rear" should read "distance_rear"
and "robot.sensors.distance_front_rear" should read "robot.sensors.distance_rear"
There's a couple motivations for this, from most significant to least, imo:
I attempted this, but my python-foo ran out in getting the AdaFruit library to work with Python 3.
However it seems like that should not be an exotic use-case, so perhaps there's something obvious i'm missing.
When is WonderPy comes to windows world? Can you please guide me how to use, if support already exists for Windows.
XCode with Command Line Tools is a requirement of PyObjC, and should be listed in the documentation under Install dependencies.
many functions still need docstrings
It'd be great if we could eliminate some of the extra name spacing in the code. E.g. in wwConstants.py it seems like prefixing all the class constant members with ww
is redundant. Additionally, it'd be great to also remove the ww
from the name of the file, too.
Currently pip install WonderPy
does not install the AdaFruit dependency, and pip install -r requirements.txt
needs to be manually executed.
This is because of my limited python-foo in the face of requiring wonder-workshop's custom fork of the AdaFruit package.
Current the API simply connects to the single robot which best satisfies the conditions. (Robot type, Robot Name, Signal Strength).
An option for extending this might be to have multiple 'robot specifiers' on the command-line, so that we could require one Dash and one Dot, for example.
eg instead of separate top-level options for --connect-type
, --connect-name
, it could be multiple --connect
arguments, each of which is compound:
--connect "num:2 type:dash" --connect "type:dot"
.
That example would require connection to 2 dash robots and one dot robot.
Hi! Is there any way to play a sound on Dash from the API? If you can, can you play an mp3 file on Dash?
virtualenv --python=/usr/bin/python2.7 --no-site-packages venv
It says that --no-site-packages was not a valid argument so we went with
virtualenv --python=/usr/bin/python2.7 venv
When I tried to run the first example program, it says that I should import this library manually. Not sure how to do this.
I use wonderpy on a Dash robot. On robot.commands.body.do_turn(angle, speed) it turns by seemingly random speed and angle.
typically we see about 30ms between sensor packets, but sometimes longer, up to 200ms.
one idea is try changing the renegotiated connection interval from 12ms to 15ms.
note that connection interval != sensor interval.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.