Monday, March 06, 2006

Robot Z

{Some things I wrote down last fall, which I discovered in transferring files to my beautiful new IBM Lenovo T-43 something-or-other; some basic psychological attributes for the robot, once we get around to it. Examples of my thinking, basically.}

{edit on March 8: I see these things, all the different behavioral routines, as being linked to sinusoidal cycles over time. In the way it's described below, 'priority' is like amplitude of these cycles, and whichever cycle has the greatest value at a given point in time will have highest priority. So, on average, a large-amplitude cycle will have highest priority, though momentary priority will depend on the various phases and frequencies of the different cycles. It's the same way we work: Eating is a large-amplitude cycle, and when you're approaching the top of the cycle you feel very hungry, and so eating is top-priority. When you've eaten, the momentary value of the routine will drop down so low that other, lesser routines with smaller amplitudes will have a chance to dominate, and you can go cycle through the blogs like you have to do every hour or so, or you can check to see what work needs to be done. Etc etc, whatever.}

In all of these basic behaviors, an important aspect must be some form of ‘inhibition of return’; once a specific behavior-event has been completed (each has some specific goal to satisfy), probably two things should happen. One, the priority of the behavior should drop, though it should not disappear. And two, the conjunction of location and behavior should somehow be inhibited; that is, the behavior should be made even less likely in that particular location. So, in conjunction with the primary floormap which is used for navigation, there could be parallel inhibitory maps which act as ‘obstacle gradients’. That is, open navigable spaces could be made more complex with, for example, low-amplitude ‘obstacle’ Gaussians placed at the location of behavior fulfillment. Over time, these Gaussians could drop in amplitude until they disappeared, leaving the area free of inhibition.
Also, some time limit or impatience should be imposed on all behaviors, and failure should also result in some, maybe lower amplitude, inhibition of return, to prevent the robot getting stuck in difficult or impossible situations.


Basic Behavior:
Rule 1: Love Green, Like Blue, Hate Red
This should be high priority with low frequency. Color-major content would be defined as some threshold proportion of the color histogram for a given tile; e.g. 25% at colormap value #25.
If green-major content is detected in one of the visual field tiles, rotate to move the content to the center column, then move forward until a) an obstacle is encountered, b) some proportion of the visual field contains green-major content, or c) the content is no longer detected. When a) or b), begin textural analysis, record position. When c), switch to next high-priority activity. {b) should be checked before a}
If blue-major content is detected in the center tile column, move forward until a), b), or c). When a) or b), carry out textural analysis and record position. {b) should be checked before a}
If red-major content is detected, move backward until a) an obstacle is encountered, b) the content is reduced to some proportion of the visual field, or c) the content is no longer detected. When a), b), or c), rotate toward the strongest summed green/blue signal and switch to next high-priority activity.

Rule 2: Like Andrew’s Shoes
This should be mid priority with mid frequency. A specific module will exist for liking Andrew’s shoes. This will consist primarily of two parts. The first part will be a pattern recognition system, trained to recognize textures, colors, etc. which correspond to the sets of shoes Andrew owns.
When the visual system thinks it has recognized an Andrew’s shoe, the second part of the module will commence. This will consist of an action phase. First, the robot will approach the object until it occupies some proportion of the visual field. Then the robot will be compelled to take some certain number of images of the object, each with some set mathematical distance from the other; that is, while maintaining the visual field proportion of the object, the robot will try to take images at different angles. Once it has reached the determined number of images, it will give some ‘satisfied’ signal (maybe a sound, or a blinking LED?), and switch to the next priority.

Rule 3: Seek out Green
This will be relatively low priority and low frequency. It should serve an important function however as a source of goal-oriented roaming. Updating the floormap will in itself be a basic behavior, but it will be of lowest priority. Seek out Green will involve creating a path to a nearby green object which has earlier been catalogued. Once this is done, minimal analysis will be done, and checked against the existing profile. Then, another nearby green target will be selected and a path created. This should continue until a higher priority behavior interferes, until all green objects are visited, or until the robot gives up due to the behavior specific time limit.

Rule 4: Orient
This would be a low frequency but high priority spiking behavior. The robot should periodically check its internal map orientation against its compass; if there’s an error, it should reorient to correct its position.

Friday, February 17, 2006

Songs for you

Argo: It's late.

Bellboy: I know. What's it doing now?

Argo: It's turning in that wide circle again.

Bellboy: Tell me when it stops.

Argo: Okay.

Nina: Why did you build this thing?

Bellboy: I'm not sure. I felt a calling.

Nina: Can you remember anything specific, about the calling?

Argo: Was there a dream, Bellboy?

Bellboy: I did have a dream...

Argo: It's stopped.

Bellboy: Is it watching me?

Argo: Right.

Nina: I think it's creepy. Why does it watch you like that?

Bellboy: It likes me. I programmed it to like me.

Argo: What does the red light mean?

Bellboy: Is it flashing?

Argo: Right.

Bellboy: Fast or slow?

Nina: Slow.

Argo: I think it's fast.

Bellboy: Slow means it's waiting for something. Fast means it's getting impatient.

Argo: It's almost eight o' clock. Ms Sandy will be here any minute. I hate that old cow. You should program that thing to nip at her heels or something.

Nina: You could tell it to fall in love with her shoes. She always wears those horrible green slippers.

Bellboy: Everybody get ready.

(Dr Walmarto enters)

Dr Walmarto: What is that thing doing with my hat? That's an expensive hat!

Argo: It's going in the circle again.

Bellboy: Tell me when it stops.

Dr Walmarto: Will someone get my hat from that thing? I can't go out into the Fog without my hat. Without my hat, I'd eat a cat, and a fat one at that.

Nina: It likes orange, who am I to tell it what it likes?

