RadBeacon Tag distance calculating

时光怂恿深爱的人放手 提交于 2019-12-13 04:48:52

问题


i am using iBeacon from Radius Networks. At the moment I am trying to calculate the distance between android device and RadBeacon Tag by using RSSI. Like David Young mentioned here the android devices have got different antenna. My experience with the following forumla is not very good in combination with my Nexus 7.

protected static double calculateAccuracy(int txPower, double rssi) {
  if (rssi == 0) {
    return -1.0; // if we cannot determine accuracy, return -1.
  }

  double ratio = rssi*1.0/txPower;
  if (ratio < 1.0) {
    return Math.pow(ratio,10);
  }
  else {
    double accuracy =  (0.89976)*Math.pow(ratio,7.7095) + 0.111;    
    return accuracy;
  }
}   

Can anybody provide me a different formula for the distance calculation or some data of a RSSI / distance measurement for different distances?


回答1:


You can get the best results for a specific device by measuring RSSI at various distances and doing a regression against the above formula to find coefficients for the best fit. You can read an explanation of the recommended distances here:

http://altbeacon.github.io/android-beacon-library/distance-calculations.html

You can then import the data into R (the free statistical computing software) and use the nls function (non-linear least squares) to fit the data with a power curve. Here is the power curve equation: function(x, b0, b1, b2) {b0 + b1*(x^b2)}

The nls function solves for the coefficients b0, b1, and b2 which are used in the formula for A, B, and C.

Here's a tutorial on curve fitting in R for more information:

http://www.walkingrandomly.com/?p=5254




回答2:


This application can help you get coefficients for the distance formula directly or collect all necessary data to calculate by yourself https://play.google.com/store/apps/details?id=com.msl.ibeaconchef



来源:https://stackoverflow.com/questions/27129740/radbeacon-tag-distance-calculating

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!