Comments (17)
@mimooh Sorry, I leave out one step.
# install boost-python, for debian or ubuntu
apt-get install libboost-python-dev
# install boost-python, for centos or fedora
yum install boost-devel boost-python
# clone source code
git clone https://github.com/layzerar/recastlib.git
cd recastlib
# patch the recast code
cp -rf ./Recast\(Patched\)/Detour/ ./Recast/
# build and install
python setup.py install
# test
cd examples && python simpletest.py
from recastlib.
I think it's still available, because it had been used in production for years, even though it has not been updated for a long time.
How to install:
# install boost-python, for debian or ubuntu
apt-get install libboost-python-dev
# install boost-python, for centos or fedora
yum install boost-devel boost-python
# clone source code
git clone https://github.com/layzerar/recastlib.git
cd recastlib
# patch the recast code
cp -rf ./Recast\(Patched\)/Detour/ ./Recast/
# build and install
python setup.py install
# test
cd examples && python simpletest.py
PS: If you want to use this library for Unity3D's NavMesh.asset, you should checkout the branch unity3d.
from recastlib.
d:recastlib$ python setup.py install
running install
running build
running build_ext
running install_lib
running install_egg_info
Removing /usr/local/lib/python2.7/dist-packages/_recast-0.0.0.egg-info
Writing /usr/local/lib/python2.7/dist-packages/_recast-0.0.0.egg-info
d:recastlib$ cd examples && python simpletest.py
Traceback (most recent call last):
File "simpletest.py", line 8, in
import recast as dt
File "/home/mimooh/recastlib/examples/recast.py", line 1, in
from _recast import *
ImportError: /usr/local/lib/python2.7/dist-packages/_recast.so: undefined symbol: _ZNK13dtQueryFilter10passFilterEjPK10dtMeshTilePK6dtPoly
from recastlib.
You may also need clean current working tree by running git clean -xfd
before you rebuild the module.
from recastlib.
from recastlib.
from recastlib.
Congratulations!
- What would it take to support python3? Could you make it perhaps? :)
Since the glue layer of this project is depending on the Boost-Python, and Boost-Python support Python 3 since version 1.41. Most likely it could work with just adapt simpletest.py
to Python 3. It's quite a simple task.
- Can this package create the navmesh from geometry? Well, I have another tool which produces the binary navmesh from an obj file, but I just hope that binary will be compatible with whatever your package requires as the navmesh input.
Short answer is no, this package only ported the query APIs of RecastNavigation
, such as path finding, raycast etc. Fortunately the master branch could load mesh data generated by RecastDemo, you can get RecastDemo from the original RecastNavigation
project. And the unity3d branch could load mesh data(NavMesh.asset file) generated by Unity3D. So you can choose one of them.
from recastlib.
I managed to succesfully load into simpletest.py a binary navmesh produced by this tool: https://github.com/arl/go-detour, so it works!
I converted the simpletest.py to python3, but I ran into:
mimooh:examples$ python3 simpletest3.py
Traceback (most recent call last):
File "simpletest3.py", line 8, in
import recast as dt
File "/home/mimooh/aa/recastlib/examples/recast.py", line 1, in
from _recast import *
ImportError: /usr/lib/x86_64-linux-gnu/libboost_python-py27.so.1.58.0: undefined symbol: PyClass_Type
Is this severe, or is there an easy fix?
from recastlib.
It is likely my python3 libboost problem may be general for my Ubuntu 16.04, not your package:
https://stackoverflow.com/questions/5539557/boost-and-python-3-x/21460832
I will upgrade to ubuntu 18.04 and report if it fixes the issue.
from recastlib.
Hmmm, doesn't work under ubuntu 18.04. Is it more linux/liboost issue, or your package issue?
lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 18.04 LTS
Release: 18.04
Codename: bionic
python3 simpletest.py
Traceback (most recent call last):
File "simpletest.py", line 8, in
import recast as dt
File "/home/mimooh/recastlib/examples/recast.py", line 1, in
from _recast import *
ImportError: /usr/lib/x86_64-linux-gnu/libboost_python-py27.so.1.65.1: undefined symbol: PyClass_Type
from recastlib.
The recent releases of Ubuntu or Debian contain multiple version of Python. So you may need to change the link flags in setup.py
manually if the setup script cann't find the correct version of Boost-Python. For example, you should change the line libraries += ['boost_python']
in setup.py
to libraries += ['boost_python-py35']
on Debian Stretch.
from recastlib.
Just update, should be compiled on Python 3.
from recastlib.
Awesome, you libboost wizard! Except it didn't work initially for me, and this fix was needed:
if sys.version_info[0] == 3:
- libraries += ['boost_python3']
- libraries += ['boost_python-py35']
UPDATE: Various ubuntus have various libboost files. Just make sure there is
/usr/lib/x86_64-linux-gnu/libboost_python3.so
present (a link to py35 or py37 etc) and then
libraries += ['boost_python3']
will do.
from recastlib.
Hi, thanks again for your code. I managed to integrate it in my project and this extremally valuable for us! However, it fails at some more complex geometries. I compare the results against the original and fresh RecastDemo and the orignal seems to handle things better. I guess they have improved the algorithms over these 5 or so years. Hence my question: would would it take to have python+boost+current Recast? I mean, could you try? :)
from recastlib.
Well, it works, no need for a fresher recastDetour code. I thought the navmesh would not always reach from src to dst, but it was only due to max limit of hops (which serves to improve performance). Thanks again, for this lovely piece of code and for making it opensource! We use it in https://github.com/aamks/aamks.
from recastlib.
hello, I have a problem when i run "pythonsimpletest.py " "_recast.cpython-36m-x86_64-linux-gnu.so: undefined symbol: _ZNK13dtQueryFilter10passFilterEjPK10dtMeshTilePK6dtPoly", What happened?
from recastlib.
@djy4713 please see #1 (comment)
from recastlib.
Related Issues (3)
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from recastlib.