Object detection

okay guys, after 2 weeks , i got time to do something ....i tried to make a object detector with an srf05

here's my logic

take readings from srf05, convert them into cm measurement, the servo keeps moving from 75 to 225 and backagain and loops, then if the srf05 reads anything below 10 cms(an object), it assumes that it is the object and the servo stops moving and if the object is removed the reading increases and serovo keeps on moving again

that is pretty lame but it is logical

now i face a couple of problems

1. i hav no idea how to programme it do that...i suck at programming

2. even if i could do the above step, how will i implement it in my moving robot

if u guys could help me, it would be greatly appreciated

 

What processor and language

What processor and language are you planning on using?

Fritsl posted on seeing what robots sees, which might help  you out.

Also try searching the site with keywords like ‘object detection’ and ‘srf05’ and see what you find. Take time and learn what you can and then try something out. Post when you have tried something and ask for help if you have problems.

The are no shortcuts, you

The are no shortcuts, you need to learn to program.

Agree

See what robot sees will help you a lot. You will quickly find you are not looking for objects but rather big changes in distance which show edges. Just a couple thoughts, there is no need to convert to CM or inches or anything --this is just an extra step that takes thinking power. The robot is simply comparing numbers and does not know or care if those numbers relate to some measuring system that humans use. Like everything, you need to break this down…

Code to sweep the servo

Add a sonar check at each position

Make sure this works with debug or serial monitor or whatever

Add a system that compares each range as it comes in and keep “remembering” the biggest or smallest one --You won’t really use this but the system of “remember the last measurement and compare it to the measurement now” is very important

Do the same thing as above but code it to react only when the change is bigger than a given number --blink a LED when this happens

You have now coded an edge finder

Repeat this “edge” finder code but sweep the servo the other way and find the edge on the other side.

Your object is in the middle of these two positions.

Few thoughts

’Your object is in the middle of these positions.'

Not allways, that depends on what the changes is distance are. If they are small distance ==> big distance, then you are standing in front of an opbject. When they are big distance ==> smaller distance, you are standing in front of a gap between two objects (or walls).

 

'code it to react only when the change is bigger than a given number’

This is not always ideal, e.g.: if the robot is standing in front of a big wall, the changes in distance between measurements will not be that big (if there ar enough measurements), so the robot won’t see any danger and crash into the wall. So there should be a line of code in the program that reacts to small distances instead of big changes in distance.

 

@phozon: You will not learn anything by just asking for code here! Most people on this website started there robot-experience from scratch and got to where they are now by experimenting. So I suggest you start writing code and ask questions about problems you run into along the way. We’ll be happy to help! After all, there was a time where you couldn’t walk either :wink: