BLE标签从一个位置移动到另一位置

问题描述

我一直在做一些实验以获得精确的位置,所以我确实遵循了

  1. 获取一楼的地图图像,并基于仪表,我为图像设置了像素,以便可以找到放置在地图上的BLE扫描仪的正确位置

  2. 我正在通过标签(信标)的RSSI值来计算BLE扫描仪和BLE标签之间的距离,以米为单位。

  3. 现在,我正在尝试使用@Vishnu Prabhu的以下解决方案,以便获得用户解决方案架构师的正确位置。

public static PointF GetLocationWithCenterOfGravity(PointF a,PointF b,PointF c,float dA,float dB,float dC)
{
    //http://stackoverflow.com/questions/20332856/triangulate-example-for-ibeacons
    var METERS_IN_COORDINATE_UNITS_RATIO = 1.0f;

    //http://stackoverflow.com/a/524770/663941
    //Find Center of Gravity
    var cogX = (a.X + b.X + c.X) / 3;
    var cogY = (a.Y + b.Y + c.Y) / 3;
    var cog = new PointF(cogX,cogY);

    //Nearest Beacon
    PointF nearestBeacon;
    float shortestDistanceInMeters;
    if (dA < dB && dA < dC)
    {
        nearestBeacon = a;
        shortestDistanceInMeters = dA;
    }
    else if (dB < dC)
    {
        nearestBeacon = b;
        shortestDistanceInMeters = dB;
    }
    else
    {
        nearestBeacon = c;
        shortestDistanceInMeters = dC;
    }

    //http://www.mathplanet.com/education/algebra-2/conic-sections/distance-between-two-points-and-the-midpoint
    //Distance between nearest beacon and COG
    var distanceToCog =  (float)(Math.Sqrt(Math.Pow(cog.X - nearestBeacon.X,2)
            + Math.Pow(cog.Y - nearestBeacon.Y,2)));

    //Convert shortest distance in meters into coordinates units.
    var shortestDistanceInCoordinationUnits = shortestDistanceInMeters * METERS_IN_COORDINATE_UNITS_RATIO;

    //http://math.stackexchange.com/questions/46527/coordinates-of-point-on-a-line-defined-by-two-other-points-with-a-known-distance?rq=1
    //On the line between Nearest Beacon and COG find shortestDistance point apart from Nearest Beacon
    var t = shortestDistanceInCoordinationUnits / distanceToCog;
    var pointsDiff = new PointF(cog.X - nearestBeacon.X,cog.Y - nearestBeacon.Y);
    var tTimesDiff = new PointF(pointsDiff.X * t,pointsDiff.Y * t);
        
    //Add t times diff with nearestBeacon to find coordinates at a distance from nearest beacon in line to COG.
    var userLocation = new PointF(nearestBeacon.X + tTimesDiff.X,nearestBeacon.Y + tTimesDiff.Y);

    return userLocation;
}
  • 计算三角形的重心(3 BLE扫描仪)

  • 计算最短距离/最近的信标

  • 计算信标与重心之间的距离

  • 将最短距离转换为坐标单位 常数,他曾经用来预测准确性。

  • 您可以通过更改常数进行测试

  • 计算距离增量

  • 添加带有最近信标x,y的增量。

测试后,我发现使用BLE标签移动时,它没有显示位置移动。但是,如果我站在某个地方,则4-5秒后标记会跳到该位置。 BLE标签从一个位置移动到另一位置如何显示适当的移动性?

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)

相关问答

错误1:Request method ‘DELETE‘ not supported 错误还原:...
错误1:启动docker镜像时报错:Error response from daemon:...
错误1:private field ‘xxx‘ is never assigned 按Alt...
报错如下,通过源不能下载,最后警告pip需升级版本 Requirem...