topikachu / python-ev3

a project to run lego ev3 in python
Apache License 2.0
189 stars 73 forks source link

Join forces? #63

Open antonvh opened 9 years ago

antonvh commented 9 years ago

I love python, and I love lego. I'm not so happy with the current boost-python implementation of ev3-dev. Neither is Ralph Hempel, he is working on a pure python branch here: https://github.com/ev3dev/ev3dev-lang/tree/pure-python. I want to contribute but I don't want to choose sides. Can't we all work on one python module? I think it's a matter of agreeing on namespace. If you are interested I can try to set up the repositories right.

maxnoe commented 9 years ago

I would highly welcome this, i was always confused which to use

ensonic commented 9 years ago

+1

bittner commented 8 years ago

+1, though I find Ralph's repository very confusing. I'd prefer to have a clean repo for each language, one at a time. I can't see a compelling reason for a super-repo for all languages at all. And, of course, why are there submodules to various languages, but C++ and Lua are included as source code directly?

bittner commented 8 years ago

A confusion example: (a real-life user journey, experienced 01 Jan 2016)

I've just installed ev3dev (ev3-ev3dev-jessie-2015-12-30) on a SDCard. I've managed to log in via SSH. Now the tedious part:

robot@ev3dev:~$ python3
>>> import ev3dev
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ImportError: No module named 'ev3dev'
>>> 
robot@ev3dev:~$ python
>>> import ev3dev
>>> m = ev3dev.LargeMotor('outA')
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
AttributeError: 'module' object has no attribute 'LargeMotor'
>>> dir(ev3dev)
['__builtins__', '__doc__', '__file__', '__name__', '__package__', '__path__']

WTF? There is a python package installed, but it doesn't do anything? And the documentation doesn't match.

... and so on.

I'd really love to see this repo to be the one included in the ev3dev image. It looks much better maintained, much more in a good state.

G33kDude commented 8 years ago

Running help(ev3dev) reveals that there are "Package Contents" auto, brickpi, core, and ev3. Importing ev3dev.ev3, as we're using the ev3, gets you the api you are looking for. Running help(ev3dev.ev3) reveals a bit more about the ev3dev.ev3 module.

Following the documentation link on the pypi page you've provided leads me to seemingly up to date documentation with no link to the deprecated repository in sight.

Going through the list of unified libraries on the official ev3dev website (which is linked from the "Writing Programs" section of the setup guide) brings me directly to the latest official repository by @rhempel, with a link to the same documentation.

I'm not sure how we could improve the state of that. It's not like we can directly modify Google's search results. All of the official information I could find from the website seems up to date.

bittner commented 8 years ago

@G33kDude Okay, sorry. You are right. It's all in perfect shape. If you say so.

You could of course double-check to see if the points are valid. I'm not trying to be rude, just describing a real user journey. Try to double-check.

ddemidov commented 8 years ago

@bittner reported the problem with documentation link at https://github.com/rhempel/ev3dev-lang-python/issues/99#issuecomment-168333231. I probably got it fixed before @GeekDude tried that, so both of you have valid points :).

G33kDude commented 8 years ago

I never said it was in perfect shape. Also, you do have valid points. However, my point is that following the guides on the website bring you to where you need to look for documentation, and we can't realistically tailor all the search engine results for a vague search like python-ev3dev (especially since the hyphen is likely ignored by most search engines).

rhempel commented 8 years ago

Happy New Year everyone! Kreuzlingen - that sounded familiar! When I was a young boy my grandparents used to drive us up to the ferry crossing from Wangen Im Allgau to go shopping there.

So, I understand the frustration, and my goal for the weekend is to try and get my ev3dev-lang-python repository into good shape. So I will review Peter's comments carefully, try and add some more useful "getting started" docs and make the ecosystem safe for future contributions.

rhempel commented 8 years ago

@bittner, could I ask you to please copy your comments above (maybe trim after reviewing new information) and open a new issue at [https://github.com/rhempel/ev3dev-lang-python]. Thks.

pepijndevos commented 8 years ago

Is any of the two libraries really much better than the other?

I think that the reason why it's one big repo is that they used to be SWIG bindings generated from one specification.

rhempel commented 8 years ago

Well, that's all changed a bit in the past few weeks. We have split each binding into its own repo and made ev3dev-lang a submodule in each one. At the end of the day, we are sticking with one "official" binding for each language.

bittner commented 8 years ago

Don't get me wrong, everyone: The ev3dev project is awesome, really awesome. I apologize if my "user journey" reflected too much some obvious frustration. (I was trying to show my son the awesomeness of Linux and Python on his Lego brick. An attempt that failed in the end, despite his remarkable discipline to listen and wait. And now that I know the brick's battery is empty. :weary:)

@G33kDude The link to the libraries is indeed helpful though the page is a bit hard to find. Language bindings is an important topic for the Linux based Lego brick. It could be worth adding a direct link to the "Docs" menu of the website, what do you think?

rhempel commented 8 years ago

HaHa! Having had three sons myself (all of which are now off to Uni) I can only give this advice:

  1. Let your son play with the EV3 using the EV3-G GUI to get him interested.
  2. When he goes to sleep, insert the ev3dev microSD card and play with Python on the EV3
  3. When you are comfortable and have got his robot doing at least as well as he has using EV3-G - them show him Python

It's frustrating to watch someone muttering "This should work!" and "Argh - why are the docs so messed up" - better luck tomorrow - I'll be working on getting the basics cleaned up.

psychemedia commented 8 years ago

One way of documenting the package could be to present working examples in a Jupyter (IPyhton) notebook. An IPython server can be run from the brick, although it's a bit slow, but I've also started exploring how we can run a remote IPython kernel on the brick and the heavier Jupyter server on a desktop/laptop machine on the same network as the brick. First doodles here: https://blog.ouseful.info/2016/04/15/thinking-around-the-edges-lego-ev3-robots-running-remote-jupyter-kernels/

I hope to produce some demo notebooks in the next couple of weeks documenting the library we have installed to support our own possible use of the library in a teaching context.