Open MiaoDragon opened 4 months ago
Something you could do is just check the geometry type so you're not bound to arbitrary indexing e.g:
bool is_capsule = model.geometryObjects[model.collisionPairs[j].first].geometry->getNodeType() == hpp::fcl::NODE_TYPE::GEOM_CAPSULE
Bug description
Hello,
While experimenting with the collision detection functions of Pinocchio provided with hpp-fcl package, I experienced inconsistency in the contact pairs returned by the function. For instance, my
collision_model.collisionPairs[0].first
might point to a link named "arm_left_link_4_u_0", which is represented as a mesh file (or BVHModelOBBRSS in hpp-fcl); andcollision_model.collisionPairs[0].second
might point to "octree" representing the environment point cloud. However, after I run computeCollisions, and extract the contact bycontact=collision_data.collisionResults[0].getContact(0)
, I havecontact.o1
being a OcTree object of hppfcl, andcontact.o2
being a BVHModelOBBRSS object of hppfcl. This is inconsistent with the ones stored in thecollision_model.collisionPairs[0]
, since the expected result should becontact.o1
being BVHModelOBBRSS, andcontact.o2
being OcTree. Is there any way to fix this problem?The system I use us Ubuntu 20.04. I'm using the latest devel branch of Pinocchio (commit abcdc6461f2bde941c3d97456497e0d1d90ce87e). hpp-fcl is the latest version (2.4.4).
To reproduce, install the motoman package from motoman, use the following code and save as file motoman_config.py:
and the following code for testing:
System