moveit: moveit_commander fails in Kinetic due to pyassimp regression

In Xenial with pyassimp 3.2, importing moveit_commander fails with:

>>> import moveit_commander
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/vol/sandbox/ros/install/lib/python2.7/dist-packages/moveit_commander/__init__.py", line 3, in <module>
    from planning_scene_interface import *
  File "/vol/sandbox/ros/install/lib/python2.7/dist-packages/moveit_commander/planning_scene_interface.py", line 48, in <module>
    import pyassimp
  File "/usr/lib/python2.7/dist-packages/pyassimp/__init__.py", line 1, in <module>
    from .core import *
  File "/usr/lib/python2.7/dist-packages/pyassimp/core.py", line 23, in <module>
    from . import structs
ImportError: cannot import name structs

@davetcoleman Did you ever tried to run moveit from python in kinect?

About this issue

  • Original URL
  • State: closed
  • Created 8 years ago
  • Comments: 40 (21 by maintainers)

Commits related to this issue

Most upvoted comments

Was able to fix it. Pull the latest version from assimp. https://github.com/assimp/assimp.git and build it. make install will copy it to /usr/local/lib. Then go to /port/PyAssimp in the source folder and run python setup.py install. This should create the necessary files in /usr/local/lib/python2.7/dist-packages/pyassimp.

move_group_python_interface.py and using the commander works now flawlessly (tested with 16.04 and kinetic)

I still have this issue, with ros-kinetic-moveit installed and fully updated Ubuntu 16.04 system. It is fixed by doing the following:

pip install --user pyassimp

It requires pyassimp 3.3, installed by default is 3.2.

Following the moveit_commander and fell into this. [Xenial, Kinetic]. Workaround:

  1. removed installed python-assimp (<=3.2) by sudo dpkg --remove --force-depends python-pyassimp (as apt will remove dependencies also)
  2. installed by pip pyassimp (3.3) using sudo -H flag (to replace the /usr one)

sudo pip uninstall pyassimp and then, sudo pip install pyassimp , which will install pyassimp 3.3, solved the problems…may help.

sudo pip uninstall pyassimp and then, sudo pip install pyassimp , which will install pyassimp 3.3, solved the problems…may help.

Nope, it only worked for you because the current library version of pyassimp on pip when you installed it HAPPENED to be 3.3. Today the current one is 4.1.4, and I get the same error using your same commands. This is not a solution, it’s mere luck.

The way to do this is:

pip install 'pyassimp>=3.3.0,<3.4.0' --force-reinstall

If you also have problems with multiple python versions installed, this is an even more robust solution:

sudo python -m pip install 'pyassimp>=3.3.0,<3.4.0' --force-reinstall

Had this problem before: Process finished with exit code 139 (interrupted by signal 11: SIGSEGV) And it seems it was segmentation fault like @Aparun8 said that was caused by pyassimp error. Found a solution here. Only version 4.1.3 or 3.3 works.

By the way, this was revealed by the new integration_tests 😉

Yeah this issue has been a real pain. I have raised an issue to the developers here

Was able to fix it. Pull the latest version from assimp. https://github.com/assimp/assimp.git and build it. make install will copy it to /usr/local/lib. Then go to /port/PyAssimp in the source folder and run python setup.py install. This should create the necessary files in /usr/local/lib/python2.7/dist-packages/pyassimp.

I can confirm this fixes the problem and moveit_commander works well

Edit: although adding previously working meshes to the scene now raises an error:

  File "/opt/ros/kinetic/lib/python2.7/dist-packages/moveit_commander/planning_scene_interface.py", line 131, in add_mesh
    self._pub_co.publish(self.__make_mesh(name, pose, filename, size))
  File "/opt/ros/kinetic/lib/python2.7/dist-packages/moveit_commander/planning_scene_interface.py", line 105, in __make_mesh
    if len(face.indices) == 3:
AttributeError: 'numpy.ndarray' object has no attribute 'indices'