this is probably not the right place to put this

  • 🐕 I am attempting to get the site runnning as fast as possible. If you are experiencing slow page load times, please report it.

Smokedaddy

Finer than frogs' hair
Deceased
Retired Staff
kiwifarms.net
Joined
Mar 10, 2013
but WHAT THE HECK. It involves a building toy enjoyed by all TRUE MEN, which means me and some guy in Virginia whose name I forget.
Anyway, both of us like to play with them, although our styles differ. My particular playtime modus operandi has computers and network stuff stirred in, so lacking a better place I just stuck this post in here. I think i may have blurbled about this in an earlier incarnation of the forum (or, heavens forbid, this one) but then I may not have, so DEAL.

Herewith, I cast like pearls before you:
To Ride The Elevator
a saga of bricklike passion, told to you via the medium of Legos
(insert obligatory shoutouts to Lego, Hasbro, and Adam & Eve here)

First, a little backstory. I am going somewhere with this, so please bear with me:

Several years ago, on a forum where I was a regular, a new user popped up. His first post was a long, long screed about how Jonah Falcon's penis wasn't as long as touted, and his own method for estimating length based on holding your elbow at a 90 degree angle while holding a #10 envelope . . . it was really, really weird. The inhabitants raised a collective eyebrow, and it was pointed out to him that you seem a little obsessed with another guy's weet, Pyfagoras, and nobody here particularly cares. He took offense at this, and for some reason fixed his sights on me. A flame war erupted, nature took its course, and he stomped off, vowing vengeance and weeping blubbery tears.

It turns out the guy owned (and probably still owns) a monster truck(!), and drove it at monster truck shows. I found a clip on YouTube of some backwater TV station interviewing him, and posted it to our YouTube group. There was much holy-shit-he's-weirder-than-we-thought-ing and much hearty laughter. Then the guy noticed where all his YouTube traffic was coming from, and stomped back into the forum, threatening legal action (for linking to a YouTube video!) More laughing from the populace. More legal threats from him. Our webmaster finally got tired of it and had his lawyer tell the guy to shut up, and nothing was heard from him since.

Much like CWC, I sought to recreate a chapter from my past with Legos. Instead of focusing on women that I wished had been my girlfriends ten years ago, I made him my subject (somewhat indirectly, but hey). Instead of my high school, I made a model of his truck. OK, not really -- it looks almost exactly nothing like the truck, but it does have the same name: Thunder Beast. It makes thundery sounds and shows lightning bolts around the name on its LCD screen.

(Actually the only thing it has to do with him or the whole sordid tale is the name of his truck, but since playing with Legos is supposed to be about reminiscences, I decided to throw that in there. Plus, it's a funny story, at least to me.)

This is a not-quite final version of Thunder Beast 7.0 'cause I didn't have one of the working version taken in decent light. (Sharp-eyed aficionados will recognize the rare limited-edition black NXT CPU.) But this is sort of approximately what it looks like:
tb74-19-640.jpg


To get it to actually work (after much trial & error), I had to move the mag sensor and accelerometer up and back to minimize electromagnetic interference from the motors. (You'll notice in the above pic they're sitting right over the motor coils.) The ultrasonic proximity detector was seeing the right-hand wall long before it saw the left, so I stuck it in the middle. The red LED is on the light detector module. Here is the working version, seen in the dark (for maximum drama): THUNDER BEAST 7.0j:
blackerbeast640.jpg


Instead of fantasizing about high-school reunions like some people try to do with Legos, or driving in monster truck shows like others do with stupidly-named monster trucks, the modern, high-tech Thunder Beast has one thing on its tiny mind -- but it's a practical thing. It wants: TO RIDE THE ELEVATOR.

This is a sort-of-approximately-accurate (sort of) representation of the upper five floors of my apartment building:
hqhallsagin_zps3e434965.jpg


The first floor has the lobby and uses a different layout, then there's a basement with the laundry and stuff that is just weird and I try to keep the thing from ever getting down there. The first floor, though, it recognized because that's where it wants to go. (Or rather, where I want it to go. As anyone who has ever tried to program a computer can tell you, they never do what you want, only what you tell them.)

The four units on the ends of the "H" have two bedrooms and a balcony that wraps around the corner. (The view from my end is pretty nice, 'cause I'm facing downtown from several hundred feet above it. The neighborhood steeply climbs the mountain just north of the city.) I'd post some pics to make you all envious, but that would sidetrack things from our Lego tale.

Thunder Beast (the Lego version, not the monster truck) is supposed to be able to find its way to the lobby after being placed anywhere on one of the upper five floors. It searches for a table next to a couple of couches; if all is successful, it crawls under the table and goes to sleep. It measures the light level to guess when it's arrived, 'cause the lobby is lit 24/7 but it's dark under the table. it took some tuning, but in practice it ended up working pretty well.

Obviously the thing can't push elevator buttons by itself, it has to rely on the occupants of the building to do that for it. It is infinitely patient, however, at least as long as the batteries hold out. Here is how it works:
  • For starters, you (or rather, I) take it someplace on the upper floors of the building, point it any which way, and run the program.
  • It uses its magnetic compass to align itself north, and rolls forward until it comes within a couple feet of a wall.
  • In case of an oblique hit, i.e. it sees a wall on one side only, it rolls backwards and tries to realign. Repeat the previous step until we have a nice, clean north wall.
  • It could be the north wall on the west side, the east side, or the middle. The next thing it does is attempt to measure the hallway by turning around and seeing how far it is to the south wall.
  • Anything less than 15 feet means it's in the middle of the 'H" somewhere. Anything greater indicates one of the legs of the "H". If it's in one of the long legs, it then turns around and drives halfway back, so it's now one one side or the other of the middle (short) hall.
  • In any case (west, east, or middle), we now need to find the exact (more or less) center of the "H". It rotates 90 degrees to face west and drives forward until it sees the wall. It then turns completely around (180 degrees) and measures the distance to the east wall. Another 180 turn and moving forward exactly half of the distance just measured puts it right in the middle. North is a 90 degree turn away, and it's sitting right in front of the elevator, not more than about 7 feet away.
  • At this point it waits, pinging the ultrasonics once a second until the elevator door opens. When that happens, it rolls forward until it is about two feet from the north wall again -- only this time, the north wall and the bot are inside the elevator. It rotates 180 degrees again so it's facing the door. (I once left it running around the halls and went back inside my apartment to answer the phone, figuring I'd be out in a second (wrong) or that it's find its way downstairs and ping my cell phone. Instead, someone screamed when it got on the elevator with them.)
  • It now becomes a problem of what floor we're on. It watches the z axis of its accelerometer for a positive-steady-negative transition (going up), or negative-steady-positive (down). It checks its clock during the steady state to try guessing how many floors, but you can never be sure.
  • When the doors open again, we've arrived -- somewhere. If the movement wasn't upward, it'll roll forward, looking for a wall. The basement doesn't have one in front of the elevator door, so it does a hasty about-face and tries to catch the lift before the doors close. (If unsuccessful, it goes back to waiting in front of the door.) Whether we make it back on right away or not, at least we know exactly what floor we're on.
  • The lobby's a little tricker because there is a wall in front, but a right turn won't see the west wall for a long way. This is what we want; victory is near. (More lobby fiddling explained later.)
  • It'll check every floor it hits as long as the movement is downward (unless it saw the basement, when it checks the next stop regardless). Lather / rinse / repeat enough times and eventually the lobby will materialize before our wondering sensors.
  • This is getting tiresome, so suffice it to say it looks for a certain corner of the lobby where there's an end table between two couches. The lobby is lit 24/7, but it's dark under the table. It can usually drive right up do the thing by the usual measurements (with the advantage that we already know how far to go to be in range). When it thinks it's arrived, it rolls forward slowly, ignoring the proximity sensor and waiting for the light to dim, i.e. it watches to see when it's in the shadow under the table. In practice, this has never failed.
  • It then sends a ping over bluetooth, where hopefully my computer and/or cell phone are watching for it. There's enough oomph in the bluetooth to show up in my room a few floors up, which I was kind of nervous about at first. After announcing victory, it goes to sleep and the program terminates.

SOME FUN

It sends a different squawk over bluetooth if the accelerometer sees something zany (i.e. it's tipped over) and can announce a couple of other error conditions (low battery, hopeless confusion). Once it was roaming around and someone had the door to their apartment open; it dutifully came in, innocently measuring the distance to the wall, but the occupants did not take the big, broad flexible view and reacted with some consternation. I lost it once, too, when it said "the battery is going out" and I had no idea what floor it was on. (It was of course in the last place I looked, namely the top floor.) I think a lot of the reason it works as well as it does is that most of the elevator traffic is going to either the lobby or the 2nd floor, the two exits to the building. I'd say the current version succeeds about 90% of the time; the mechanics are still a problem, trying to come up with something that can make tight turns in place but can make it over the crack in the elevator doorway. The next version has its running gear almost finished; it'll be a 4-wheel-drive with front and rear differentials and should be able to turn around in its own length. We shall see. After that I plan to make models of girls I wished had dated me in high school so I can pretend they are still interested, but I have no idea how to program that. Women are as difficult to simulate as they are to live with.
 
I think I'm going to have to make several alternate accounts to like this multiple times.
 
MysticMisty said:
That is really cool! How long did it take to create the program?
Hard question . . . probably about four hours to rough it out, but testing the bastard was a slow process (run the bugger, wait for it to screw up (could be a while), try to figure out why, repeat ad infinitum) and occupied bits of three weekends; say six hours total. I miss the days of NQC ("not quite C") for the original Mindstorms brick. You could make that thing walk and talk with almost zero effort.

There's a new version out, so my NXTs are outdated -- however, the tugboat won't take the strain, so it will wait.
 
Back