-
Notifications
You must be signed in to change notification settings - Fork 197
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
bug: map projections with nan values #138
Comments
Probably filtering them out is best. |
I wasn't sure if that was feasible, I don't think I grasp 100% of the math here, and I wasn't sure if filtering out I'll submit a PR shortly. |
Can you provide the log(s)? It should not contain NaNs. |
I randomly picked a log out of logs.px4.io/browse, I lost track of which one it was and since I'm not the original author I won't be re-uploading it to the site, instead here's a link to download that will probably remain available for a few weeks (sorry if you are reading this and the file is no longer available) |
Thanks, I'll have a look. Log is here btw (the ID was still in the filename): https://logs.px4.io/plot_app?log=ba165f7d-113d-4c5d-b479-1fcf21e99175 |
For the diff --git a/plot_app/helper.py b/plot_app/helper.py
index c2018eb..a26184c 100644
--- a/plot_app/helper.py
+++ b/plot_app/helper.py
@@ -218,6 +218,11 @@ def WGS84_to_mercator(lon, lat):
def map_projection(lat, lon, anchor_lat, anchor_lon):
""" convert lat, lon in [rad] to x, y in [m] with an anchor position """
+
+ # filter NaN values
+ lat = lat[~np.isnan(lat)]
+ lon = lon[~np.isnan(lon)]
+
sin_lat = np.sin(lat)
cos_lat = np.cos(lat)
cos_d_lon = np.cos(lon - anchor_lon) The NaN's in attitude are valid and fixed in #140. |
In plot_app/helper.py#227-229
Consider the following conditionals
for the following example value of
arg
of typeNumpy.Array
Looks like we either filter
nan
values or learn how to deal with themErrors:
The text was updated successfully, but these errors were encountered: