Print Story Moment 33
Diary
By DesiredUsername (Fri Mar 17, 2006 at 03:18:51 AM EST) (all tags)
Engineering the Impossible

This diary entry is hell of dorky.



I knew it was going to be dorky and lame, but it was even worse than I imagined. I don't even know why I got it, particuarly since I'd seen part of it on the Discovery Channel.

Basically, they reel off a bunch of blue-sky projects that vary in likelihood of being built from "no way" to "yeah right". Some of the ideae are just stupid, like Stupendously Tall Tower in Hong Kong. In order to cut down on wind forces, they make it not just cylindrical but conical. Hello, a cone has 1/3 the volume of a cylinder of the same height and same base area--why not just make a cylinder that's 1/3 the height and save yourself a lot of trouble? (Answer: Because then the architect would be known to have a small penis.)

The narrator is a cheesy-voiced idiot and it is only made worse by the script he reads. Each engineering project naturally has dangers and they just as naturally want to explain how they guard against them. Explaining how the danger avoision works: Good. Giving a dramatization: Good. After the dramatization, acting like this was a real emergency and the system has proved itself even to the point of saying "The bridge is saved and engineers have proved their system works!": Stupid.

1 star because I can't give any lower number.


Speaking of blue-sky projects: What with one thing and another I've got some free time at work right now, so I've been working on adding 3D graphing to our app. We have a very flexible graphing system but the fundamental basis of the entire thing only supports 2 dimensions which has caused some limitations (not that anyone else notices these limitations, because they are used to them). I can't just chuck the lowest level graphical widget out, so I'm doing all the 3D math myself in the 3DGraph object. The graphing system itself is pretty cool and easy to work with which leaves me free to do all the fun parts. I've gotten the axes drawn, in any given angle, along with tickmarks drawn such that you can always see them (i.e. they don't disappear when you should be seeing them end-on). It all runs fast enough that I can update the display at 30 Hz for some cool animation, too. And all in Tcl! Of course, there's only really 3 points to rotate at this point...

Today I plan to put numbers on the tickmarks and get the auto-scaling working. When the guy who made the 2D system comes in on Monday, I can ask him how to get the UI elements working (there's a mouse interaction system I'm not sure what to do with). Then I'll have a 3DGraph class, but no 3DPlot class (i.e. a place to put stuff but nothing to put in the place). That should be pretty easy, though. I think that once we have the ability to make 3D graphs, we'll think of hundreds of uses. I already want to show orbit trajectories on there and the boss was mentioning one of our datasets is 4 dimensional.

(I used a rotation matrix which is apparently tres non-chic since I could barely find any info online about them. [Yeah, like I'm going to compute the rotation matrix from first principles myself.] Everybody is all about quaternions, despite the fact that nobody understands them and I couldn't really see the benefit, at least for an output-only viewing system.)


Changed the robot a bit--now it has wheels instead of tracks. It also has a light sensor, but it doesn't use it. I'm planning a light-following robot and that works best if you have two light sensors to get a gradient. Found a guy on ebay selling them for $7 with free shipping. I was about to order 3 when I realized I couldn't hook up more than 2 anyway and still have room for a bumper.

Programmed up a subsumption architecture with a parallelized output arbitration task and everything--seems to work fine. Eventually the robot will have 3 behaviors, in reverse order of priority: Go, Turn_Towards_Light, Avoid_Obstacle.

I'm thinking that when the Mindstorms NXT comes out, the 1.0-2.0 RCX bricks will suddenly get cheaper and I can pick up a couple for multiple-robot interactions or just doubling/tripling the sensor and computation power of a single robot. Kind of a hindbrain/forebrain thing where the brains communicate via IR.

< Futurama was right | BBC White season: 'Rivers of Blood' >
Moment 33 | 24 comments (24 topical, 0 hidden) | Trackback
Subsumption note by DesiredUsername (2.00 / 0) #1 Fri Mar 17, 2006 at 03:41:00 AM EST
I mentioned before that, at least in the things I've read, some are being too extreme in demanding that all inputs map directly and immediately to outputs with no internal world models being built. But IRL, sensory input can go be combined with an internal model, that may or may not result in an output.

For instance, if the robot has a Protect_Baby task, it will attack anything that gets close to the baby. This robot would not object if the baby crawls behind a wall. This robot would also not object if a wolf then goes behind the wall, but it should. It should have a model of the world such that it can figure out that if both baby and wolf are behind the wall, the wolf is near the baby and Protect_Baby should be triggered.

ANYWAY, I have another tweak I'd like to suggest: One task should not be able to unilaterally override another--there needs to be gradations. Let's say a robot has a task that monitors how low its batteries are. In the subsumption architectures I've been reading about (and I should emphasize that I'm not reading much, nor current publications) the Monitor_Battery task would have a threshold above which it triggers and overrides all other tasks to go get recharged. But that's not how the Monitor_Bloodsugar task in animals works at all.

I think a more natural way would be for the the Monitor_Battery task to (almost) always say "I could use a recharge" but say it louder and louder as the situation gets worse. When one of those messages outprioritizes all the other incoming messages, the robot recharges. The difference would be that if the robot is just idling, it can go top up whereas if it is right in the middle of something it can finish that before going.

---
Now accepting suggestions for a new sigline

That wouldn't really be subsumption would it? by Gully Foyle (2.00 / 0) #3 Fri Mar 17, 2006 at 04:07:22 AM EST
This is all IIRC. It's been a few years since I even tried to keep up to date with the literature.

Brooks developed the ideas for the subsumption architecture as a reaction against delicate reasoning systems. Yes, some reasoning is necessary to protect_baby properly, but that's not part of your basic robust, subsumption behaviour set.

I think the second example is more to do with how the layering system works in practise. Ideally, each behaviour operates on its own microcontroller. Your higher level behaviours interact with lower level behaviours by modifying their inputs and outputs directly. The degree to which behaviours at the same level override each other is a property of what they're doing to the lower levels, rather than something that you necessarily design in (although that isn't ruled out). In order to implement your system of thresholded overrides, wouldn't your low level behaviours need to be aware of the stuff happening at higher levels?

[ Parent ]
No, they wouldn't by DesiredUsername (2.00 / 0) #5 Fri Mar 17, 2006 at 04:23:22 AM EST
Right now, the arbitrator prioritizes all instructions from Task A over Task B, no matter what. My idea would be that A and B would attach their own priorities to the instructions and the arbitrator would run the highest. Perhaps the priorities would be scaled by what task they are in (e.g. the arbitrator says "Task A isn't that important, so when it screams that's really just a priority 3").

In re: protecting babies: I can definitely see the value in trying to develop a system free of "delicate reasoning". I'm just saying that can't be everything anything but the very, very simplest animals are doing. But if you are trying to build a cockroach, maybe it's plenty.

---
Now accepting suggestions for a new sigline

[ Parent ]
Subsumption is all about cockroaches :) by Gully Foyle (2.00 / 0) #11 Fri Mar 17, 2006 at 04:55:42 AM EST
In the end, for all but the simplest tasks, you're going to need a top level reasoner. It plans, based on the behaviours provided by the lower level systems (and possibly, based on the emergent behaviours that are important in a subsumption architecture). Brooks' frustration was that people were trying to solve the planning problem first, and getting nowhere because they hadn't solved the robust behaviour problem. Subsumption was never meant to be the be all and end all of robotics, but it can produce reliable, consistent systems, and you can go a surprising way with it.

How would you figure out the thresholds to use in your arbitrator? I guess you could treat your different behaviours as network nodes, and learn the activation thresholds with back-propagation... Battery dying is a negative reinforcement, but you'd need something on the other side or your bot would be forever recharging.

[ Parent ]
Just hardcode them by DesiredUsername (2.00 / 0) #13 Fri Mar 17, 2006 at 04:57:35 AM EST
That's exactly what the current "Task A outranks Task B" system is doing, just at a finer level.

---
Now accepting suggestions for a new sigline
[ Parent ]
Memory, or lack of by gazbo (4.00 / 1) #8 Fri Mar 17, 2006 at 04:45:07 AM EST
In my AI class, I was told a story by the lecturer (the awesome Noel Sharkey) about a robot built to collect coke cans and then take them to the recycling bin.  The guys who programmed it decided that they wouls strictly follow the "no internal world state" rule.

Eventually they came up with something that kinda worked, but with one slightly amusing aspect: because the robot wasn't allowed to remember anything, it had no memory of whether it was looking for coke cans, or returning them to the bin.  As such, after every movement it made, it had to look at its hands to check if it had a coke can in them, in order to figure out what ot was supposed to be doing.

Most silly.


I recommend always assuming 7th normal form where items in a text column are not allowed to rhyme.

[ Parent ]
Good for modeling Alzheimer's though by DesiredUsername (4.00 / 1) #9 Fri Mar 17, 2006 at 04:50:02 AM EST


---
Now accepting suggestions for a new sigline
[ Parent ]
Quaternions by TypographicalError (2.00 / 0) #2 Fri Mar 17, 2006 at 04:07:04 AM EST
It should be possible to represent quaternions using real matrices in some fashion, much like it's possible to represent complex numbers as real matrices. I'm not sure what the isomorphism is, though.

According to what I read by DesiredUsername (2.00 / 0) #4 Fri Mar 17, 2006 at 04:15:37 AM EST
You can convert quaternions and axis/angle rotations back and forth and you can convert qs to matrixen, but you can't convert matricii to qs.

---
Now accepting suggestions for a new sigline
[ Parent ]
The straight dope by ana (2.00 / 0) #14 Fri Mar 17, 2006 at 05:00:48 AM EST
Or whatever. A quaternion is an ordered quartuple of numbers, the sum of whose squares is one. You can think of them as a scalar and a vector, representing a rotation in 3D (and hence, if everybody agrees on the original coordinate system, a vehicle attitude. They're available in IBM floating point format in the Space Shuttle telemetry, for example).

The vector points along the rotation axis. The scalar, is (if I recall correctly) the sine of half the rotation angle, while the magnitude of the vector is the cosine of the same angle (thus enforcing the normalization constraint). There's a sign ambiguity; if all 4 components change sign, the resulting quaternion represents the same thing physically as the original one.

Can you introspect out loud? --CRwM

[ Parent ]
You get a gold star by joh3n (2.00 / 0) #20 Fri Mar 17, 2006 at 05:50:14 AM EST
And if memory serves, the reason we label axes i,j,k dates back to the days when (I think it was) Hamilton was working on imaginary numbers, and quaternions.  He called one of em i and the other two complex quaternions j, k with the fourth being a real.

Weeeeeeee!

----

[ Parent ]
Well by TypographicalError (2.00 / 0) #15 Fri Mar 17, 2006 at 05:01:32 AM EST
I think it might depend on whether or not you're talking about 4x4 or 3x3 matricii.

Also, gimbal lock and quaternions on the internet as explained by computer scientists and engineers is intensely frustrating, because applied mathematics is dumb. There's no way to get anything concrete out of that crap.

[ Parent ]
Using quaternions by yicky yacky (2.00 / 0) #6 Fri Mar 17, 2006 at 04:28:36 AM EST

completely removes Gimbal Lock from the equation. Using rotational matrices doesn't. From your description, I'm not sure that gimbal lock would necessarily be an issue with your application, but that's the reason why all the literature tends to favour quats these days. Good book.


----
Vacuity abhors a vacuum.
Gimbal lock happens with euler angles by DesiredUsername (2.00 / 0) #7 Fri Mar 17, 2006 at 04:32:26 AM EST
but, the claim is, not matrices. No proof given.

The library at work has that book, but it is checked out. Along with every other 3D graphics math book. :((

---
Now accepting suggestions for a new sigline

[ Parent ]
But what are rotations around a fixed origin by yicky yacky (2.00 / 0) #10 Fri Mar 17, 2006 at 04:52:50 AM EST

in a 3d Euclidean space, DU?

Just because the values are being represented in matrix form (because it's convenient computationally and mathematically), don't be deceived into thinking that you're not working with Euler angle equivalents. Sometimes they are called Euler matrices. The thing is, if you don't need a full 3 degrees-of-freedom, you don't need to dodge gimbal lock because you can limit the extent to which rotation around one or more of the axes is allowed to range. Matrices and quats are also used side-by-side in some apps (e.g. game and graphics engines) because quats are more computationally expensive to work with directly.

More.


----
Vacuity abhors a vacuum.
[ Parent ]
That's what I thought by DesiredUsername (2.00 / 0) #12 Fri Mar 17, 2006 at 04:56:34 AM EST
but I read the opposite and since it was talking about something like "ZXZ" rotation (twice around the Z axis?), I figured I didn't know what I was talking about.

---
Now accepting suggestions for a new sigline
[ Parent ]
I have to fight back an irrational resentment by yicky yacky (2.00 / 0) #17 Fri Mar 17, 2006 at 05:19:39 AM EST

whenever I find some technical reference to be wrong, especially retrospectively. People arguing stuff out on the internets is one thing, but written references are something else. This is an education-based and knowledge-based business. Passing down bad info is equivalent to pissing in the water supply. In fairness to your man there, he may be talking about some sub-set case for which his assertions hold true but, generally speaking, it ticks me off.


----
Vacuity abhors a vacuum.
[ Parent ]
Correction. Apologies. by yicky yacky (2.00 / 0) #19 Fri Mar 17, 2006 at 05:46:02 AM EST

It depends on the context. Your man may be right. The rotation matrices only become equivalent to the euler equivalents in certain specific circumstances (rotations around arbitrary aves with the object's local centre as the origin ...). I was assuming this to be the case, but it certainly need not be. I've probably misunderstood and thoroughly confused the issue. If you stick to using rotational matrices around X, Y, and Z for visualisation purposes, you should be fine.


----
Vacuity abhors a vacuum.
[ Parent ]
what about the still ? by sasquatchan (2.00 / 0) #16 Fri Mar 17, 2006 at 05:03:48 AM EST
Maybe I missed the diary, but did you manage to distill your meade into a more pure form for alcohol torches ?

(And I forgot to drag this up last time, the caveman chemistry guy does talk about building a still for making an alcohol torch.. Alas, his book isn't free on the internet anymore. Damn. When did that happen ? Maybe I should have leeched all his pages when they were, damn.)

Not yet by DesiredUsername (4.00 / 1) #21 Fri Mar 17, 2006 at 05:59:09 AM EST
I had forgotten this since last time--the solution stays cloudy until it suddenly clears, which it did this week. I think we'll have time this weekend to do the distillation.

You should have purchased the book like I did.

---
Now accepting suggestions for a new sigline

[ Parent ]
Cheap used RCX;s would be cool by georgeha (2.00 / 0) #18 Fri Mar 17, 2006 at 05:32:38 AM EST
I got bored with my Scout, 600 bytes isn't enough for anyone.


Oh yeah, those sub-RCX ones suck by DesiredUsername (2.00 / 0) #22 Fri Mar 17, 2006 at 06:40:50 AM EST
Don't they have other limitations too?

I can't believe the Lego store is still charging $119 for a new RCX.

---
Now accepting suggestions for a new sigline

[ Parent ]
that show by tps12 (2.00 / 0) #23 Mon Mar 20, 2006 at 03:10:03 AM EST
I saw the one about building a transatlantic tunnel. Whenever you started to think it might be feasible, they'd throw something else at you—"to be economical, the train would need to travel at Mach 3.5" or "construction would take thirty years, at a cost of $17 trillion a year"&mash;that made you wonder why they even bothered producing the show it was all so far-fetched. One highlight was the small collection of sci-fi novels featuring such a tunnel (IIRC, one of them was titled simply Transatlantic Tunnel!).

Yeah, I saw that one too by DesiredUsername (2.00 / 0) #24 Mon Mar 20, 2006 at 03:20:29 AM EST
It's a good show to have in the background while you are doing math or playing with Lego, but if you devote more than 10% of (10% of) your brain to it, millions of holes appear.

I remember one objection to the transgibraltarean tunnel was that it would be "impossible to vent the car exhaust". These people have never heard of fans and ducts? Or one-way valves?

---
Now accepting suggestions for a new sigline

[ Parent ]
Moment 33 | 24 comments (24 topical, 0 hidden) | Trackback