Skip to content
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

ned2geodetic returns wrong altitude for +ve values of down #28

Open
sytelus opened this issue Jan 21, 2017 · 1 comment
Open

ned2geodetic returns wrong altitude for +ve values of down #28

sytelus opened this issue Jan 21, 2017 · 1 comment

Comments

@sytelus
Copy link

sytelus commented Jan 21, 2017

In NED +down values should decrease the altitude however when converting to geodetic it returns +ve altitude instead. If you look at the equations in ecef2geodetic then it can be easily seen that returned altitude value will always be positive. I think this happens because sqrt(x) is supposed to be +/- value but in code we always end up using only + value.

@philippmaa
Copy link

philippmaa commented Jan 5, 2018

I have a similar problem. When I use this framework geodetic2Enu is perfect, but the other way enu2Geodetic results in continuously decreasing altitude.
I figured out that during the calculation, precisely in ned2Ecef the z value stays always the same, even if given lat, lon, alt change.
Can anybody help me out?

Kind regards
philippmaa

EDIT: I solved the issue. When calculating ned_to_ecef_matrix_ (what has to be the inverse of ecef_to_ned_matrix_) as:

ned_to_ecef_matrix_ = nRe(initial_latitude_, initial_longitude_).transpose();

there are inaccuracies in ned_to_ecef_matrix_. In my case these inaccuracies lead to errors in altitude up to 15m.
I changed this line to:

ned_to_ecef_matrix_ = ecef_to_ned_matrix_.inverse();

With this change the results are perfect. The only problem is, I think it's not good to calculat the inverse of a matrix.
If you have any hints, please let me know.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants