IR Range Finders

BumpSonarIR Range FinderGyroWheel ClicksTemperatureCameraAudio

MPU Interface: AVR - 1x ADC

Input to Behaviour/s: Avoid, Mapping.

The robot uses 4 Sharp GP2D12 sensors, which complement the side sonar sensors.

The IR range finders give the robot another method of determining whether/what obstacles are in the area, it also allows the robot to detect objects closer than 25cm (which is the min limit of the sonar sensors). There are 4 sensors on board which are pointing in roughly the same direction as 4 of the sonar's (Far Left, Mid Left, Mid Right and Far Right)

As I wanted to be able to use the robot outside, as well as inside, the data from the IRRFs is fused with their respective sonar sensors data to determine whether the values seem reliable.. See the sonar section for further details.

If the IRRFs data is significantly different from that of the sonar's data then it is simply ignored.

With this IRRF data, coupled with the sonar data, the robot is able to navigate successfully through some fairly tight spaces, to within 7cm clearance either side.

The output from these sensors is non-linear, which causes a bit of a problem when interfacing to the AVR, as the relatively small about of memory can get taken up with look-up log tables etc. However there's a neat integer algorithm at http://www.acroname.com/robotics/info/articles/irlinear/irlinear.html , which make a few assumptions and allows a good approximation of the distance measured by the sensor to be calculated. This is the system I've used on the robot's AVR and found it to work very well, code below:

const int m = 6787;
const int b = -3;
const int k = 4;

void GetIRDistance(struct SensorData * Results)
{
    int RawSensorValue = 0;
    int LoopCounter = 0;

    for (LoopCounter = 0; LoopCounter < 4; LoopCounter++)
    {
        RawSensorValue = Results -> Sensor_Readings[LoopCounter].SensorValue;
        Results -> Sensor_Readings[LoopCounter].SensorValue = (m / (RawSensorValue + b)) - k;
    }
}