Now that the servos are working at the touch of a mouse, all I have to do is make the gimbal, put it in a box, hook up the servos, and away I go. But mechanical engineering has never been my strong point. In fact, my first stab at it is not looking good.
Eye-To-Eye Part 4: Moving the Servos
The four pieces required for the Eye-To-Eye project are in place now: A laptop running Ubuntu with Opengazer fully functional, router, Arduino with Ethernet Shield and two servos (for one eye). The glue for all the pieces — especially the opengazer-to-network part — have also all been figured out. However, putting the pieces together still required some work I didn’t anticipate, and provided some interesting challenges I have yet to solve.
But the good news is, it works! Here’s the video:
Arduino + Network + Bash (Eye-to-Eye, Part 3)
This is Part 3 of my “Eye-to-Eye” adventure: figuring out how the Arduino network shield works, and how to interface with it from the OpenGazer program I discussed previously.
Continue reading
Installing Opengazer
For Eye-To-Eye, I decided to use Opengazer on Ubuntu. I had two laptops running Ubuntu 11.04: Acer Aspire One (slightly older netbook) and Toshiba Tecra. I eventually got both of them working, although there were a lot of tweaks. These are my notes to get it working on both of these machines, YMMV.
First, download opengazer and follow instructions in the README.
You’ll notice right away you need CMake. Thankfully, Ubuntu makes this easy:
sudo apt-get install cmake
Next, download and install VXL. Unfortunately, this has to be done from source. Because VXL is made for previous versions of linux, there are some headers which are outdated. I’ve compiled a list of problems and solutions.[see below for update]
These are all the problem areas, the rest is described well in the opengazer README.
Update: 2012-04-17
Some people were having problems installing opengazer, and I decided to put together a more comprehensive set of instructions
Eye-To-Eye: Project Inception
Introducing Eye-To-Eye
Wouldn’t it be cool to use eye tracking software to control animatronic eyes?? If you answered “yes”, this post is for you – the beginning of my project, Eye-To-Eye that aims to do just that – build animatronic eyes and control them using my own eyes via eye-tracking software.
If Life was a Cron file…
* 6-8,17-19 * * 1-5 drive.sh
* 9-17 * * 1-5 work.sh
* 23,0-5 * * * sleep.sh
* 9,11,13,15 * * 1-5 coffee.sh
* * * * 1 case_of_the_mondays.sh
* 7-23 * * 6,0 fun.sh
UINavigationController and Rotation
Recently working on a project that needs a video displayed from a table view inside of a UINavigationController stack. The video needs to be in Landscape mode, while the rest of the project can be in Portrait or Landscape. The view controllers are pushed onto the stack, and each of the view controllers overrode the shouldAutorotateToInterfaceOrientation: method. The landscape controller had return (interfaceOrientation == UIInterfaceOrientationLandscapeRight || interfaceOrientation == UIInterfaceOrientationLandscapeLeft);; the rest of the controllers simply returned YES. So far, so good.
Here’s the problem. The view controller that contained the video (aka VideoViewController) arranged its elements in landscape mode, but started in potrait mode. Rotating it to Landscape mode corrected the issue, then rotating it back to Portrait mode, it still looked ok:
- Portrait View (Incorrect)
- Portrait View (Incorrect)
- Landscape View (Correct)
I could not make this work using the pushViewController method on the root view controller’s navigationController. But, for some strange reason, presentModalViewController: presented this view in the correct orientation. So the table view gets pushed onto the NavigationController with pushViewController and the VideoViewController gets presented as a modal view. The interesting thing about it is if you specify YES for the animated parameter, it doesn’t look like a modal view controller — meaning that it doesn’t pop up from the bottom like normal modal VCs, but rather from the side, and doesn’t look unnatural.
This is only a workaround until I can figure out why a regular pushViewController call doesn’t rotate the view, and I was lucky enough that in this instance a modal controller worked out well.
Constants in Objective-C
If you’re a Java programmer developing on the iPhone platform, you’ve probably wondered about how to set constants in your programs. Undoubtedly, you have have come across the #define preprocessor macro, and maybe a few other methods, but I’m going to show you my approach to this problem using the singleton design pattern. Continue reading
BootCamp Success!
I finally got around to installing Windows XP through Boot Camp and will document my experience here. I am running a 2007 Mac Book Pro 2.4GHz with 4GB of RAM and an NVIDIA GeForce 8600M GT on OS X Leopard. The point is to have a computer on which my wife can play Team Fortress 2 with me. Her idea. Honest.
As I indicated in an earlier post, my first hurdle was to get my MacBook’s hard drive defragmented enough for Boot Camp to be able to partition it. In theory, the HFS+ filesystem used by Mac OS X does not get fragmented due to how it was designed and how OS X uses the filesystem (read all about it on Apple’s website: http://support.apple.com/kb/HT1634).
As one of my favorite professors once said: “The difference between practice and theory is small in theory but large in practice.”
Continue reading
Linux and OS X miscellaneous stuff
To “burn” a .iso or .img file to a USB device, type:
sudo dd if=bt4-pre-final.iso of=/dev/disk1 bs=1m
where /dev/disk1 is your particular disk. In OS X you can find out by going to the Disk Utility and selecting information on your target drive. In linux, type `dmesg` and that should give you the drive name.
I will be editing this to add more stuff.



