Showing posts with label linux. Show all posts
Showing posts with label linux. Show all posts

February 4, 2010

The Joys of Linux

I'm taking a course on Python this semester. I'm really excited about it; there really is no other word for it. I'm sure that my excitement over something as simple as, say, simultaneous assignment, won't be easily conveyed to non-programmers or even anyone besides myself. Nevertheless, the new toys in Python, and particularly the new paradigms (I have never dabbled in functional programming before now, but the potentials offered by yield and generators are making me positively giddy), are very exciting.
The course is just now migrating to Python 3, so in a sense it's good that I didn't get started with the language until now. Unfortunately the default Python documentation (http://docs.python.org/) is for 2.6.4, so it's very easy to get tripped up by outdated information. In a yet more sinister turn, Ubuntu itself uses 2.6 by default! I didn't think this was much of a problem at first. A bit of Googling eventually schooled me in the proper use of update-alternatives, and soon I had set the default python command to call python3. But then the problems came.
The first sign I had that something was wrong was a big red "do not enter"-style notification at the top right, telling me that the update manager wasn't working. I won't go into the details, but I tried all I could to fix it, and somehow I fooled around with dpkg to the extent that GRUB now displayed my install as "Debian". I had all but given up, and I was on the verge of reinstalling, when I booted up today and realized that Dropbox wasn't running, either. Running dropbox in a terminal gave me some strange error, which seemed to hint that the contents of the file were text, not the binary executable itself. So, on a hunch, I opened up /usr/bin/dropbox in a text editor, and what do I see?
#!/usr/bin/python
The dropbox script was formatted for Python 2.x (it was Unicode strings causing this particular error), and my messing around with the default python command was what caused my problems. Evidently the update manager also relied on Python, because resetting the default command back to 2.6 allowed the update manager to run again, and at the moment it looks like everything's going to be okay.

UPDATE: Everything was not okay.

July 17, 2009

Back to Work

I have been working this whole time (well, except last week), even though I've kept pretty quiet about it on the blogging front. I think it's about time for an update.
The DynamixelNetwork code is just about finished. That is, it feels very well-rounded, it's densely-commented, and it'll do everything we need it to do. (In fact I think there's now more comments in it than actual code... but I did it for Doxygen, so that you don't even have to open the source code now to find out everything you need to know about it.) There are still one or two problems with it--a couple obscure functions of the servos aren't yet supported, and the latency is pretty high--which I'm hoping to get the chance to iron out before I leave, but I still think it's a nice bit of code, and better than anything else available for Linux for these servos. I hope the university will choose a license for it soon, so I can post a link. It's my first real contribution to the "open-source community", and hopefully not the last. I hope it gets a good response.
On the robot front, I'm making good progress writing the pan-tilt unit module to integrate into the software framework. That's kind of minimal, though--just a bit of code to accept and send messages, which talks to the servos with my library. I've also been tasked with designing the hardware for the robot body... somehow. Heh. When I first got here I started in on the pan-tilt unit, and I had never designed hardware before. What I'm doing isn't really too complicated, it's just a bit of CAD... but I had never done it before, and I didn't have any idea where to start. I did it, though, and it was pretty fun. It turns out that by doing that, I became the most experienced person on the team when it came to hardware. So I was the natural choice to design everything else.
I'm not complaining, though. I'm learning some valuable new skills, and I do like to tinker with gadgets every now and then. It's staves off the drudgery of programming 24/7, and I'm getting better at it, too. So on Tuesday I'm going to take the robot apart again, pull off a few things, walk to the workshop with an armful of aluminum, and slap it all together. Fun times.

I'm leaving Germany on the 12th of August. That means I've got three weeks left to finish up. If I finish the hardware next week, I should be able to get the software wrapped up before I leave. It's really strange to be leaving so soon. Three months isn't really much time at all. It's okay, though--it wasn't long enough to get overly attached to the place, but it was long enough to get a whole lot of stuff done, and get some memorable moments in there, too. I'm not really excited about jumping right back into school again, though...

June 29, 2009

Relief

I finally got all my mouse buttons working in Linux. And no, I'm not going to bitch about how unhelpful Linux was this time... I'll leave that task to the simple fact that I've had this laptop for almost a full year now. Granted it mostly worked correctly, and the only thing I was missing specifically was that the back/forward buttons didn't work in Nautilus. But it's nice to have it working fully again, and even nicer that I found a comfortable solution.
It didn't take me long to abandon the "supported method", which is to install imwheel and edit the settings by scratching arcane figures into stone tablets. Fortunately I was quick to find an alternative called btnx, which has a (gasp!) graphical user interface. Although it's not exactly shiny, and it was probably just a lucky break that it supported my mouse, it was simple to use, fully-featured, and worked the very first second time. (It didn't say it had to run as superuser, and didn't warn me, either... it just failed when I tried to save the settings.) But the interface was nothing less than I expected--a straightforward "click the button you want to edit" process. One limitation I think it might have compared to imwheel (I haven't really searched for it, though) is the ability to have different settings for each program. Fortunately that's not one of the things I want to do right now, but hopefully it'll be supported in the future.

I wouldn't exactly call this a glowing recommendation ("Ubuntu: Its inadequacies aren't entirely unsurmountable!"), but it's the closest anything in Linux has come to "just working" in quite a while.