Introducing python-ardrone

Flying AR.Drone

The last weeks I spend quite a lot of time hacking on a Python library for the AR.Drone. The AR.Drone is a nice toy for nerds. You connect to it via WIFI and soon you’ll realize that it has 4 ports open. Reading the specs you’ll find, that on one port it listens for AT-Commands with which you can remote control the drone, on the other two ports it waits for an incoming package which will trigger the drone to send the navdata (speed, angles, battery status, etc) and the video stream. Heck, you can even telnet into the drone…

Unfortunately it comes without a proper software to control the drone, only an iPhone app (w/o iPhone of course). But given the documentation, it should be easy to write your own. While getting the beast to fly was relatively easy, decoding the “almost”-jpg-video-stream was not. Almost-jpg, since the images the drone sends are more or less jpg with a small difference which makes it impossible to decode them using standard multi-media libraries. Anyways, the format is documented and implementing a decoder was not that hard. The tricky part was to get the framerates from unacceptable 0.5 FPS to 12-22 FPS — the whole decoder is written in Python. I’m cheating a bit by using psyco, but the code in arvideo.py is heavily optimized to minimize calculations and to please psyco.

In the code is also a small demo app which uses Pygame to display the video stream and allows to control the AR.Drone with the keyboard. It should be ready-to-use as soon as you are connected to the drone via WIFI.

The git repository is here, the license is MIT. Suggestions and patches are welcome.

Here is a video of the drone flying through the office.

Posted in Uncategorized | Tagged , | Leave a comment

Dear Lazyweb

After todays or yesterdays daily package update (Sid) several kernel modules, namely thinkpad_acpi, snd-hda-intel and probably others are not loaded automatically anymore. So my Thinkpad T500 had no support for audio and several power management functions anymore. Once I found out that the missing kernel modules where the problem, the fix was easy: just add the corresponding module names to /etc/modules to enforce loading of the modules. But I wonder what caused the sudden change? Why are the modules not loaded automatically anymore? I usually update my Sid packages every morning so some package update from yesterday or today might have caused this. Looking at the packages which where updated, I found nothing suspicious. Has anyone an idea at which package I should look?

Update: Looks like the problem was related to the recent update of base-files to version 6.2 which introduced the new /run directory in combination with udev. Downgrading base-files to version 6.1 (via snapshot.debian.org) fixed the problem.

Posted in Uncategorized | Tagged , | 6 Comments

Summer School: Advanced Scientific Programming in Python

Once again, there will be another round of the Summer School “Advanced Scientific Programming in Python”. This year in St. Andrews, UK.

Quoting from the official announcement:

Scientists spend more and more time writing, maintaining, and debugging software. While techniques for doing this efficiently have evolved, only few scientists actually use them. As a result, instead of doing their research, they spend far too much time writing deficient code and reinventing the wheel. In this course we will present a selection of advanced programming techniques, incorporating theoretical lectures and practical exercises tailored to the needs of a programming scientist. New skills will be tested in a real programming project: we will team up to develop an entertaining scientific computer game.

We use the Python programming language for the entire course. Python works as a simple programming language for beginners, but more importantly, it also works great in scientific simulations and data analysis. We show how clean language design, ease of extensibility, and the great wealth of open source libraries for scientific computing and data visualization are driving Python to become a standard tool for the programming scientist.

This school is targeted at PhD students and Post-docs from all areas of science. Competence in Python or in another language such as Java, C/C++, MATLAB, or Mathematica is absolutely required. Basic knowledge of Python is assumed. Participants without any prior experience with Python should work through the proposed introductory
materials before the course.

You can apply on-line at http://python.g-node.org

Applications must be submitted before May 29, 2011. Notifications of acceptance will be sent by June 19, 2011.

No fee is charged but participants should take care of travel, living, and accommodation expenses. Candidates will be selected on the basis of their profile. Places are limited: acceptance rate in past editions was around 30%. Prerequisites: You are supposed to know the basics of Python to participate in the lectures. Please consult the website for a list of introductory material.

