I finally finished my port of the E1 object tracking from OpenCV (CV2) / Python 2.7 to OpenCV / Python 2.6. I had to do this because Beagleboard doesn’t have a readily available Python 2.7 package (at least not with Angstrom), and I didn’t realize that OpenCV (CV2) required Python 2.7 until after I developed the original code on my laptop.
This was a bit of pain because there are not many examples. If your platform supports Python 2.7, use OpenCV CV2! There are a lot of examples and it’s all object oriented. It’s so much more enjoyable to work with.
I made a quick and dirty web GUI so that I can adjust the HSV values in real-time. It works pretty well.
I also built a quick-and-dirty web interface to control the servos. The big motivator here was I replaced the original side-to-side movement with a pan-tilt configuration.
Unfortunately when used together, the board gets reset…. Still trying to figure out why…
One of the take-a-ways from last year’s Maker Faire was that having multiple battery packs and no overall power switches were problematic and actually dangerous.
As we were setting up our booth my boy took to hooking the batteries up to the robot. Somehow there was a short, followed by sparks and smoke. The battery was toast and the boy ended up with a small burn on his finger. It was at that moment that I knew a formal power system would be built before any further “playing” with the robot.
My requirements were simple.
- I wanted one source. I didn’t want one battery to run the servos and a different battery (or 2 as was the case) to run the motors.
- It had to be regulated for running the computer and all peripherals.
- Each sub system could be switched off
- It needed one main power switch AND an emergency cut off
In researching for ideas I came across the idea of using step-down voltage regulators running in parallel off of a large battery bank. This makes it easy to add power capacity as needed. I would carve off 5v for BeagleBoard, 5-6v for the servos (and controller), and 7v to each motor.
I used these 3amp Buck Converters for the BeagleBoard
I used these 5amp Buck Converters for the each of the the remaining sub-systems (servos, left motor, right motor)
For power switches I couldn’t resist lighted rocker switches (just for the bling) and of course the emergency switch had to be a mushroom button.
I had envisioned the switches running horizontal across the shoulders of the back of the robot, but the boy over-ruled me with a vertical design (which looks great and works better). We used a corrugated plastic sign trimmed down to the proper dimensions and spray painted white. additionally it was re-inforced with white duck-tape (so the painting ended up not being all that necessary).
On paper this all seemed great and was easy to layout in a crisp design:
The reality of the wiring was pretty messy
Labels make for a polished look.
And it works!
I put together a fun script which isolates colors using HSV filtering and then finds the largest “blob”, which is presumably an object that should be tracked. It then finds the center of the “blob” draws a target indicator on it, along with the X,Y coordinates.
The result is surprising good object tracking with minimal code. I have yet to port it over to the BeagleBoard because I wrote the script taking advantage of OpenCV’s “CV2″ library which requires Python 2.7. Unfortunately Only 2.6 is available via packages for the BeagleBoard and I have had little success in getting 2.7 to cross-compile. So I’m in the middle of porting the code to use only the core “CV” functions.
Here is the results of the object tracking (running on my Windows laptop):
Ultimately the E1 will be controlled by a beagle board computer. To accomplish this I bought a Torobot 24-servo controller board, but had a really hard time getting an easy-to-use API to interface it. I tried pyUSB to no avail.
Finally I found that the Torobot USB board could be communicated with through an Arduino serial driver. Conveniently this is available through opkg:
opkg install kernel-module-cdc-acm
When the board is plugged in, it comes up as
From here you can simply echo commands to the device.
echo "#8P1500T100" > /dev/ttyACM0
This basically says “set servo 8 to position 1500 with speed 100″. Doesn’t get much simpler than that!
Make Magazine, one of my favorite sources of inspiration is sponsering the Rhode Island Mini Maker Faire at AS220 Foo Fest today. We are proud to have the opportunity to show off the E1 (Now known as “Nuts”).
Join us at the Maker Faire today (Aug 10). We will be there from 1pm till at least 5pm – though the Faire will last till 1am.
With a home cooked meal in me, a great night’s sleep, and having enjoyed time with my family (sister Kathy, brother in law Jeff, brother Chips, sister in law Lynn, niece Samantha, and nephew Michael) I was able to convince Jeff to do Section 11 with me. Without the weight of my luggage the riding was much more enjoyable.
Jeff did the first 12 miles with me
The bike handled a bit more spirited without all the weight
It was some of the best single track (roller coaster smooth) of the trip
With plenty of great views
I left Jeff with the truck at mile 12 and continued to finish the rest of the segment.
It was great riding. At one point I heard a thrashing sound…looked back and saw the tail of a bear running down the side of the mountain. This gave me a huge adrenaline boost and rode fast to make the distance between us as great as possible.
In these trees a bear lurks….
The trail finished up with a 781ft drop in 1.5 miles. Here’s a video of it:
My phone charge cables broke in Breck, and as such had limited juice left for pictures and tracking. Which was sad because going up to and over Searle and Kokomo Pass was fantastic. The ride down was a bit sketchy…but not as bad as coming off of 10-Mile.
I passed this neat 11 foot waterfall, and as I did Chrissy, a CT racer caught up with me. I had a 3 mile and 1/2 hour head start on her…and she had done in 2 days what I had done in 6. Her first day had been 90 miles.
We rode together for a bit. She stopped for lunch while I kept going for Tennessee Pass. She caught up with me at the top. She (thankfully) goated me into doing the next two miles of trail. I stopped to shuffle my water from my secondary store to my camel-pack. I thanked her for letting me ride with her and wished her good luck on her Time Trial.
With rain and cold keeping over the area, highway 24 was not the zooming downhill I was expecting. I limped into leadville and fiqured I had done enough. There was no way for me to get to BV in time to see my brother in the AM, so I called my sister and she picked me up.
Once into Copper the trail becomes much more manageable. Still, with a weighted down bike and tired legs there is a lot of pushing going on.
I would love to come back and do the Copper to Tennessee Pass trail again on day I’m hammer’n rather than Bike Packing. I camped out at 10,480 ft…thankfully the altitude sickness was not nearly as bad, and I was able to sleep.
The only bad side to camping in the area is that you can hear the traffic of I-70. I saw not one person after reaching the 10-mile range and climbing up to my campsite. But once I took my pack off I found that the site already had a backpacking couple and several bike packers began investigating the area immedately behind me. For a while I thought the campsite was going to turn into a hostel.
When leaving Breckenridge to Copper Mountain you have 2 choices. 14(ish) miles up and over the 10 mile range topping off at 12,495ft, or a gentler approach via a paved bike path .. also about 14 miles.
I took the up and over path of the Colorado Trail…next time I’ll go around. Not so much because it’s so hard to do, but because other than scenery, there is no downhill reward. The trail is just too rough.
looking back at Breck
Looking ahead to the top of the ridge
Boulder field above timberline
Top of the 10 mile range
Copper Mountain ski area can be seen below
Dealing with altitude sickness…staying in Breck for one more day.