PiBot

I’ve had a raspberry pi gathering dust for a few years, but I had an inkling to do something cool with it. Over the holidays, I was gifted a PiStorms kit. PiStorms is a “shield” for the raspberry pi that fits directly onto a set of pins and interfaces with Lego Mindstorms motors and sensors.

Mindstorms is a pretty cool concept, but the entire set runs $350 and doesn’t actually allow full programmatic control over the resulting creation. It’s more of a drag and drop visual programming language.

I was able to download the OS image and flash it to my raspberry pi SD card. However, the PiStorms shield requires direct power, instead of utilizing the DC Power from the raspberry pi. This required a 6 AA battery pack and a set of brand new batteries.

Once the brain was operational, I still needed to build the vehicle. Mindstorms is supposedly compatible with all of the Lego Technic sets and parts, so I bought a basic four-wheeled mechanical car for 50 bucks from the lego store. I chose this model since it appeared to have a surplus of parts and lots of exposed anchor points for modification.

After following the directions for an evening, the car was assembled (aside from the cosmetic touches like stickers, etc). There were gears and axles propelling the rear wheel, and turning the front two. I was able to modify the frame to mount two medium mindstorms motors.

Lastly, I configured a mount for the entire PiStorms / raspberry pi assembly, which is relatively heavy. Once the OS boots up and the wireless connects, PiStorms has a php frontend website to display info allow control of the motors. You can connect to the site over wireless and remotely control the motors, driving and turning the car.

Some of the challenges:

Power

Once the Pi is wired up to batteries, it absolutely drains them. 6 AA batteries in series have about 9v. When PiStorms is turned on, you can see the voltage visibly decrease – 8.8…8.7…8.6. The motors and pi will cease to function once it drops to ~ 6.5V, so there’s very limited juice in the thing. I’m considering upgrading to use a rechargeable RC battery kit, which should extend the lifetime. But for remote robots, battery power is a real issue.

Mechanical Engineering

Perhaps one of the most fascinating challenges was engineering the mount points for the motors and the PiStorms brain. The axles themselves jutted from the frame at certain angles, forcing the orientation of the motors. The motors needed enough anchors in order by maintain torque and accessibility. The PiStorms assembly had to be elevated enough from the frame to ensure smooth turning. Problem solving the mechanical and structural issues was fascinating because it was so constrained. I only had limited parts and spatial real-estate, and the solution space was three dimensions. Choosing Lego as the base tech for building the robot was absolutely essential here. It would be much more difficult to experiment with models and configurations if the parts were permanently affixed metal.

Software Control

The robot as it stands now is hardly better than a cheap RC car. It’s able to drive forward and backward and turn the wheels remotely. The feedback loop is somewhat sluggish (manipulating a javascript-based joystick, sending http posts of the web), and the tuning of the motors is rough (often it will oversteer, over-torquing the steering column). So, there’s much room for improvement needed in the software.

One crux is that robotic motors and sensors are continuous, but the simplistic software API is discrete: The PiStorms unit works by sending a signal to the motors (run for 1 second, spin at 25 rpm, slow down to a stop in .1 seconds, etc). Driving requires iterative polling of the input (every x seconds, check the throttle, translate that to a motor command, send to the motor). Of course, motors in real cars don’t work this way – there’s a smooth continuous feedback between the throttle and the power given to the drive train. The question – how can this be represented in software?

I’d like to add in visual sensors and have the PiBot drive itself using some rudimentary computer vision algorithms. A similar issue arises – how often do you poll the sensor? 100 times a second? 500? Is it possible to act (ex: turn to avoid an obstacle) upon a single view, or is a continuous model of required? What kind of data structures and overall program architecture allow this orchestration between input sensors and output motors? These are some of the interesting questions that arise in robotics.

It’s been a fun project to complete the base model, but the truly fascinating road is the one that lies ahead.

Pixel Harvest

I usually grab a selection of the best indie games each year, during the Steam Winter sale. Last year, the certified standout was Stardew Valley, an 8bit farming throwback to Super Nintendo RPGs of yore. The amazing and endearing thing about the game, beside the fact that all the programming, writing, pixel art and music was done by one guy, was the good natured charm of the game. There weren’t any dark world-ending villains forcing along a ham-fisted plot. Sure, there’s a little bit of sword slashing, but for the most part, you clear out a patch of land to plant crops, tend to animals, and wile away the hours fishing.

I’m by no means a completionist, but I spent a full year (four seasons) of gametime, growing my meager crops, renovating the cultural center in the middle of town, and catching some record-setting fish. It’s an addictive game, but not purely due the mining/crafting/exploring mechanics, like Minecraft or Terarria. Stardew borrows heavily from the elements of those games, but it’s an evolution of the genre. The biggest change is the clock. Your player grows weary in the evening, and must return to bed at midnight or soon after. If not, you’ll pass out from exhaustion, lose some of your hard-earned cash, and start the next day tired. Instead, if you follow the wise motto “early to bed, early to rise”, you’ll be bursting with energy and productivity. On top of the hourly clock is the march of days on the calendar. Each season is only thirty days. With a change of the seasons comes new weather, new town festivities, new crops to plant and harvest.

