dpxkkhu1812 2019-07-12 18:02
浏览 29

检测路线中的故障点

I have a list of waypoints (latitude, longitude) and sometimes, there are wrong waypoints in that list.

example of faulty waypoints

My Problem is: How do i identify those waypoints?

I tried calculating the headings of each pair of waypoints, and then throwing those out where the change in heading is way too big.

// $heading is the heading of the previous waypoint pair
// $h is the heading of the current waypoint pair

$turn = null;
if ($heading !== null && $h !== null) {
    $a = abs($heading - 180);

    if ($b < 0)
        $b += 360;
    if ($a < 0)
        $a += 360;

    $turn = abs($a - $h);
}

This attempt didn't work out as some faulty waypoints were still not detected or correct waypoints were wrongly detected.

Does someone have an idea how to reliably figure out which ones are faulty?

Edit: Here are some datasets to test:

$data = [
    [14.5922222137, -60.9963874817], // First waypoint can't be faulty as it is the start
    [14.58529722, -61.03905556],
    [-23.16040556, 29.58556389], // faulty waypoint
    [14.83583333, -61.30305556],
    [32, -60],
    [51.00166667, -61.99916667],
    [52.66333333, -61.65361111],
    [53.17405278, -60.75461944],
    [53.3191680908, -60.4258346558] // Last waypoint can't be faulty either as it is the end
];

$data2 = [
    [36.0800552368, -115.152252197], // First waypoint can't be faulty as it is the start
    [36.07603889, -115.12513611],
    [36.07641111, -114.99773889],
    [36.07364722, -114.94283889],
    [36.0379, -114.77057222],
    [34.62250278, -107.80684444],
    [34.39397778, -106.69660556],
    [34.36862778, -105.82488333],
    [23.84245, 120.25903611], // faulty
    [29.99604444, -94.30452222],
    [29.66479722, -92.08668333],
    [28.66666667, -88.66666667],
    [24.56361111, -81.01666667],
    [24.45256111, -78.67836944],
    [23.66087778, -77.20931111],
    [15.83413889, -67.49952778],
    [14.24444444, -65.77944444],
    [13.90027778, -64.30277778],
    [14.547, -61.27663889],
    [14.5922222137, -60.9963874817] // Last waypoint can't be faulty either as it is the end
];
  • 写回答

0条回答 默认 最新

    报告相同问题?

    悬赏问题

    • ¥15 不是,这到底错哪儿了😭
    • ¥15 2020长安杯与连接网探
    • ¥15 关于#matlab#的问题:在模糊控制器中选出线路信息,在simulink中根据线路信息生成速度时间目标曲线(初速度为20m/s,15秒后减为0的速度时间图像)我想问线路信息是什么
    • ¥15 banner广告展示设置多少时间不怎么会消耗用户价值
    • ¥16 mybatis的代理对象无法通过@Autowired装填
    • ¥15 可见光定位matlab仿真
    • ¥15 arduino 四自由度机械臂
    • ¥15 wordpress 产品图片 GIF 没法显示
    • ¥15 求三国群英传pl国战时间的修改方法
    • ¥15 matlab代码代写,需写出详细代码,代价私