Smooth Object Tracking (has been moved)

I was looking for a way to have a robots head follow something or someone around. 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.

Moved the content of this page to the tip/walkthrough section. here

 

 

Damn good idea
This is damn good KISS engineering! I love simple things! -It’s going on the “big bot” I think… Quality

Really cool, great idea!
This is awesome, the idea of tracking the object center with 2 sensors, even sizing it. Gotta try this soon.

Great work! Excellent

Great work! Excellent tracking system. What is the effective range of the IR sensors?

Once mounted on a bot will your algorithm include?

  • if combined angle gets smaller move forward
  • if combined angle gets larger move back (or attack?)

Brilliant thinking!Are you

Brilliant thinking!

Not only smoother & faster, but you can also see objects size in same go!

Are you not posting this a s a walkthrough? Then I will link to it from Locking on objects - and you can link to that, so it will be a good knowledge base all together.

Very, very nice thinking, hats off, 10 point, this one is original and new, this one will be copied :slight_smile:

 

PS: I only think it is “2 eyes”, just to be more technical correct.

 

Walkthrough

I’ll post it as a walkthrough as soon as I 've cleaned up th code. (sometime this evening)

PS: Only a true techie would call it “2 eyes”.

Range

The effective range is about 60CM. not a lot: i know. But if I can fit it in a very small bot it’ll be enough.

I’m not really happy with the IR-rangefinders. They have a pretty narrow beam, but their ranging signal is somewhat unstable. the ultrasonic ones are much more stable, but have a very wide beam / detection angle.

BTW: if the combined angle is wide: There is either a large object at a distance or a smaller object very close.

I meant relative to previous

I meant relative to previous sample of object. ie. If combined angle compared to previous sampled combined angle is larger - the object should be getting closer… :slight_smile:

Range

I see what you mean.

but don’t forget. The IR range finders also tell the range to the object. So it’s not that hard to find out if an object is getting closer :wink:

Great ! I have not used

Great ! I have not used those before. It sounds like you are closer to a form of “Object Identification”!<o:p></o:p>

Where a particular object width @ a particular range could be listed or inventoried:<o:p></o:p>

For example, a soda can could be matched 4 cm wide @ 24 cm distance, and since your eyes are fixed points the ratio will be constant. Your soda can ratio will be 6 in this case. Now just make a table of things you want to identify.<o:p></o:p>

Object Width To Distance Ratio <o:p></o:p>

soda can 6
ball 3
cat 10 <-- ok non symmetrical objects will be prone to error :stuck_out_tongue: <o:p></o:p>

<o:p> </o:p>

Agreed. However, just for

Agreed. However, just for the record:

A) The IR-sensors are non-liniar in the range

B) The wole setup will render everything non-liniar (The eyes, for instance, should have one upside down to match the other)

so… you will have to throw in some reality on behalf of theory.

This may assist you: https://www.robotshop.com/letsmakerobots/node/316

I can also recomend potmeters, speakers and placing eveerything on a cardboard and drawing distances in the test setup.

Finaly I can recomend first making an obstacle avoider, and then just reverse it - that sometimes is inspiring!

**Non linear in what way? **

Non linear in what way? What kind of IR modules are they?

 

Making Linear Sharp IRs

There was some math bits that someone put together that took GP2D12 readnigs and made an output in inches. The formula was something like :

(e^(-(IR-VAL/8) / 555.4619) x 42.1806) + 4.6301

where the IR value returned was a value between 0 and 32767 for that processor. This would be a starting point on developing a similar formula for your micro (which may not have floating point or needs to substitue 2.718 for e) .

I think I’ve seen other formulas too, for linerizing Sharp IRs

interesting … a

interesting … a substitution lookup table might be another way to go

it would would be fast to lookup
and would not require floating point

just some memory, testing time and a little data entry :stuck_out_tongue:

stability

I use the GP2D12 ( or the GP2D120), but those IR-sensors are hard to get a stable signal from. I’ve been searching the web for ways to stabelize them, but its not easy. I’ve tried a few cap configurations but they’re still unstable

In the setup here there connected directly to the PicAxe 28 board that also controls the 2 servos from one 4.8V power source. When an object is in sight, the reading can sometimes jump around between, for example, 120 and 130. That’s a lot in terms of inaccuracy. Especially if you’re going to use those values to calculate width.

I agree that one sensor should be upside down, because the detection is not in the middle between the LEDs. Its right at the little dot / dent on the rangefinder.

I’m still looking for good accurate range finders with a narrow beam. I like the laser rangefinder by Oddbot, but I’m not sure I can make one small enough. Right now I’m considering trying out lens configurations on a Frits!LDR setup.

Sharp IR orientation
There is a Sharp App note that recommends (pg 4) the GP2 sensors to be mounted vertically if detecting targets with primarily vertical edges, to lessen any possible triangulation discontinuity errors.

right

Right. I’ve looked at that doc before, but apparently not too well. I’ll have to change the setup and try it out.

(I’ve moved this page to the tips section btw)