2022-09-24, 08:50 AM
(This post was last modified: 2022-09-24, 08:53 AM by seandepagnier.)
I considered adding a "align heading" button, similar to "level" if traveling at a sufficient speed if you have gps and there are no magnetic distortions and when it is known that there are no currents to perform this operation. It would be difficult to make it completely automatic and the user would only press the button if appropriate (or get a wrong alignment) and all it would do is adjust the heading offset that you can manually enter now.
regardless, it will change over time (and space as you travel to different geographic with a different magnetic field) due to the nature of imperfect sensors, and many people prefer a magnetic heading. It would compensate using the world magnetic model to still get a magnetic alignment but still there will be some error as the magnetic model can be wrong and other sensor errors. Since many people mount the sensors facing forward or backward, it would technically be more accurate to simply enter 0 or 180 degree alignment manually since that is known. So yes, I intend to implement something that some people may find useful.
There are similar situations regarding wind sensors, and water speed and leeway sensors where gps or other sensors can cross-calibrate them, and I have mapped most of these cases out, but when I go to implement there can be flaws in the logic and so forth. Part of the key reason pypilot can work as it does is not to rely entirely on absolutes and instead perform corrections based on relative errors, so I have to always keep this in account and ensure if the wrong calibration is set, it can generally maintain course and work and at the worst display the wrong number.
I can actually automatically compensate for alignment error, even if there are currents, by using enough data from accelerometer integrations compared to gps velocity.... but I have not demonstrated this to be accurate or usable so I have experimenting. I write a lot of code that gets deleted...
Right now if the heading alignment is off, it does affect pitch and roll which could affect future algorithms. I am going to take a close look at all of this in the near future.
regardless, it will change over time (and space as you travel to different geographic with a different magnetic field) due to the nature of imperfect sensors, and many people prefer a magnetic heading. It would compensate using the world magnetic model to still get a magnetic alignment but still there will be some error as the magnetic model can be wrong and other sensor errors. Since many people mount the sensors facing forward or backward, it would technically be more accurate to simply enter 0 or 180 degree alignment manually since that is known. So yes, I intend to implement something that some people may find useful.
There are similar situations regarding wind sensors, and water speed and leeway sensors where gps or other sensors can cross-calibrate them, and I have mapped most of these cases out, but when I go to implement there can be flaws in the logic and so forth. Part of the key reason pypilot can work as it does is not to rely entirely on absolutes and instead perform corrections based on relative errors, so I have to always keep this in account and ensure if the wrong calibration is set, it can generally maintain course and work and at the worst display the wrong number.
I can actually automatically compensate for alignment error, even if there are currents, by using enough data from accelerometer integrations compared to gps velocity.... but I have not demonstrated this to be accurate or usable so I have experimenting. I write a lot of code that gets deleted...
Right now if the heading alignment is off, it does affect pitch and roll which could affect future algorithms. I am going to take a close look at all of this in the near future.