0
votes

I am looking into the possibility to use multiple iBeacons for indoor position location. i have tried the trilateration formula. but i think there is some problem its not giving the adjust location.

I have three iBeacons at a specific position

CGPoint a=CGPointMake(100, 0);
CGPoint b=CGPointMake(160, 270);
CGPoint c=CGPointMake(0, 145);

On didRangeBeacons i am getting the following distance

    float ra =0.0f;
    float rb=0.0f ;
    float rc=0.0f ;

     for (CLBeacon *beacon in beacons) {
        if ([beacon.minor floatValue]==57726) {
            //ra = beacon.accuracy; ra=5.33124
            ra = beacon.proximity;
        }
        if ([beacon.minor floatValue]==31901) {
            //  rb = beacon.accuracy;  rb=0.185142
            rb = beacon.proximity;
        }
        if ([beacon.minor floatValue]==53482) {
            // rc = beacon.accuracy;  rc=3.23776
            rc = beacon.proximity;
        }
    }

At the end i am using the trilateration formula.

float S = (pow(c.x, 2.) - pow(b.x, 2.) + pow(c.y, 2.) - pow(b.y, 2.) + pow(rb, 2.) - pow(rc, 2.)) / 2.0;

    float T = (pow(a.x, 2.) - pow(b.x, 2.) + pow(a.y, 2.) - pow(b.y, 2.) + pow(rb, 2.) - pow(ra, 2.)) / 2.0;
    float y = ((T * (b.x - c.x)) - (S * (b.x - a.x))) / (((a.y - b.y) * (b.x - c.x)) - ((c.y - b.y) * (b.x - a.x)));
    float x = ((y * (a.y - b.y)) - T) / (b.x - a.x);

OutPut of the location

point = (x=138.025452, y=133.269165)

But its not a perfect. it should give the point near to the Point b. i dnt have an idea whats the wrong.

Please help.

1

1 Answers

0
votes

I am not sure that you are going to be able to get a very accurate position. The Apple documentation for the CLBeacon accuracy property states -

Discussion Indicates the one sigma horizontal accuracy in meters. Use this property to differentiate between beacons with the same proximity value. Do not use it to identify a precise location for the beacon. Accuracy values may fluctuate due to RF interference.

As it is a one sigma accuracy, it is only about 68% accurate.

It is possible that you may get better results if you calibrate your beacons, but even then RF interference from the environment (people in particular) will affect your readings