Smooth Object Tracking

foureyes.bas (1932Bytes)

I was looking for a way to have a robots head follow something or someone around. The best results I found were the ones using a camera, but these are a bit expensive to my taste. I've seen some robots that have a servo with an IR-sensor on top that finds either the left or the right edge of anything you put in front of it. I toyed around with that, but I got frustrated with a few things.

If you follow the left edge of an object, the robot allways seem to look slightly left past the object instead of in the middle. Also:When the edge is detected, the servo goes from left to right and back between detecting the object and looking past it.

So I came up with the idea to have two IR sensors inside the head that can move (rotate) by themselves: independant of the head. The sensors detect the edges and provide information as to whether to turn the head left or right. The head doesn't need to move back and forth as much to detect the edges, giving it a much smoother object tracker.

I wanted to do this with a picaxe 08M to make "smart eyes". The bots mainboard can than communicate with the 08M to obtain more info than just the range from the eyes. but of course I had to try it out first. Also: with the 08M hooked up to 2 servos and 2 analog sensors that leaves only 1 input pin and no outputs. Oh well.

 

This test setup was done "the Frits! way": i.e. with paintsticks and double sided tape and a few paperclips.

The top servo pushes the eyes outward and pulls them inward. The bottom servo rotates the "head".

The algorithm is simple.

 

  • Pull the eyes inwards and turn the head in the direction of the eye that detects an object.
  • If both eyes see an object start pushing outward
  • Turn the head in the direction of the eye that detects an edge (=no object in sight)
  • If both eyes lost sight of the object, go back to pulling inward.

foureyes_1.jpg

The servos are a bit jerky, but the same servos work fine in Edward, so it is probably due to lack of caps or underpowering of the servos.

As you can see in the video (sorry for the poor quality) the eyes are moving back and forth, but the head is steady.

Future improvements

 

  • Make it smaller!
  • Put the eyes inside a head so you wont see them moving so much.
  • Expand the program to determine object width or width of a possible escape route for the bot
  • Put everything in a small independent package. I want this to become an "intelligent" sensor you can just hook up to a bot using serial or I2C or something.
  • Add vertical axis

 


foureyes_2.jpg

https://www.youtube.com/watch?v=xMbaO9pvQ4s

Ohh

Hell yeah! -A repost! I get to re-respond!

Wait, what did I say in the first place? Something about this being great or something… Keep it simple, stupid? I dunno, something like that.

Aha!
I’m going to end up stealing all your ideas, I fear… I’ve been using single-sensor edge detection, and have also found the constant overscan-then-backtrack annoying, especially as I have a camera mounted too. I’d been trying to work out how to use two adjacent sensors so that I could keep the pan unit (and thus camera feed) steady until one lost signal, which I’d then interpret as motion and start tracking again, but this looks like it’d work a lot better!

Stealing?

Hahaha! THAT’s not stealing. The stuff that folk post around here is FOR you to “steal”! The hope is that you will take it, better it and come up with something for ME to steal!!

It’s your LMR, too!

Not stealing

I agree. Please make it work even better and post your ideas for us!

BTW as was commented at the original BLOG post: It should work better if you mount the sensors vertically because it has less interference trying to detect the edge.

Building it now…

Hey mint,

I am building a version of this sensor as we speak. I got it quite a bit smaller but still quite limited to the servo size. Alas, no money for micro ones… At any rate, I will post what I got as soon as I get her running.

–And I could not agree more about the 08M thing… It would have been sweet to have a stand-alone unit with just a couple of output leads. I guess a 14M isn’t too much bigger, but a little tiny 8-leg guy and micro servos would be a lot cooler.

–Much love for posting the code.

Micro Servos

I don’t realy know what the micro servos cost over there, but the servos I used are €5.00 (about $8). Don’t know the name for their size.

Now these aren’t very good quality, but of the 8 nylon gear servos i bought for €5 each, none broke. I also bought 2 metal geared servos the same size for $16 a piece (excl shipping) and one of them broke the first day.

Can’t wait to see your sensor.

Just got back to this, it is
Just got back to this, it is still billiant! Cant believe no one has copied yet!