hey guys,
i was interested in building an object tracker using my srf05 sensor. i got an answer from CtC which i did'nt understand clearly, so any suggestions on how i can do it?
hey guys,
i was interested in building an object tracker using my srf05 sensor. i got an answer from CtC which i did'nt understand clearly, so any suggestions on how i can do it?
Tracking n object with only
Tracking an object with only one sensor is not for the newbee, but when that is said, it is fairly easy; The trick is to scan from side to side, till you note a drop in distance, there is your edge, you now see the background. Now scan back to the point where the object is, and keep scanning left right like this, and you are locked to the edge.
The trick is not to scan for the object, but scan for the edge of the object
if you need center of it, scan for 2 edges, and in between them. But that is very hard to do if tracking at the same time. Edge-scanning is quite easy, you can lock on to isolated objects fairly easy… if you know what you are doing with your scanner end servo
I think chris meant it
I think chris meant it like:
The two outer readings are higher than the 3 middles ones, you can assume there is an object there, you'll have to pan the sensor around with a servo to keep up to date readings coming.
Now the object moves:
So you pan the sensor around and notice the reading have changed, so you turn the sensor to keep the object centered.
So you'll need a sensor and servo.
Since it’s only one sensor
Since it’s only one sensor it would be damn hard to make it track objects smoothly, at least I image it would have to check few directions fast, to sense the object it has to follow and know where it is. It should use servos for that and servos may not be quick enough for your object tracking. But maybe srf005 can do much better, I may be wrong.
I think of it that way - your srf005 is mounted on a servo and it moves continuously from left to right (if it only has to track objects on the ground) at the same time checking whether there is an object in front of it or not, and when there is, for example, ‘something’ on the left, but not right it moves to the left when there is ‘something’ on the left AND the right. I hope you understood my idea.
Well said (actually well shown)
The images above explain exactly what I was saying about finding edges. --Good pictures, they show the idea of finding a “big change” in measurement numbers and thus an edge. Your code would be like:
Sweep and take a measurment every 5 clicks or so. If this measurement is very different from the last measurement, then remember the servo position number. Keep going now and look for another “big change” and remember the servo position number for that “big change”. You object is between the first remembered servo position and the second one.
The object, or the edge of
The object, or the edge of the object?
Scanning the edge of an
Scanning the edge of an object is a good way to do this, I’ve already done this some time ago, after seeing this robot: http://www.societyofrobots.com/robot_sumo.shtml
just as simple as :
object seen = move servo to left
no object seen = move servo to right
this wil allready work. it will find the left side of an object. then add some code so the whole robot turns if the servo reach it’s maximum position.
as the site above saids:
pseudocode:
//robot motion code
if scanner is pointing far left
robot turns left
else if scanner is pointing far right
robot turns right
else //scanner pointing forward
robot drives straight