{"action":"created","issue":{"url":"https://api.github.com/repos/cleanflight/cleanflight/issues/197","labels_url":"https://api.github.com/repos/cleanflight/cleanflight/issues/197/labels{/name}","comments_url":"https://api.github.com/repos/cleanflight/cleanflight/issues/197/comments","events_url":"https://api.github.com/repos/cleanflight/cleanflight/issues/197/events","html_url":"https://github.com/cleanflight/cleanflight/issues/197","id":50628915,"number":197,"title":"Improve GPS Position Hold (GPS PH)","user":{"login":"Akfreak","id":9996976,"avatar_url":"https://avatars.githubusercontent.com/u/9996976?v=3","gravatar_id":"","url":"https://api.github.com/users/Akfreak","html_url":"https://github.com/Akfreak","followers_url":"https://api.github.com/users/Akfreak/followers","following_url":"https://api.github.com/users/Akfreak/following{/other_user}","gists_url":"https://api.github.com/users/Akfreak/gists{/gist_id}","starred_url":"https://api.github.com/users/Akfreak/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Akfreak/subscriptions","organizations_url":"https://api.github.com/users/Akfreak/orgs","repos_url":"https://api.github.com/users/Akfreak/repos","events_url":"https://api.github.com/users/Akfreak/events{/privacy}","received_events_url":"https://api.github.com/users/Akfreak/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":26,"created_at":"2014-12-02T09:29:16Z","updated_at":"2015-04-08T22:56:32Z","closed_at":null,"body":"\r\nThis folder is created per Hydra's request, \"<hydra> perhaps add some of your ideas to a new github issue tracker issue\r\n<hydra> if you create one called ‘gps improvements’\r\n<hydra> and then add comments to it for each idea, then we can discount or progress each idea you have.\r\n\r\nFirst we need to use the best GPS, Compass, and IMU (combined as a single GPS tracking and data collection unit.) which the Naze 32 (and like boards) can support.  Using GPS coordinates alone for hold isn't gong to cut it.  We need to consider the sensor data from the GPS, compass (gps compass) and IMU to write code that can use all of the data together to control drift. By fusing data from all three devices, we can definitely know if the craft is drifting from the GPS coordinates obtained when you enter GPS mode or GPS hold mode. I hope I am making sense. \r\n\r\nOnce we are able to lock the crafts positions, we can do all sorts of neat stuff. For example, we can record the gps data, IMU data, and compass data, (ground track, plus known past IMU and compass data that has been collected during flight) along with the home position data, and we can return to home with no active GPS. We could write a routine that takes all the data and creates a path back to home (shortest distance, raising up in elevation to clear obstacles) and fly it based on the stored sensor data. Like a backup RTH if your GPS ever failed. Add Lidar for collision avoidance you might have a cool autonomous rig \r\n\r\nThe nose in or nose out on RTH is not that difficult when you have the correct position data and a machine that can hold on GPS coordinates.. In the GUI you could just have a check box face in or away on RTH. Then have it fly home normally and before it descend have it rotate to specified orientation and land ( just subtract or add 180° to known data collected on takeoff to the yaw axis ) \r\n\r\nAlso in GPS hold mode, we could use the throttle stick for height hold. Yep we map the throttle throws, and have the flight controller use GPS (full package GPS, Compass and IMU data) and baro data in conjunction with the throttle. When in GPS flight mode, the throttle stick just becomes the main control for the GPS hold feature. To auto take off, just put the throttle stick at 50% (+ or - 3-5 %) and the craft takes off and holds 3 to 5 meters off the ground (we could control throttle expo easily). Then if you go over the 50% threshold the machine climbs, if you go below 50% throttle, the machine descends.  This would be perfect for AP. If you want to climb up a little, give a little throttle above 50% then u go up. When you return to 50% throttle and it locks in GPS and Altitude hold . You could still use Yaw, Pitch and Roll (with set limits, 25° to 30° max) to move about, but you would not climb or descend. To go down, just reduce throttle below 50% and go down. When the throttle stick is at center the machine resumes GPS lock. It would be a cool way to fly. \r\n\r\nBefore we can do all this fun stuff, we need solid lock. IMO, this will only happen by adding a standalone GPS with additional compass, and IMU to collect sensor data. It would also be nice to add a micro SD card for Black Box flight data that monitors all systems, but this is a whole different issue.  \r\n\r\nI hope my ideas are what you are looking for. If not please can you give examples of what you are asking for. Thanks   Tom"},"comment":{"url":"https://api.github.com/repos/cleanflight/cleanflight/issues/comments/91060190","html_url":"https://github.com/cleanflight/cleanflight/issues/197#issuecomment-91060190","issue_url":"https://api.github.com/repos/cleanflight/cleanflight/issues/197","id":91060190,"user":{"login":"digitalentity","id":11059099,"avatar_url":"https://avatars.githubusercontent.com/u/11059099?v=3","gravatar_id":"","url":"https://api.github.com/users/digitalentity","html_url":"https://github.com/digitalentity","followers_url":"https://api.github.com/users/digitalentity/followers","following_url":"https://api.github.com/users/digitalentity/following{/other_user}","gists_url":"https://api.github.com/users/digitalentity/gists{/gist_id}","starred_url":"https://api.github.com/users/digitalentity/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/digitalentity/subscriptions","organizations_url":"https://api.github.com/users/digitalentity/orgs","repos_url":"https://api.github.com/users/digitalentity/repos","events_url":"https://api.github.com/users/digitalentity/events{/privacy}","received_events_url":"https://api.github.com/users/digitalentity/received_events","type":"User","site_admin":false},"created_at":"2015-04-08T22:56:32Z","updated_at":"2015-04-08T22:56:32Z","body":"@dkisselev @hydra from what I see in the code, we should probably drop separate navigation & altitudehold modules and re-create a complete position estimation and navigation. This position estimation should include altitude fused together from all available sources (baro, sonar, gps). I am currently thinking of porting INS/GPS code from Taulabs (https://github.com/TauLabs/TauLabs/blob/next/flight/Libraries/insgps13state.c) over to CF, however I am not sure if F1 targets would be able to handle the math, as calculations are comlex."}}