AprilBeacon測距問題


#1

使用android sdk 測試獲得距離變動範圍為2~10米不等,擺幅相當的大,
請問是否有建議的方式可縮小距離變動範圍?


#2
	protected static double calculateAccuracy(int measuredPower, double rssi) {
	if (rssi == 0) {
		return -1.0;
	}
	if (measuredPower == 0) {
		return -1.0;
	}
	if (rssi > 0) {
		rssi = rssi - 128;
	}
	double ratio = rssi * 1.0 / measuredPower;
	if (ratio < 1.0) {
		return Math.pow(ratio, 10);
	} else {
		 double accuracy = (0.42093) * Math.pow(ratio, 6.9476) + 0.54992;
		return accuracy;
	}
}

尝试下用这个方法计算距离 measuredPower及rssi都可以在beacon中获取