Instead of a simple day/night cycle, which passes unceasingly on in the other *craft games, the hard delineation of days and seasons gives a narrative arc to all the crafting and building. There’s only so much you can accomplish in a day. I started thinking of my days being dedicated to certain tasks. A day to clear the dense brush on the back 40, or till the soil, or forage for rare mushrooms in the woods, or spelunk deep into the slime-infested mines. If it was raining, I didn’t have to spend the half hour watering my crops and could rush directly to the mines, unless I was after the rare early-morning catch down on the shore. The townspeople also abide by regular schedules (includes store hours, and happy-hours in the bar). Most stores are closed on Saturday, so you’ll need to do your shopping before the weekend.

In the mid game, once you’ve hewn out your farm and are establishing a routine, there’s a joy to the game. You’ll see your crops blossom, and can bring your prize harvest to the various fairs. Townspeople will send you letters, and you can do errands for them and bring them gifts. You’ll learn their quirks and traits. There’s the jock and the goth and the skater and the science nerd. The cranky old couple, the perky school teacher. The uniqueness and charm of these characters is amazing, crafted with only a few lines of dialog and minimal pixel art.

The thing about all video games is that eventually the “game” part rears its head. Stardew Valley is absolutely lovely, but to truly complete the game you have to mine, farm and fish dozens of rare items. A sprawling farm entails an endless retinue of chores, from milking the cows, repairing the fence, to replanting seeds. I found myself starting up a play session only to race around, mass clicking a screenful of charming devices, watching them whirl and spit out yet more items.

It made me ponder the nature of work, and entertainment, and fun. I was spending my leisure time to play a game that was simulating work. Given, there were lots of charming touches, and all the messy unknowables and chaos of reality were ironed over. But it was still a nested tier of systems to master. All the charming NPCs were just state machines that had predilections for certain consumables. It made me wonder about why I played games. Was the game truly about escaping the daily grind, as illustrated in the opening cinematic, to revel in the freedom of the simple farming life? Or was it just a daily grind of another color?

Don’t get me wrong, Stardew Valley is an instant classic, a game that will stand the test of time. I was enthralled with the pixel-perfect little town, the planting and fishing and mining. Sometimes that life is better when its abstract memory, the wind gently rustling the leaves, birdsong in the air, and there’s not a grid of 64 yams to harvest click.

Goldfinch

If you’ve been to New York, there’s a resonating sound that perpetuates across the island. All the cars and movement reverberate against the orthogonal architecture, a low echo, like the inside of a sea shell. And when you’re there, despite all the movement, energy and money, the sound penetrates, and with it a sort of existential fear. If you’ve watched 9/11 videos, you can hear the sound, between the screams and the crumbling of the towers.

The opening of The Goldfinch is probably the best approximation of that yawning maw I’ve read. It’s a blockbuster start, and no doubt what propelled the book forward into reader’s hands. The premise is top notch: thirteen-year-old Theo Decker survives a terror attack in a museum that kills his mother, and in the chaos, smuggles out a priceless work of art – The Goldfinch.

But where do you go from there? Donna Tartt follows through with a prosaic bildungsroman, at least for 500 pages or so. First New York city and the workings of teenage angst, apprenticing with a lumbering antique furniture dealer named Hobie. Young friendships and loss, occasionally taking peeks at exquisite brushstrokes of the legendary painting. Later, in scalding Las Vegas, he lives with his drunk, gambling father, and a Ukrainian artful dodger named Boris.

The narrative world Tartt builds is exquisite. Her prose is populated with uncanny verisimilitude, from the songs playing on character’s iPods to the specific make of early Americana armoirs. The sentence by sentence structure flows easily, and the pages swiftly turn. Theo – only occasionally distorted by drugs or drink – is for the most part a thoughtful observer. There’s a dose of timidity and shyness in his interactions. He’s rarely vulnerable with his feelings. These are all acceptable, accurate character traits of one who was orphaned in a violent explosion in his youth.

And yet Theo’s passivity is the book’s weakness. In a way, its a core flaw in any first person tale. The dramatic irony that comes from a limited perspective is mostly wiped away in the direct telling. Since Theo spends hundreds of pages simply observing and describing his interactions with Boris, Hobie and Kitsey, instead of acting, his inner voice can become grating. Its the reason many readers find Catcher in the Rye irritating: hell is other people, and what worse to be stuck in the mind of another (even one as sympathetic as Theo Decker) for a thousand pages.

And while the journey Theo makes is fascinating – there’s a certain hygge to the passages in the old furniture shop, slanting afternoon sun cutting through the wafting dust – it’s cut deep by slightly off-kilter passages of Russian criminals, shootouts with gangsters, cliched high society snobs.

The novel itself is basically cut in half at 500 pages – Theo’s maturation. He returns to New York from Vegas, is accepted into school, then … fade to black. Eight years later, he’s a junkie and a conman. A number of characters are simply cut. Of course, Tartt isn’t so gauche and unsophisticated to drop these bombs in clumsily, and we receive them through the eyes of Theo, who’s properly animated enough so they fit into the world’s scaffolding. But underlying it all is the feeling that Tartt wrote herself into a corner and had to shake things up (a figurative explosion) in order to propel the book along.

