{"action":"created","issue":{"url":"https://api.github.com/repos/ArduPilot/ardupilot/issues/4933","repository_url":"https://api.github.com/repos/ArduPilot/ardupilot","labels_url":"https://api.github.com/repos/ArduPilot/ardupilot/issues/4933/labels{/name}","comments_url":"https://api.github.com/repos/ArduPilot/ardupilot/issues/4933/comments","events_url":"https://api.github.com/repos/ArduPilot/ardupilot/issues/4933/events","html_url":"https://github.com/ArduPilot/ardupilot/pull/4933","id":181024077,"number":4933,"title":"EKF2: Enable simultaneous optical flow and GPS use","user":{"login":"priseborough","id":3596952,"avatar_url":"https://avatars1.githubusercontent.com/u/3596952?v=3","gravatar_id":"","url":"https://api.github.com/users/priseborough","html_url":"https://github.com/priseborough","followers_url":"https://api.github.com/users/priseborough/followers","following_url":"https://api.github.com/users/priseborough/following{/other_user}","gists_url":"https://api.github.com/users/priseborough/gists{/gist_id}","starred_url":"https://api.github.com/users/priseborough/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/priseborough/subscriptions","organizations_url":"https://api.github.com/users/priseborough/orgs","repos_url":"https://api.github.com/users/priseborough/repos","events_url":"https://api.github.com/users/priseborough/events{/privacy}","received_events_url":"https://api.github.com/users/priseborough/received_events","type":"User","site_admin":false},"labels":[{"id":164739778,"url":"https://api.github.com/repos/ArduPilot/ardupilot/labels/EKF","name":"EKF","color":"e34520","default":false},{"id":164739700,"url":"https://api.github.com/repos/ArduPilot/ardupilot/labels/Reviewed","name":"Reviewed","color":"f7c666","default":false}],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":12,"created_at":"2016-10-04T22:44:32Z","updated_at":"2017-03-04T07:51:36Z","closed_at":"2016-10-10T05:51:11Z","pull_request":{"url":"https://api.github.com/repos/ArduPilot/ardupilot/pulls/4933","html_url":"https://github.com/ArduPilot/ardupilot/pull/4933","diff_url":"https://github.com/ArduPilot/ardupilot/pull/4933.diff","patch_url":"https://github.com/ArduPilot/ardupilot/pull/4933.patch"},"body":"Enables simultaneous use of GPS and optical flow data with automatic fallback to relative position mode if GPS is lost and automatic switch-up to absolute position status if GPS gained/re-gained.\n\n**Parameter Settings**\n\nThe  EK2_RNG_USE_HGT was set to 50 so that below 50% of the range finders max range of 40m and when the vehicle is stationary, the range finder height is used as the primary EKF height reference. This is the preferred option for combined GPS and optical flow operation.\nThe EK2_GPS_TYPE was set to 0. Previously this would mean that optical flow data would be ignored, but now optical flow data will be used if a sensor is fitted and enabled by the FLOW_ENABLE parameter. Setting EK2_GPS_TYPE = 3 will still have the same effect as before, putting the EKF into an optical flow only mode that ignores GPS\n\n**Ground Testing**\n\nThe ability to lose and regain GPS has been tested on the ground. The was conducted inside to provide a very marginal GPS signal. Placing a hand over the antenna was able to induce complete loss of GPS satellite tracking resulting in a switch to optical flow/relative position mode. When the GPS blockage was removed and the 3D lock recovered, the EKF reset its position to the GPS and switched to GPS mode. This was repeated twice.\n\nGPS position accuracy - very poor and rises rapidly when 3D lock is lost\n![screen shot 2016-10-05 at 11 18 29 am](https://cloud.githubusercontent.com/assets/3596952/19097070/75d171aa-8aed-11e6-8255-38609c3a5b01.png)\n\nGPS position innovations - flat-lining indicates GPS is not being fused\n![screen shot 2016-10-05 at 11 18 44 am](https://cloud.githubusercontent.com/assets/3596952/19097076/8216e1d4-8aed-11e6-90f7-82195d8f22c0.png)\n\nOptical flow innovations - flow data was fused throughout\n![screen shot 2016-10-05 at 11 20 56 am](https://cloud.githubusercontent.com/assets/3596952/19097117/ce751fc8-8aed-11e6-823f-be95c65f6f3b.png)\n\nNE Position - note the position resets when GPS lock is regained.\n![screen shot 2016-10-05 at 11 21 49 am](https://cloud.githubusercontent.com/assets/3596952/19097139/f1efc156-8aed-11e6-8f54-0bf071a9a8b5.png)\n\n**Flight Testing**\n\nThis branch has been flight tested on a 3DR Iris airframe with a PX4Flow v1.3 optical flow sensor and a Lightware SF10B range finder over flat terrain (sports field). The GPS was getting interference from the optical flow sensor with high levels of noise. The flight log can be found here: https://drive.google.com/file/d/0By4v2BuLAaCfeWtyd2xQTWxXZEE/view?usp=sharing\n\nGPS reported speed error (m/s)\n![screen shot 2016-10-05 at 9 30 23 am](https://cloud.githubusercontent.com/assets/3596952/19094895/6b41b56a-8ade-11e6-8ade-6d5ff108a9c0.png)\n\nGPS reported position error (m)\n![screen shot 2016-10-05 at 9 36 34 am](https://cloud.githubusercontent.com/assets/3596952/19095029/3a145488-8adf-11e6-9d0b-03c89e372727.png)\n\nDespite this, the copters position hold was steady throughout. The flight went through a range of speeds up to 5 m/s and altitudes up to 39m.\n\nOptical flow innovations remained good throughout.\n\nOptical flow innovations (mrad/sec)\n![screen shot 2016-10-05 at 9 33 25 am](https://cloud.githubusercontent.com/assets/3596952/19094943/c7f74fe0-8ade-11e6-835d-aede95c5a9b5.png)\n\nGPS position and velocity innovations were high, reflecting the amount of interference. Normally GPS innovations this high would result in an unsteady position hold, but the optical flow fusion reduced the effect of the GPs errors on position and velocity output.\n\nGPS position innovations (m)\n![screen shot 2016-10-05 at 9 34 51 am](https://cloud.githubusercontent.com/assets/3596952/19094978/fc9305e6-8ade-11e6-9f56-27956851cd99.png)\n\nGPS velocity innovations (m/s)\n![screen shot 2016-10-05 at 9 38 10 am](https://cloud.githubusercontent.com/assets/3596952/19095075/74772164-8adf-11e6-9e7b-53c21977e247.png)\n\nThe automatic switching between range finder and Baro height can be seen in the height innovations. The periods of increased noise correspond to use of the Baro.\n![screen shot 2016-10-05 at 10 12 04 am](https://cloud.githubusercontent.com/assets/3596952/19095908/71dd3cf4-8ae4-11e6-86f9-80cba89eed37.png)\n"},"comment":{"url":"https://api.github.com/repos/ArduPilot/ardupilot/issues/comments/284135321","html_url":"https://github.com/ArduPilot/ardupilot/pull/4933#issuecomment-284135321","issue_url":"https://api.github.com/repos/ArduPilot/ardupilot/issues/4933","id":284135321,"user":{"login":"roque-canales","id":8442576,"avatar_url":"https://avatars1.githubusercontent.com/u/8442576?v=3","gravatar_id":"","url":"https://api.github.com/users/roque-canales","html_url":"https://github.com/roque-canales","followers_url":"https://api.github.com/users/roque-canales/followers","following_url":"https://api.github.com/users/roque-canales/following{/other_user}","gists_url":"https://api.github.com/users/roque-canales/gists{/gist_id}","starred_url":"https://api.github.com/users/roque-canales/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/roque-canales/subscriptions","organizations_url":"https://api.github.com/users/roque-canales/orgs","repos_url":"https://api.github.com/users/roque-canales/repos","events_url":"https://api.github.com/users/roque-canales/events{/privacy}","received_events_url":"https://api.github.com/users/roque-canales/received_events","type":"User","site_admin":false},"created_at":"2017-03-04T07:51:36Z","updated_at":"2017-03-04T07:51:36Z","body":"Ok Magicrub.\r\n\r\nI just see that Randy found that EKF no recover position after glitch on AC3.5.\r\n\r\nI experienced this issue on another AC3.5 flight.\r\n\r\nWhen a glitch occur, drone start to drift, and no recover, even if gps back to good situation, it's impossible to back to loiter. Also I think there's the same issue with AC3.4 and also for range finder/baro glitch."}}
{"actor":{"display_login":"roque-canales"}}