fix(robotics): enable collider for mesh-bearing URDF collision links - #5
aki-xavier wants to merge 1 commit into
Conversation
The URDF importer fills `shapeFile`/shape transforms for mesh-bearing
<collision> geometry but leaves `colliderType` at the prefab default
(ColliderType::None). The resulting bot has no collision representation:
mochi contact queries (TotalContactForce / ContactPoints) are refused
("Contact queries are only supported for actors with contact sample
points") and no contact is generated with other actors.
Set ColliderType::Auto when a collision mesh resolves, so imported URDF
bots participate in contact. Links without a mesh collision keep the
default unchanged.
Regression tests: mesh collision -> Auto, primitive-only collision ->
None.
|
Hi @aki-xavier! Thank you for your pull request and welcome to our community. Action RequiredIn order to merge any pull request (code, docs, etc.), we require contributors to sign our Contributor License Agreement, and we don't seem to have one on file for you. ProcessIn order for us to review and merge your suggested changes, please sign at https://code.facebook.com/cla. If you are contributing on behalf of someone else (eg your employer), the individual CLA may not be sufficient and your employer may need to sign the corporate CLA. Once the CLA is signed, our tooling will perform checks and validations. Afterwards, the pull request will be tagged with If you have received this in error or have any questions, please contact us at cla@meta.com. Thanks! |
|
@aki-xavier Can you help me understand the problem a bit better? I'm not sure this is fixing a bug:
|
|
Could you please also share the URDF if possible? |

Problem
LoadBotPrefabFromUrdfFilefillsshapeFile/shapeRotation/shapeTranslation/shapeScalefor mesh-bearing<collision>geometry, but leavescolliderTypeat the prefab default (ColliderType::None). The resultingBothas no collision representation at all:Change
When a URDF
<collision>mesh resolves on disk, setlink->colliderType = ColliderType::Autoso the link participates in contact. Links without a mesh collision (or with only primitive geometry) keep the prefab default and remain untouched.This mirrors what the old importer's mesh-based collision path was meant to do, and is required for both mochi's contact queries and the contact simulation itself.
Tests
Added to
urdf_mesh_resolution_test.cpp:MeshCollisionEnablesColliderType— mesh<collision>→shapeFileset andcolliderType == Auto;PrimitiveCollisionKeepsDefaultColliderType— primitive-only<collision>→shapeFileempty andcolliderType == None(unchanged default).Verification (point of failure → after)
Using a 6-DOF arm URDF whose collision meshes are STL meshes: before the fix every link reports
colliderType=0(None) andRegisterQuery(QueryType::TotalContactForce)fails for all links; after the fix, mesh-bearing links report a real collider (resolved to the SDF collider), contact queries register, and a wall-push experiment produces a real contact wrench (bounded, stable contact force scaling with controller stiffness).Note: the importer's existing behavior of skipping primitive
<collision>geometry (boxes/cylinders/spheres) is unchanged — such links still get no collider, which is why a URDF whose collisions are all primitives must be given mesh collisions (or the importer extended later) to become contact-enabled.