Repository navigation
[Kinetic] fixed numpy.ndarray indices bug (from #86) - #450
Conversation
|
Nice! Thanks for the pull-request. You're right, strict formatting is only required for C++ (for now...). I just verified, pyassimp moved from an internal datatype to numpy.ndarray for these fields. Until now the code is compatible with the pyassimp versions of ROS indigo and kinetic. Would you mind to change it into something along the lines of to allow the script to run with the old version too? |
|
Full disclosure: if accepted, this would be my first successful pull request. I added an error that is thrown if both approaches fail. Let me know if that's being "too safe." Also, these checks are being run for every face in the mesh, which is extremely slow. I think the better design would be to check only the first face to determine the pyassimp version, then run one of two operations based on the check. Something like this: |
|
Hm, apparently GitHub decided to drop the mail response I sent yesterday evening. Sorry for that. |
|
I agree that if we are looping over every face, then it does not make sense to raise exceptions. However, in the code I wrote above, the exception at the end is catching the case where the first face specifically is not loadable via either method. It assumes that all the faces in the mesh have the same Python structure. If that's not the case, then I would propose keeping the loop structure as it currently is, where So I would say that the two best options are 1. Use the code above, checking only the first face's structure, with the exception, or 2. Check every face for pyassimp structure, throwing no exceptions. |
Sorry, that is the current state of the pull-request though. I commented on that...
Both ways are fine by me. Just choose one and implement it in the request. :) With (1.), you might want to check for |
|
Alright, I think it should be ready to go. |
v4hn
left a comment
There was a problem hiding this comment.
LGTM. Would be great if anyone else could approve and/or (squash)merge this.
|
I encountered this bug in the indigo branch as well, the same changes seem to fix that for me, pull request? |
|
@cschindlbeck I still suspect you broke your local setup somehow, but I don't see any harm in having this Feel free to file a pull-request for this. |
Description
A fix for the numpy.ndarray indices bug, the second bug described in #86.
This fix was proposed by @lifangda01 in the same issue.
I was unsure what to do about clang-format, since it seems that it's for C++ only.
Checklist
Thank you!