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

Example usages for fcl.OcTree #7

Open
eaa3 opened this issue Aug 6, 2018 · 4 comments
Open

Example usages for fcl.OcTree #7

eaa3 opened this issue Aug 6, 2018 · 4 comments

Comments

@eaa3
Copy link

eaa3 commented Aug 6, 2018

Would it be possible to add tests and examples using fcl.OcTree. Could you give an instantiation example? I assume it should be read from bytes representing an octree. If I give:

fcl_tree =fcl.OcTree(0.1, data)

It gives the following error:
Traceback (most recent call last): File "example1.py", line 20, in <module> fcl_tree =fcl.OcTree(0.1, data) File "fcl/fcl.pyx", line 403, in fcl.fcl.OcTree.__cinit__ File "stringsource", line 48, in vector.from_py.__pyx_convert_vector_from_py_char TypeError: an integer is required

@tim-fan
Copy link

tim-fan commented Nov 6, 2018

I'm also having trouble reading an octree .bt file.
I initially saw the same error as @eaa3, (integer required). Then I tried passing the binary data as an int array as follows:

fcl_tree = fcl.OcTree(0.1, [ord(c) for c in open(btFile, 'r').read()])

With this I get the error:

OverflowError                             Traceback (most recent call last)
<ipython-input-47-293f93fa0a25> in <module>()
----> 1 fcl_tree = fcl.OcTree(0.1, [ord(c) for c in open(btFile, 'r').read()])

fcl/fcl.pyx in fcl.fcl.OcTree.__cinit__()

~/.local/lib/python2.7/site-packages/fcl/fcl.so in vector.from_py.__pyx_convert_vector_from_py_char()

OverflowError: value too large to convert to char

@adubredu
Copy link

adubredu commented Jun 4, 2019

A way around this could be to convert the octree into boxes and perform collision-detection on the boxes.
Check out this link for an example implementation:
https://github.com/kucars/laser_collision_detection/blob/1b78fe5a95584d135809b1448d33675bb8fee250/src/laser_obstacle_detect.cpp#L252

@ddm-j
Copy link

ddm-j commented Nov 13, 2021

@zichunxx
Copy link

This lib doesn't seem to be maintained anymore, has anyone already done collision detection using octree?

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

5 participants