Timeline for How to find the correct navigation course by GPS navigation with Arduino?
Current License: CC BY-SA 4.0
20 events
when toggle format | what | by | license | comment | |
---|---|---|---|---|---|
Nov 6, 2022 at 2:27 | vote | accept | Curious guy | ||
Nov 6, 2022 at 0:55 | comment | added | Edgar Bonet |
@Hamid'Smith'Salehi: You are right. In order for the north to be at 0°, the azimuth must be computed as atan2(dx, dy) . I edited the code in my answer.
|
|
Nov 6, 2022 at 0:54 | history | edited | Edgar Bonet | CC BY-SA 4.0 |
Fixed azimuth: north is 0°.
|
Nov 6, 2022 at 0:43 | comment | added | Curious guy | i replaced latitude with longitude and also longitude with latitude in the formula, and it seemed is working properly. Can you check it please? | |
Nov 6, 2022 at 0:34 | comment | added | Curious guy | I tested it by an example : start point is 52.70594, 13.37933 altitude = 67 meters and the waypoint is : 52.71957, 1338046 altitude is 64 and the result was : azimuth = 87.124287071904 and the pitch angle = -0.113355534..... . The pich angle seems to be true but i know that the waypoint is in the north of the start point so the azimuth must be something like 0 (less or more). What is the problem? | |
Nov 2, 2022 at 22:07 | comment | added | Curious guy | Thanks for your response.Maximum distance is 5 kilometers | |
Nov 2, 2022 at 19:45 | comment | added | Dave X | M_PI = π =3.14259.... You could divide the 44 and 66cm resolution of each endpoint by the number of kilometers of distance between the two points if you want. The inaccuracy of using the flat-earth approximation versus calculating a great circle is that the great circle course doesn't have a constant azimuth that the flat-earth approximation would. How far are your waypoints from each other? | |
Nov 2, 2022 at 19:45 | comment | added | Edgar Bonet |
@Hamid'Smith'Salehi: The approximation error would be quite complex to compute, and depend on the exact start and end points of the path. Not anything as simple as an "error per kilometer". If you get GPS updates periodically, the approximation error will only make the path slightly curved, instead of being a straight line (or rather, a great circle). The error created by wind is likely to be many orders of magnitude larger. M_PI is π (pi).
|
|
Nov 2, 2022 at 18:56 | comment | added | Curious guy | And what is M_PI ? | |
Nov 2, 2022 at 18:52 | comment | added | Curious guy | I mean, using this calcution has some error because we assumed that earth is flat, so how much is error in every kilometer distance? | |
Nov 2, 2022 at 16:08 | comment | added | Edgar Bonet | @Hamid'Smith'Salehi: There may be a library that does this, but I am not aware of any. Also, I do not understand what you mean by "accuracy for each kilometer". Did you read the Wikipedia article Unit in the last place? | |
Nov 2, 2022 at 12:45 | comment | added | Curious guy | You mentioned in the answer that the accuracy is 44 cm and 66 cm. Can you describe it more? For example this accuracy is for each kilometer? If not how much is the accuracy for 5 kilometers? | |
Nov 2, 2022 at 12:41 | comment | added | Curious guy | Thanks for the answer, the main question is : Is there any Arduino's Library (mention the library) which can calculate this ? | |
Nov 1, 2022 at 22:05 | comment | added | timemage | @PMF, They asked how to calculate correct azimuth and pitch angle from one coordinate to another. It's true that they didn't use the word "drone." I'm just guessing it's used in the answer because ¨drone" can be taken to mean (semi-)autonomous (which makes sense given the question) vs say "multi-rotor" (implying ability change direction with ease). The OP didn't seem to put any real emphasize on it being a fixed wing craft and the need to plan motion in connection with it being a "RC plane." Maybe the way-points are far enough apart for this to be of real concern. | |
Nov 1, 2022 at 19:22 | comment | added | PMF | If I understand the OP correctly, he has a wing-type RC plane, not a drone. This can't just move in a specific direction. | |
Nov 1, 2022 at 18:11 | comment | added | Edgar Bonet | @timemage: Thanks for this very relevant comment. I edited my answer to address the accuracy issue. | |
Nov 1, 2022 at 18:11 | history | edited | Edgar Bonet | CC BY-SA 4.0 |
Address accuracy issue.
|
Nov 1, 2022 at 16:46 | comment | added | timemage | I was 80% of the way through writing something like this only with TinyGPSPlus when the phone rang, after which this was posted. So, I'll just mention here that if they're being literal about wanting a library, that one will do the course and distance part (which is probably haversine based). The pitch I'd synthesized in pretty much exact same way as this. The only other difference of note I had in mine is just that the user says they're using an Mega, so AVR, so only single precision float is available which is accurate to about 6 decimal places, so they should expect errors at close range. | |
Nov 1, 2022 at 16:25 | history | edited | Edgar Bonet | CC BY-SA 4.0 |
Break down the computation and discuss the approximation errors.
|
Nov 1, 2022 at 16:03 | history | answered | Edgar Bonet | CC BY-SA 4.0 |