I try use the US sensor to detect the obstacle's size, like height or width, the theory is simple, there's an object in front of sensor with distance 'line distance', move the US sensor which dirven by a motor, the motor move looply by a tiny steps each time, like:
Code: Select all
RotateMotor(OUT_B, 10, 5);
Code: Select all
rotationTotalDegree = MotorTachoCount(OUT_B);
But I got some problem when use the sensor, it didn't work as I imagined, instead send a single line ultrasonic signal, it actually send 'bunch' of singlal to an object, like a single point light source, it's a Radial, I guess the cross section is like a retangle or sth, and the area of this retangle depens on the distance from the sensor, so this make it nearly impossible to get a clear edge, because from my test, even the sensor passed by the edge of object for a long distance, the distance still displayed very near.
Do you have any idears?