If your’re a scientist and interested in Python, I cannot recommend this summer school highly enough. The Summer School is always fun, the faculty members are very nice and always willing to help and answer questions. The balance between lectures and exercises is in my opinion very good, and you’ll learn a lot about Python during the week. The highlight of every Python School is always the Pac Man tournament, where groups of students will implement their own Pac Man agent (in Python) and compete against the other agents in a tournament ’till the bitter end!

The students of the previous editions were usually very happy during and after the School. Speaking of happiness, since no fee is charged for the Summer School, you’ll have more money left over to invest into the excellent Scottish pubs!

Posted in Uncategorized | Tagged , | Leave a comment

Squeeze

Tonight Squeeze was released! Along with the release came a redesign of our website and planet. Nice! I’m particularly happy that we’ll see lots of fresh software and updates in unstable again, now that it is not frozen anymore.

Thanks to all contributors. Keep up the good work!

Posted in Uncategorized | Tagged , | Leave a comment

Canon IXUS 130

Dear Lazyweb,

Today I bought me a Canon IXUS 130 and was quite disappointed to see that it couldn’t properly connect to my Debian/Sid machine via USB. Apparenty the camera is not recognized as a USB Mass Storage Device but utilizes PTP. I upgraded to libgphoto2 (2.4.10.1-3) from experimental and added a proper udev rule with vendor- and product-id but it did not help. Is there anything more I can try?

Update: Accessing the camera actually works, even with ligbphoto2 (2.4.6) from unstable. I can access the camera with gphoto2 and download pictures (but not with KDE’s filemanager). My problem was that I had rhythmbox running and the camera was automatically mounted by it as a media device. When KDE’s filemanager or gphoto2 tried to access the camera I got an error like: (‘Could not lock the device’): Camera is already in use., which is probably also a bug. Closing rhythmbox solved the issue and I was able to download images with gphoto2.

Posted in Uncategorized | Tagged , | 6 Comments

Google Summer of Code 2010 Mentor Summit Report

As requested by our beloved leader, here’s my report on this year’s Google Summer of Code 2010 Mentor Summit. The summit took place in Google’s HQ in Mountain View, California and was what they call an “unconference”. In the beginning of the unconference the attendees had 10 minutes to write down proposals for a session and put them on a huge white board. After that, every attendee voted for the sessions in which he was interested by putting a small sticker on the proposal. This way we could evaluate the interest on a specific topic and schedule the sessions to the differently sized rooms according to their interest. Neat trick!

The the rest of the summit was basically like a conference: we had 11 tracks filled with 5-6 sessions per day, which ran from 10:00 to 17:30. Google provided shuttle buses from our wonderful hotel to the googleplex in the morning and back to the hotel in the evening. The hotel was very nice, it was equipped a swimming pool and a hot tub (both outside), which was extensively used in the morning and of course during the night. Speaking of the night, Google sponsored Thai food in the first night and ye olde Pizza and Beer in the second. Some of the attendees brought their keyboard, guitar, bass and electric clarinet, and where playing some sweet ass Jazz and Pop (on special request…).

The sessions itself where not quite what I expected. I expected some proper talks about specific topics, but it was more like and open discussion round where everyone was invited to participate. For some topics it worked pretty well, for others not. It was still totally worth coming, since you meet a lot of like minded people and there is plenty stuff to talk about.

Of course I was very exited to see the googleplex. And the rumors are true: the googleplex seems to be a very nice place to work. They provide free breakfast, lunch and dinner for their employees. They have micro kitchens everywhere where you can grab free snacks and beverages. There are lot’s of toys lying around, they have bicycles everywhere on the campus which you can just grab to move from one building to another. There is a dinosaur on the yard, a spaceship over the stairwell and lots of other things (testing on the toilet, anyone?), and we have probably only seen a small fraction, since we were not allowed to leave the restricted areas for the unconference.

Despite the horrible yet lag (leaving Germany on Friday morning and leaving San Francisco on Sunday night), I’m glad I was able to attend to the summit and can only recommend aspiring mentors and students to participate to the next summer of code!

Posted in Uncategorized | Tagged , | 1 Comment

Introducing python-popcon

Python-popcon is a small Python library which allows to query Debian’s popcon database. The usage is very trivial:


>>> import popcon

>>> popcon.package('python-popcon')
{'python-popcon': 2}

>>> popcon.package('icedove', 'iceweasel')
{'icedove': 12140, 'iceweasel': 45666}

>>> popcon.package('foobarbaz')
{}

You can call the package method with an arbitrary number of package names and it will return a dictionary with package name : popcon value mappings for all packages found. If a package is not found in the popcon database it will not be in the resulting dictionary or if it was the only package in the method call, the method will return an empty dictionary. The popcon value is the number of installations according to Debian’s Popularity Contest service.

There is also a second method which gives some more information


>>> popcon.package_raw('icedove', 'iceweasel')
{'icedove': [8065, 2195, 1879, 1], 'iceweasel': [27857, 10681, 7120, 8]}

It returns a list of [vote, old, recent, no-files] for the given package.

How does it work? Upon a query, popcon downloads http://popcon.debian.org/all-popcon-results.txt.gz, extracts and parses the file and returns the desired information. Since downloading and extraction this file is expensive, it saves the file and tries to re-use it is not older than 7 days. So while the first call of one of the above methods can take a few seconds, the result will appear almost instantaneously for the next week until the cache file expired.

That’s it, no rocket science but a convenient way to get popcon information from within python. The package python-popcon is available in Debian/Sid for a few days.

Posted in Uncategorized | Tagged , | 4 Comments

Weird Konsole Split

Can someone explain me the purpose of (KDE’s) konsole’s ability to split?

You can split horizontally or(!) vertically but the resulting terminals are just mirroring the activity of the first one. What is the usecase for that?

Yakuake does splitting right. You can split several times horizontally and vertically and the resulting terminals are independent. You can also switch the focus of the terminals easily via keystrokes which makes yakuake an invaluable tool when working on the terminal under KDE.

So what’s the point of konsole’s variant of splitting?

Posted in Uncategorized | Tagged | 7 Comments

Happy Birthday Debian!

17 years… I guess the puberty is almost a thing of the past and you’re getting all grown up and stuff. You certainly changed for the better in the last years. Ok, a few rough edges here and there but overall a quite impressive development. You’re already forking regularly and even your offspring is quite handsome. No wonders with those genes if you ask me.

Thanks to Ian for starting probably the best Linux distribution out there. I hope you are proud of what you’ve started (I certainly was when I met you two years ago) and someone is killing a few beers with you right now.

Also big thanks to all the Debian Developers, Maintainers and contributors for making Debian what it is today. Keep up the good work!

Posted in Uncategorized | Tagged | Leave a comment

Goodbye DebConf10

DebConf was really an awesome conference. I’m happy that I have finally met so many of the fellow Debian people I only knew from the mailing lists or planet. There where lot’s of interesting talks, the hacklabs where always busy, and the overall atmosphere was very good. Now that I’m back in Berlin, I’m already missing it — I’m by the way also missing my luggage which is apparently still at the JFK airport.

This was my first DebConf, but definitively not my last. I encourage people who never made it to DebConf: Get your butt up and register for the next conference! You don’t know what you’re missing. If money is an issue: there is a sponsoring which you can apply for and chances are good that you’ll get at least partially sponsored.

Big thanks to all the volunteers who helped to organize and run this conference and to SPI for sponsoring my trip, food and accommodation!

I’m looking forward seeing some of you again in three weeks at Steve’s place in Cambridge for a nice BBQ and the rest of you next year in Bosnia and Herzegovina!

Posted in Uncategorized | Tagged , | Leave a comment