Argo: Why did you program it to like orange?

Bellboy: Why do any of us do the things we do? Why do I like asparagus in my chili? Why does Sñr Pluto like to have his breakfast in the corner by the big window overlooking the railroad? Why does Ms Sandy let you poke her in the eye?

Dr Walmarto: Why do I feel such deep love for my father, when he treated me so...

(Dr Walmarto leaves)

Argo: We are what we do, and we do what we must, and we must as we're made.

Nina: That's very poetic, let's go sneak off for a while.

Argo: I have to get to the kitchen, it's eight.

(Argo and Nina leave)

Bellboy: Now, Robot! Sing, sing to the turning of the clocks!

Wednesday, February 15, 2006

A Robot Designed by Ethan Martinez

Since we haven't had any new robot posts in a few months, I decided to post a picture of a robot. You know, for inspiration.



I don't know the guy who made this personally, but I took it off of this site here. Pretty neat stuff!

Tuesday, December 20, 2005

where to look?

Here's a rough draft example of a routine which would find interesting locations in an image, locations on which to fixate for more in-depth processing.
fixseq
(also necessary are normalize and bubble)

The input image address is on the top line. The image should be RGB format (not colormapped), so should be .jpg, .tif, .bmp, etc, though eventually I'll probably switch to indexed color images in order to cut down on the amount of work to be done.

The basic parameter here, mainly relevant to the size of your image, is the variable num2. This determines the size of a second-stage square tile, in which the location weights are calculated.

Further down, around line 92, is a formula for combining different derived feature maps (including local contrast, brightness, color saturation, and orientation anisotropy). This can be replaced with anything at all, though what it's set at seems to give interesting results.

This should run anywhere (in any relatively recent Matlab version, I mean), with just two external functions (normalize.m and bubble.m). If you put in a high-resolution image, be prepared to wait a few minutes. Right now, high-res images give best results. The outputs are in display form:
1. the input image,
2. the location window weights
3. combination of 1 and 2
4. a sequential step from high down to low weights. A little white square will be drawn around the most "interesting" location in the image, then around the next most interesting etc, with decreasing square brightness with decreasing interestingness (just as an illustration of what's happening, see).

Use this image and don't change the script around, if you want to see good results.





Also, this thing isn't commented or explained at all. I wrote it all today and yesterday, and keep changing it. This is just an illustration of what can be easily done with Matlab and some spare time.

Thursday, December 08, 2005

Every robot needs brains.

A simple, low-power, cheap, but pretty powerful little microprocessor is the MSP430F447. I have experience with this gal, and she's easy to use, and the tools needed to program and debug her are affordable to little guys like you and me! Interfacing lots of peripherals (like cameras!) are a simple task, and since it's a Flash-based microprocessor, you can code and recode one of em a million times. Even monkeys could eventually get this thing to work.

You can check out the data sheet here: Data Sheet.

Wednesday, December 07, 2005

Camera to computer?

Okay, maybe not tracking, not just yet. First, we need to get a simple little camera hooked into some simple image processing scripts, however indirectly, so the processing can be done in real time. Here's an example of a little camera: ITM-C-328
That thing looks pretty simple! I don't know what to do with it, though. We could also go a more prefab route, though I am hoping to acquire some technical skills here so we're not going to be making this thing out of packages from Bestbuy Store.

Resolution is not an issue. High resolution details are complicated and far off in the future. Most animals deal in low (relative to humans) visual frequencies anyway. In fact, low resolution is better because it'll be faster. I want to start by taking images in from a camera, periodically, and computing saliency maps from these images. There are lots of ways to do this; you could make up a new way every day, which probably is what will wind up happening. Anyway, these maps will be computed in 9 tiles across the image; whichever tile has the most salient content (e.g. the most saturated green) will be the target tile.

Okay, so we have a target tile! This is where the so-called tracking would come in. Now, I'm not talking about having the camera track motion, that's another thing for the far-off future. All I want is for an image to be acquired, analyzed, and for some sort of response to be made; a little motor can spin, or a light can flash, anything. Once we get good at this, we can attach the little motor to the camera, and if one of the leftmost tiles has a lot of green, the little motor will turn the camera a few degrees to the left, maybe in steps, until the green content is in the center tile column. I figure we'll reserve the more sophisticated routines for the center column, or maybe just the center tile. There, we can do pattern classification and recognition, neat stuff which should only have time wasted on it if something salient has been acquired.

Okay, so, 2 first steps:
1. image-to-software
2. software-to-response

I don't think it gets more basic than input/output. We are starting from Zero.

Monday, December 05, 2005

What is it?

Here's the idea: We all know that robots are the future.

Someday they're going to be the ones running things, whether we know it or not. They'll mine the asteroids, they'll maintain the orbital elevators, they'll manage all of our information networks. They'll probably grow our food and cook our dinners too, not to mention fighting in our wars and spying on our enemies.

Considering all of these things, wouldn't it be a good idea to be in on the ground floor? Someday, when our Robot Masters are looking down at us, wouldn't it be nice if they could look down at some of us as Robot Forefathers? Wouldn't you like to score those extra points? I sure would.

For that reason, Murf and I have decided to combine our complementary knowledge bases and build a robot. Of course, it may take a little while, as I'm sure there are some tricks involved in building robot #1. Here, on BRCL, we'll exchange and expose and synthesize our ideas as we make slow progress.

Soon, we'll start to lay down plans. My next post will detail what I've decided is step #1: a tracking camera.

Welcome to the World, Robot

Excellent! Our robot now has an internet presence! It will seep, slowly, from the virtual world into the real, from vague ideas and rambling proposals into wires and cameras and motors and wheels and line after line of code and even Tazers!

Online First Entry Test

Hello Andrew. I hope we are up and running!