在 Android 中使用 iBeacons 进行三边测量

2024-01-07

我们希望使用 iBeacons 实现某种室内位置确定。这篇文章看起来真的很有趣 http://techblog.rga.com/determining-indoor-position-using-ibeacon/,其中作者使用 Eigen C++ 库和 Levenberg Marquardt 算法实现了非线性最小二乘三角剖分。由于 Eigen 是用 C++ 编写的,因此我尝试使用 JNI 和 Android NDK 来使用它,但它抛出了一个很多错误我不知道如何解决 https://stackoverflow.com/questions/26615684/eigen-levenberg-marquardt-algorithm-invalid-template-arguments-on-definition我在网上找不到任何东西。我也尝试过使用 Jeigen,但它没有我们需要的所有功能。

所以,我的问题是:

  1. 有人曾经使用过某种三边测量吗 Android 中的信标?

  2. 您认为使用 Eigen+JNI+NDK 是一个好的解决方案吗?如果是, 你曾经使用过 Levenberg Marquardt 吗 组合?

  3. 在 Android 应用程序中计算三边测量是否有比 Levenberg Marquardt 算法更好的选择?


看看这个库:https://github.com/lemmingapex/Trilateration https://github.com/lemmingapex/Trilateration

使用 Apache Commons Math 中的 Levenberg-Marquardt 算法。

例如.. 进入三边测量测试.java https://github.com/lemmingapex/trilateration/blob/master/src/test/java/com/lemmingapex/trilateration/TrilaterationTest.java

你可以看到:

double[][] positions = new double[][] { { 1.0, 1.0 }, { 2.0, 1.0 } };
double[] distances = new double[] { 0.0, 1.0 };

TrilaterationFunction trilaterationFunction = new TrilaterationFunction(positions, distances);
NonLinearLeastSquaresSolver solver = new NonLinearLeastSquaresSolver(trilaterationFunction, new LevenbergMarquardtOptimizer());

double[] expectedPosition = new double[] { 1.0, 1.0 };
Optimum optimum = solver.solve();
testResults(expectedPosition, 0.0001, optimum);

但如果你看到 Objectivec 的例子https://github.com/RGADigital/indoor_navigation_iBeacons/blob/show-work/ios/Group5iBeacons/Debug/Managers/Location/NonLinear/NonLinear.mm https://github.com/RGADigital/indoor_navigation_iBeacons/blob/show-work/ios/Group5iBeacons/Debug/Managers/Location/NonLinear/NonLinear.mm您可以注意到,精度被用作评估参数,而不是距离。

本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)

在 Android 中使用 iBeacons 进行三边测量 的相关文章

随机推荐