7

我们想使用 iBeacons 实现某种室内位置确定。 这篇文章看起来很有趣,作者使用 Eigen C++ 库和 Levenberg Marquardt 算法实现了非线性最小二乘三角剖分。由于 Eigen 是用 C++ 编写的,因此我尝试使用 JNI 和 Android NDK 来使用它,但它会引发很多错误,我不知道如何解决,而且我在网上找不到任何东西。我也尝试使用 Jeigen,但它没有我们需要的所有功能。

所以,我的问题是:

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

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

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

4

1 回答 1

2

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

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

例如.. 进入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您可以注意到精度被用作评估参数而不是距离。

于 2015-06-09T13:43:38.303 回答