petercorke / robotics-toolbox-python

Robotics Toolbox for Python
MIT License
2.07k stars 433 forks source link

Failed to detect gripper collision #439

Open EstanislauFilho opened 4 months ago

EstanislauFilho commented 4 months ago

I am using a Kinova Gen3 manipulator and need to know when the gripper has collided with a specific obstacle.

As can be seen in the first image below, the instruction iscollision = robot.iscollided(robot.q, obstacle) is commented out because it returns an error in most executions. When investigating the source code, I encountered the error present in the terminal in the second image. After adding the ".dae" extension in the code, I encountered the following error: File "/home/xxx/anaconda3/envs/xxx/lib/python3.10/site-packages/spatialgeometry/geom/CollisionShape.py", line 200, in _init_pob col = p.createCollisionShape( # type: ignore pybullet.error: createCollisionShape failed.

Screenshot from 2024-05-11 21-39-43

Screenshot from 2024-05-16 10-44-09

Is there a practical solution to solve this problem?

TJMolnar commented 3 months ago

I am also having this issue with the Kinova and I have narrowed it down to a limitation in the spatialgeometry package used by this toolbox, which itself relies on pybullet to handle collision meshes from the URDF. Kinova provides Collada (.dae) mesh files for their Gen3 arm, but pybullet does not seem to support them in this context. Indeed the spatialgeometry library is explicitly only loading STL files, and so is actually ignoring these meshes entirely. Collada/.dae files are a very common format for meshes in URDF's and are (as in this case) often provided in official packages from manufacturers, so this places a significant limitation on the usage of this toolbox.

EstanislauFilho commented 1 month ago

@TJMolnar I am trying to check for situations where the Kinova Gen3 manipulator collided with itself. Do you know any simple way to verify this situation? I tried a few things but nothing worked.