Obstacle Gap detection..

Hello .
I m trying to determine the best way to detect If in front of my "Tank" there is an Obstacle OR a gap.
And if there is gap to detect how deep it is OR if it is an obstacle how high is.
Below there are two drawings.
My first question is....
what is better to use
a)one ir sensor (A) that pan and tilt to detect the above "dimensions"
b) one ir sensor (A) and a 2nd ir sensor ???

Thnx in advance !!!

I would go for using two sensors, that way there is no delay at looking at the two situations.

Thnx Grumpy_Mike for your reply. :slight_smile:
There is any way to calculate the height of an obstacle using an sharp ir sensor and an tilting servo (verticaly scann) ???
Thnx again !!!

There is any way to calculate the height of an obstacle using an sharp ir sensor and an tilting servo

Well if you know the distance and the angle then simple trigonometry will give you the height.

The tangent of the angle of tilt = height of the wall / distance from the wall

Thnx once again for your reply. :slight_smile:
I m serching all over the net the last 3 days to find a sample of code or a tutorial in the subject...but nothing :frowning:
Does anyone can help me ( a part of code OR a tutorial) to calculate the height of an obstacle using a tilting servo and an ir sensor ???
Thnx in advance. :wink:

The first problem is getting an "IR sensor" to "see" the top of an object and detecting how far away it is. That is very difficult to achieve using simple IR sensors and something as primitive as an arduino. What exactly are you calling an IR sensor ? , it can mean many things that uses infra red in some way. Finding something that will do the job with an absolute minimum of computing power is your first goal, once you have such a thing then you can work out some code to drive it.

Calculating its height is utter trivia in comparison.

Thnx for your reply :slight_smile:
pluggy>>>What exactly are you calling an IR sensor ?
I mean something like Sharp GP2D12 Infrared Sensor
The main “goal” is to calculate somehow the hight of an obstacle
and if its “lower” than “something” i want my tank to try clibe it and if is higher to move back to another direction.
As you can see in my “drawing” i cant descide what is the best for me or even better how can i do this. :-/
Any suggestions ??

As you can see in my "drawing"

I can't see a drawing - did you use a global URL, or something local on your machine?

As far as i can see the "drawing" is here in my first post. :wink:
Take a look again.
Thnx :slight_smile:

As far as I can see, the "drawing" is not there in your first post.
Can anyone else see it?

Yep. Nice pretty picture. I've had trouble seeing other pictures at times, though, and wondered what others were seeing that I wasn't.

The URL for the picture is:
http://www.grobot.gr/phpBB3/download/file.php?id=360&mode=view