New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Long distance altitude control #3153
base: master
Are you sure you want to change the base?
Conversation
trying out function for direct calculation of error
Mmm, maybe I am wrong here because I do not remember all the "nav"s in Paparazzi. When the GPS is on, do not we have MSL altitude? I mean, the problem is only in the XY because the error by the tangent plane to the sphere is noticeable, right? The Z is always okei since it is always on the line between the center of the Earth and the vehicle. This is what I thought Paparazzi was doing, but I am probably wrong haha. |
Well, it may depend on the INS, as what you describe is what is done in EKF2. However, for instance in ins_int.c a height correction is done, such that the barometer measurement is transformed in an approximately correct NED height (though incorrect if the distance gets really large). |
Regardless of this hack :P. It looks like we should divide (add a tag or dependency?) between code/modules that support operations far from the initial and fixed ground station and local operations. Maybe a feature to have in the wish list is to count on navigation that operates directly in LLA. What do you think @gautierhattenberger ? Do you see it feasible? Or will it break most of the code? :P. |
If you want to make a proper navigation on a non flat ground, you need to have your guidance/navigation in lla directly. Years ago, I tried a hack where the x/y coordinates and differences where computed using the Haversine formula that @EwoudSmeur have also used here. So the x/y where not orthonormal Cartesian coordinates anymore, and it kind of works. It was for fixedwing and before having the state interface. Now, I think it is a bit more complex.
Then the altitude to track: z in LTP, alt above ellipsoid or hmsl ? Fixedwing firmware is flying with hmsl. It seems to be the best choice to me, also compatible with EKF2, and probably easy to adapt to our filters if needed. |
sorry, for close/reopen, wrong button |
Yes, so what I implemented is the haversine approach (which is the same as calculating waypoint errors in an LTP frame at the drone position) with vertical ellipsoid alt (but can be changed to hmsl). I also fixed some bugs in the state conversions by the way. @gautierhattenberger @noether @Fabien-B @fvantienen @dewagter I think it would be good to have a video call about this topic, such that we implement something that everybody is happy with.
|
I'm only available tomorrow (8/11) at 11:00. I saw the bug fix in state, I think it deserves a specific PR... |
I can make it tomorrow at 11.00 too. At least, it is nice to see your faces again. |
Tomorrow at 11:00 is fine with me as well |
Following up on #3091, I made some code to control the ellipsoid altitude, and obtain position errors in a local NED frame centered at the drone (not at the origin), because if the origin is far away from the drone it will be tilted wrt the earth surface. I only changed the hybrid code so far.
Now though it is somewhat straightforward to calculate the horizontal position errors and the altitude, this has some implications:
An alternative could be to move the NED origin every kilometer or so and do the vertical control in altitude above ellipsoid, but keep the horizontal control in NED. Every time the origin is moved, the waypoints and reference models need to be reset. This could lead to some difficulty with the GCS, as it needs to be communicated over the datalink that the origin has moved. It will also lead to jumps in all the NED signals.
Another issue is that EKF2 estimates altitude in the NED frame, but puts the altitude above the ellipsoid there. If you get the current LLA altitude from the state, it will be too low if the drone is not close to the origin.
Any input is welcome! @gautierhattenberger @dewagter @noether