{"id":24447,"library":"python-fcl","title":"python-fcl","description":"Python bindings for the Flexible Collision Library (FCL), providing collision detection and proximity queries on 3D geometry. Current version 0.7.0.11, requires Python >=3.9. Releases are irregular, mostly bugfix releases.","status":"active","version":"0.7.0.11","language":"python","source_language":"en","source_url":"https://github.com/berkeleyautomation/python-fcl","tags":["collision detection","FCL","robotics","3D geometry","numpy"],"install":[{"cmd":"pip install python-fcl","lang":"bash","label":"Install from PyPI"}],"dependencies":[{"reason":"Required for geometry data structures (vectors, transforms).","package":"numpy","optional":false},{"reason":"C++ FCL library; python-fcl is a binding, but often pre-built wheels bundle it.","package":"fcl","optional":false}],"imports":[{"note":"The main module is 'fcl', not 'python_fcl' or 'pyfcl'.","symbol":"fcl","correct":"import fcl"}],"quickstart":{"code":"import fcl\nimport numpy as np\n\n# Create box geometry\nbox = fcl.Box(1, 1, 1)\nobj = fcl.CollisionObject(box, fcl.Transform())\n\n# Create collision request/result\nreq = fcl.CollisionRequest()\nres = fcl.CollisionResult()\n\n# Self-collision check (not useful, but simple)\nret = fcl.collide(obj, obj, req, res)\nprint(f\"Collision? {res.is_collision}\")","lang":"python","description":"Basic collision check between two identical boxes."},"warnings":[{"fix":"Check ret == 1 for collision detected, or use res.is_collision / res.is_distance_valid.","message":"Version 0.7.0.x changed the return type of fcl.collide and fcl.distance from bool to int (return code). Old code checking if ret == True will break.","severity":"breaking","affected_versions":">=0.7.0.0 <0.7.0.11"},{"fix":"Always use numpy arrays in row-major format; do not transpose unless explicitly documented.","message":"Python-fcl uses row-major order for matrices (numpy default), while FCL C++ uses column-major internally. Incorrect transposition can lead to wrong transforms.","severity":"gotcha","affected_versions":"all"},{"fix":"Keep a reference to all CollisionObjects until after all queries are done.","message":"CollisionObject instances must outlive the collision query; they are not copied. Deleting or reusing the same object in parallel can cause segfaults.","severity":"gotcha","affected_versions":"all"}],"env_vars":null,"last_verified":"2026-05-01T00:00:00.000Z","next_check":"2026-07-30T00:00:00.000Z","problems":[{"fix":"Run 'pip install python-fcl' (note: import name is 'fcl').","cause":"Package not installed or installed under different name.","error":"ImportError: No module named fcl"},{"fix":"Upgrade: pip install --upgrade python-fcl. Or check if API changed: use 'import fcl; print(dir(fcl))'.","cause":"Very old version (pre-0.6) or copy with renaming.","error":"AttributeError: module 'fcl' has no attribute 'CollisionObject'"}],"ecosystem":"pypi","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}