After spending 900 pages in someones head, you’d think Theo would come to some sort of closure about his mother’s death, or the meaning of the painting. He doesn’t. There’s an info dump of existentialist purple prose, leaning nihilistic, pretty much every end left untied.

By the end, any passionate reader is a bit stunned. Is that it? What did it all mean? What was the significance of the painting, the drug addictions?

The closest analog, which many critics have pointed out, is Charles Dickens, who wrote coming of age tales in Victorian England, often populated with colorful characters (both rich and poor) from the bowels of industrial London. His writing were serialized, riveting as page turners. Yet who remembers intricacies or the catharsis of Great Expectations or Oliver Twist? The overall narrative arc and ultimate meaning of his stories was secondary to the thrill of living alongside fully-fleshed characters, through both the exhilarating and the drab.

It’s a fitting approach, mirroring the Goldfinch painting itself. Hyperreal, yet mundane. Perhaps even minimalist in its scope. Touches of darkness, absurdism. Maybe nihilism. A bird, chained to a perch, staring forth. Was the bird ever real? Is the painting capturing that reality, from some time in the 17th century? Or was it merely a notion in the mind’s eye of Carel Fabritius? Who knows what was his mind? All we have are his finite brush stroke, pigment and oil caught on canvas. It’s not art that stuns us, or changes our worldview. There’s no catharsis. We continue on with life. Yet there’s an enigma behind it, some shadow smudged on the wall. Did we miss something?

Lots of great art makes us feel like we’ve gained something, that we now possess a new experience. The Goldfinch (the painting, and the book), plays tricks on us, hinting at something grand. Yet when we open up the hidden cache, it’s empty. All that remains is a fading echo.

California Dreaming

This past December was the sophomore year of the Disney Star Wars resurgence, and fans and critics were generally pleased. Rogue One was an entertaining return to the time of the original trilogy, complete with Stormtroopers, Star Destroyers and Vader’s signature black helm. The key differentiator was the tone of the film, closer to a gritty war movie than the jolly camp adventure of the Lucas originals. Also missing were the opening crawl, John William’s score and signature fade wipes. So we’re left with a solid action movie, dressed up in all the mise en scène of Star Wars (the tech, jargon, lore) missing the feel of the core trilogy. From a business and marketing perspective, this is a brilliant move, broadening Disney’s Star Wars IP beyond the narrow artistic confines of the original films. Prior to Rogue One, this was all but impossible. See: the uproar over the blasphemous prequels; the Force Awakens honing tightly to the prescribed formula.

Yet there’s something lacking in the new broadened and reawakened reality. Something cynical in the ultra efficient filmmaking of the Disney-Lucasfilm industrial complex.

Thinking back to the 77 Star Wars, there was a crew of dreamers and engineers, shaggy and bespectacled. They lacked the funds of the big studios, so they improvised spaceships with model airplane parts and glue. I watched the original 77 film recently, and I was struck by those moments in-between. Not only the iconic scenes that are oft repeated (Vader stomping around, Luke’s wide eyed naivete), but the naturalistic shots of a krayt dragon skeleton in the sand, the denizens of Mos Eisley drinking and smoking exotic vices, Aunt Beru pouring blue milk, Han’s improvised frustrations, Leah’s feisty snark. It’s these non-serious in-between shots that make the universe feel lived in, that it will stick around beyond the battle between the Empire and the Rebellion. That feeling is lost from the later films, and most of the newer entries, where every moment is a life or death struggle, high intensity, and even the humor is that of soldiers, not idiosyncratic galactic weirdness.

The similarities to another California success story are striking: Apple. Jobs and Woz, hacking away in a garage with borrowed parts, their first computer cobbled together with a hand soldered board and wooden frame. Accolades, fame and fortune came later, but that first strike defined the core of what Apple would be: beautifully designed personal computers for individuals, not gray number-crunching machines. Just as Star Wars redefined the feel of space sci-fi in cinema (away from the cold techno optimism of Star Trek or 2001 to a warm, worn galaxy of adventure, populated with familiar archetypes, not unknowable aliens or pressing philosophical conundrums), Apple made nerdy gadgets the ultimate status symbol.

And of course, both Apple and Star Wars were massive hits, redefining their respective industries, entering the cultural canon, earning billions. Here we are, 40 years later, both have become institutions. Both are riding on their past glories, minor adjustments being marketed as courageous moves, but mostly just polishing and remixing the rich material of the past.

The question remains: is the magic still there? The spark that brought these two behemoths to life? Of course, Jobs and Lucas are gone. But there were others in the early days, down in the death star trenches. Disney has proven to be a responsible steward of cultural heritage (Star Wars, Marvel superheros and fairy-tales the world over). And Apple continues to bevel aluminum edges and perfect their minimalist helvetica marketing. But now they are the establishment.

The time’s ripe for another set of shaggy underdogs with zero budget and a dream.