krishauser / Klampt

Kris' Locomotion and Manipulation Planning Toolkit
BSD 3-Clause "New" or "Revised" License
378 stars 96 forks source link

Motion Planning for Articulated Robots Example not working with Klampt Examples #100

Closed hugosciascia closed 2 years ago

hugosciascia commented 3 years ago

Hello !

This example is not working : http://motion.cs.illinois.edu/software/klampt/latest/pyklampt_docs/Manual-Planning.html#motion-planning-for-articulated-robots

My powershell return this :

RobParser: Reading robot file Klampt-examples/data\robots/tx90pr2.rob...
RobParser:    Parsing robot file, 7 links read...
LoadAssimp: Loaded model with 8458 verts and 16883 tris
LoadAssimp: Loaded model with 3637 verts and 7245 tris
LoadAssimp: Loaded model with 3327 verts and 6650 tris
LoadAssimp: Loaded model with 3447 verts and 6884 tris
LoadAssimp: Loaded model with 6258 verts and 12313 tris
LoadAssimp: Loaded model with 8634 verts and 17308 tris
RobParser: Loaded geometries in time 0.065s, 67283 total primitive elements
RobParser:    Mounting subchain file pr2gripper.rob
RobParser: Reading robot file Klampt-examples/data\robots\pr2gripper.rob...
RobParser:    Parsing robot file, 5 links read...
LoadAssimp: Loaded model with 485 verts and 970 tris
LoadAssimp: Loaded model with 539 verts and 1074 tris
LoadAssimp: Loaded model with 482 verts and 956 tris
LoadAssimp: Loaded model with 617 verts and 1238 tris
LoadAssimp: Loaded model with 482 verts and 956 tris
RobParser: Loaded geometries in time 0.011s, 5194 total primitive elements
RobParser: Done loading robot file Klampt-examples/data\robots\pr2gripper.rob
RobParser: Done loading robot file Klampt-examples/data\robots/tx90pr2.rob
LoadAssimp: Loaded model with 11277 verts and 22300 tris
LoadAssimp: Loaded model with 8 verts and 12 tris
LoadAssimp: Loaded model with 8 verts and 12 tris
LoadAssimp: Loaded model with 8 verts and 12 tris
LoadAssimp: Loaded model with 8 verts and 12 tris
LoadAssimp: Loaded model with 8 verts and 12 tris
LoadAssimp: Loaded model with 8 verts and 12 tris
TriMeshTopology: mesh has 16 triangles with duplicate neighbors!
  Triangle range 10164 to 10755
  May see strange results for some triangle mesh operations
TriMeshTopology: mesh has 32 triangles with duplicate neighbors!
  Triangle range 285 to 866
  May see strange results for some triangle mesh operations
TriMeshTopology: mesh has 32 triangles with duplicate neighbors!
  Triangle range 51 to 748
  May see strange results for some triangle mesh operations
Initialized robot collision data structures in time 0.588
Traceback (most recent call last):
  File ".\MotionPlanningRobotArm.py", line 12, in <module>
    space = robotplanning.makeSpace(world,robot,edgeCheckResolution=0.05)
  File "C:\Users\h.sciascia\AppData\Local\Programs\Python\Python37\lib\site-packages\klampt\plan\robotplanning.py", line 95, in makeSpace
    if dr.type() == 'affine':
  File "C:\Users\h.sciascia\AppData\Local\Programs\Python\Python37\lib\site-packages\klampt\robotsim.py", line 4646, in <lambda>
    __getattr__ = lambda self, name: _swig_getattr(self, RobotModelDriver, name)
  File "C:\Users\h.sciascia\AppData\Local\Programs\Python\Python37\lib\site-packages\klampt\robotsim.py", line 79, in _swig_getattr
    return _swig_getattr_nondynamic(self, class_type, name, 0)
  File "C:\Users\h.sciascia\AppData\Local\Programs\Python\Python37\lib\site-packages\klampt\robotsim.py", line 74, in _swig_getattr_nondynamic
    return object.__getattr__(self, name)
AttributeError: type object 'object' has no attribute '__getattr__'
smeng9 commented 3 years ago

Hi @hugosciascia Thanks for the trial and feedback.

Is your Klampt build installed from pypi? Currently This examples runs fine on our end that uses the built from source Klampt.

The issue may be related to some prebuilt packages on pypi. We suggest building from source to get most up to date features and bug fixes. We should release 0.8.7 very soon.

hugosciascia commented 3 years ago

Ok now i got this ... I copy all the https://github.com/krishauser/Klampt/tree/master/Python/klampt in my \AppData\Local\Programs\Python\Python37\Lib\site-packages\klampt

Traceback (most recent call last):
  File "C:\Users\h.sciascia\AppData\Local\Programs\Python\Python37\lib\site-packages\klampt\robotsim.py", line 23, in swig_import_helper
    fp, pathname, description = imp.find_module('_robotsim', [dirname(__file__)])
  File "C:\Users\h.sciascia\AppData\Local\Programs\Python\Python37\lib\imp.py", line 297, in find_module
    raise ImportError(_ERR_MSG.format(name), name=name)
ImportError: No module named '_robotsim'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File ".\main.py", line 1, in <module>
    from klampt import WorldModel,Simulator
  File "C:\Users\h.sciascia\AppData\Local\Programs\Python\Python37\lib\site-packages\klampt\__init__.py", line 9, in <module>
    from .robotsim import *
  File "C:\Users\h.sciascia\AppData\Local\Programs\Python\Python37\lib\site-packages\klampt\robotsim.py", line 33, in <module>
    _robotsim = swig_import_helper()
  File "C:\Users\h.sciascia\AppData\Local\Programs\Python\Python37\lib\site-packages\klampt\robotsim.py", line 25, in swig_import_helper
    import _robotsim
ModuleNotFoundError: No module named '_robotsim' 
krishauser commented 3 years ago

The most recent version of Klampt (0.8.7) has now been released via pip install for Linux and Windows. Perhaps you can try to see if "pip install -U klampt" will do the trick.

krishauser commented 2 years ago

Closed due to inactivity.