George Schneeloch

Blog | Projects | Contact

openFrameworks and Android

| categories: uncategorized

I've been spending a little bit of time here and there looking at openFrameworks. It has a very active community, both on its forums and on github. It's kind of like Processing in that it's aimed toward artists who want an easy and friendly interface to work with. Its community is much more bazaar than cathedral, which shows in the huge number of contributions and the welcoming atmosphere in the forums. openFrameworks is written in C++, which is nice for portability and performance. C++ is not as intuitive to work with or to debug as scripting languages like Python, but it feels like a reasonable tradeoff.

The openFrameworks Android addon uses the Android NDK to interface Java with the compiled C++ code. I've played around with the Android NDK before, and it's a bit cumbersome to use. You need to write the C++ that interfaces with Java, which is a bit tiring. The native environment doesn't handle crashes as well as the Android JVM, and it is easier to write code which crashes in C++.

Fortunately the Android addon manages most of this for you. For the most part the code you write for openFrameworks is portable to other operating systems. You can test your code in a desktop environment and pretty much copy and paste it into an Android example to create an Android port of it. (There are certain exceptions depending on what other C++ libraries you're using, what OpenGL features you're using, etc.) To oversimplify, openFrameworks treats the Android device as a tiny desktop computer, drawing pixels on the screen and treating touch events as mouse clicks. (It acts similarly on an iOS device, and it should be relatively straightforward to port between them.)

There are certain Android features which are accessible through the openFrameworks Android addon, like cameras and location services, but it doesn't expose nearly everything you can do on an Android device. To extend that you need to add functions to the Android addon, which isn't easy or maintainable. This is one of the reasons Google doesn't recommend using the NDK to increase performance over existing Java code.

There are also quite a few things to watch out for when using the Android addon, listed in the installation guide. Due to the number of workarounds and scripts involved, it's recommended to copy an existing Android example and work from there.

Smartphones have a lot of utility due to the fact that people carry them everywhere. Android generally lacks good camera-based apps and I'm hopeful that people can use this framework to create new apps!


3D reconstruction

| categories: uncategorized

I've been using my Makerbot Thing-O-Matic for the last 6 months or so, and I'm pretty happy with it. It is definitely a hobbyist thing, and there is quite a learning curve in getting things working just right. But it is mesmerizing every time it prints something, and the state of the art seems to be rapidly advancing, both within that company and in other competing products.

There is a companion website called the Thingiverse which hosts 3D model files. It's also pretty awesome, but it skews toward the hacker community which works with it. There are things which have a purely artistic value, but they're not very plentiful when you start looking for specific items. For instance, I haven't seen a single palm tree, and most of the hits for 'tree' come up with Christmas tree ornaments. At the same time, there is a good selection of cases and stands for different Android phones and tablets.

In all fairness, it's much easier to design a case in a CAD program than to sculpt a tree. And I don't want to complain about something which people produce for free, for the good of the 3D printing community. The correct response is, do it myself!

This got me thinking about 3D scanning. My friend Kyle did some work with 3D scanning using the Kinect, which is now incorporated in openFrameworks. And I'm aware of 123D catch, the app which does 3D reconstruction from pictures. After some searching I found insight3d, an open source program which does something similar. And OpenCV has some support for 3D reconstruction, at least I assume from this documentation. I think it would be possible to create an Android app which uses OpenCV to do this.

I don't have a good understanding of computer vision, however. I know linear algebra relatively well, and I have an understanding of how 3D projections work in OpenGL. I've read some books on processing noisy data. Still, it seems like a good learning experience.


About BostonBusMap

| categories: uncategorized

The first project I'll mention is BostonBusMap (source here), an Android app that deals with live prediction data. It was built around the NextBus data feed they use for their buses. It doesn't do anything complicated with the data, and the majority of effort with the app is getting it to perform well.

Also, I wanted to do something which was more user friendly than a list-based direct representation of the data feed. Some of the features in the app require quick retrieval of and querying of stop data, which is why the stop data is bundled with the app. This is a bit of a hassle for me, because I need to update the app to ship new data within it whenever the stop data is updated on the data feed. But for the most part it's worked out well.

I remember saying in some interviews regarding the app that I wrote the app for me first, and then shared it with other people. I think I should have phrased it differently, to sound less self centered. I am a fan of DIY, the idea that you can fix things yourself, that you have a bit of power over your own environment. When the MBTA released the data I was thrilled that I could write something that could make my bus commute much easier.

(I should also thank my friend Brittany Hamtil for helping out with the graphics, where I am completely incompetent.)


Stuff I'm working on

| categories: uncategorized

I'm hoping to use this blog as a way to focus my thoughts. Lately it seems like I can't read a full page without my mind jumping to something else that's on my mind. So here's basically what I'm thinking about these days.

I'm spending a lot of time trying to get this to work. To be fair, it was working, then I upgraded to the latest git version of blogofile, which does things a bit differently. I need to figure out how to override the template for the blog to look more like the other pages on this site. Following the stack trace is a bit time consuming. I have a lot of time now, but it's hard to focus on this when there's so much else I could be doing. Still, if I didn't want to think about the details of this blog I would host this on Tumblr instead. Hopefully I can get these things fixed so I can link to it publicly.

I own a Makerbot Thing-O-Matic! I don't think I mentioned this before. This is another thing which takes a lot of time to mess with, which can be tempermental. But on the whole this thing is really fun to play around with, and worth the time and money I've put into it. I've done a little hacking around with ReplicatorG, which is on my github. I stapled someone else's gcode simulator onto it, which is in the branch simulator. It's not the best implementation, but I'm hopeful that someone will get inspired and make something greater.

Speaking of the simulator, I've been reading through the OpenGL red book slowly. It is somewhat ancient, but I really like how it is written, and I figure that it wouldn't hurt to learn how OpenGL used to be done. Apparently the newest version of this book doesn't really go into OpenGL 3 much. The next edition isn't out until 2013, so I figure I have time to catch up.


Setting up this website with Blogofile

| categories: uncategorized

I learned about blogofile when I was editing the openFrameworks website. Their site is set up as a git repository, hosted on github, that can be edited through pull requests. It uses markdown for the formatting for the most part, which I appreciate because I like how README files are formatted when viewed through github.

After an initial learning curve, working with blogofile was easy. It's a static templating system, which means you run blogofile build when you're done making changes, and it produces a complete static website. This differs from PHP and other dynamic languages because the interpretation there happens when the user visits the website. There are serious limitations to static websites, but they fit well with certain simple site designs like blogs. Comments are handled through disqus.

Wordpress would probably work just fine for me, but I like the challenge of figuring these kinds of things out. I'm hosting the source for this site on github, and I have a git hook set up to rebuild this site whenever I push changes to it. In all seriousness, the biggest mental barrier in maintaining this site is dealing with FTP or SSH to transfer files, and I'm pretty happy to replace all that with a git push web.


« Previous Page -- Next Page »