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

Do not crash for consecutive points with identical coordinates. #1574

Merged
merged 1 commit into from
Oct 4, 2022

Conversation

joernu76
Copy link
Member

Fix #1571

_line[1][mid], _line[1][mid + 1]) for _line, mid in
zip(gc_lines, [len(_line[0]) // 2 for _line in gc_lines])]
lens = [np.hypot(_line[0][0] - _line[0][-1], _line[0][0] - _line[0][-1]) * 110. for _line in gc_lines]
lins = [(_line[0][mid], _line[0][mid + 1], _line[1][mid], _line[1][mid + 1])
Copy link
Member

@ReimarBauer ReimarBauer Oct 1, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

as bug fix okay, but that is not getting better readable. When there are tests written may be some of the methods can be extracted as functions to a remotesensing utils

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree.
However, I did also not see how to clean this up easily, or how to rewrite this using "numpy" terminology. The whole thing should be very slow and I am surprised it is still real-time capable.

@ReimarBauer
Copy link
Member

sometimes I see

RuntimeWarning: invalid value encountered in double_scalars
 direction = [(_x / np.hypot(_x, _y), _y / np.hypot(_x, _y))
/home/reimar/MASTER/MSS/mslib/msui/mpl_pathinteractor.py:77: RuntimeWarning: invalid value encountered in double_scalars
 r = (np.dot(p - l1, l2 - l1) / np.linalg.norm(l2 - l1) ** 2)

Copy link
Member

@ReimarBauer ReimarBauer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

solves the issue, Thx

@ReimarBauer ReimarBauer merged commit 0f02f57 into stable Oct 4, 2022
@ReimarBauer ReimarBauer deleted the i1571 branch October 4, 2022 15:35
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

Successfully merging this pull request may close these issues.

Remote sensing tool results in crash, if two consecutive way points are in the same horizontal position
2 participants