In robotics and computer graphics, collision detection is the algorithmic process of identifying when the geometric representations of two or more objects overlap or make contact. It is a foundational component of motion planning, physics simulation, and real-time control systems, ensuring a robot's planned path or current action does not result in an impact with obstacles, itself, or other agents. Efficient algorithms must operate within strict computational budgets, especially for complex geometries and dynamic environments.
Glossary
Collision Detection

What is Collision Detection?
Collision detection is the computational process of determining whether two or more geometric objects intersect or are in contact, a fundamental requirement for safe motion planning and simulation.
The core computational challenge involves efficiently testing for intersections between geometric primitives, often within a configuration space (C-space) where the robot's entire state is a single point. Common acceleration structures include bounding volume hierarchies (BVH) and spatial hashing. For continuous motion, continuous collision detection (CCD) checks for intersections across the entire swept volume of a movement between time steps, which is critical for preventing tunneling—where fast-moving objects pass through thin obstacles undetected in discrete checks.
Core Characteristics of Collision Detection
Collision detection is a foundational geometric computation for safe robotics. Its characteristics define the trade-offs between speed, accuracy, and the complexity of the objects involved.
Broad vs. Narrow Phase
Collision detection is typically performed in two stages to optimize performance.
- Broad Phase: Quickly identifies pairs of objects that are potentially colliding using computationally cheap bounding volumes (like Axis-Aligned Bounding Boxes - AABBs). This culls obviously non-intersecting pairs.
- Narrow Phase: Performs exact, precise geometric intersection tests on the candidate pairs from the broad phase. This uses algorithms like the Gilbert–Johnson–Keerthi (GJK) algorithm or Separating Axis Theorem (SAT) for convex shapes.
This hierarchical approach is critical for real-time systems with many objects, as it avoids performing O(n²) expensive narrow-phase checks.
Discrete vs. Continuous
The temporal nature of the check is a key differentiator.
- Discrete Collision Detection: Checks for intersections at discrete time steps (e.g., each simulation tick or control cycle). It can suffer from tunneling, where fast-moving objects pass through thin obstacles between checks.
- Continuous Collision Detection (CCD): Models the motion of objects between time steps, often as a swept volume. It computes the exact time of impact (TOI), preventing tunneling. CCD is essential for high-speed robotics (e.g., drone flight) and accurate physics simulation but is computationally more expensive.
Choosing between them is a trade-off between safety and computational cost.
Shape Representation Complexity
The geometric model of an object directly impacts the algorithm choice and cost.
- Primitive Shapes: Spheres, capsules, boxes, and cylinders allow for closed-form, analytic intersection tests that are extremely fast. Robots are often approximated with collections of primitives.
- Convex Polyhedra: More general than primitives. Efficient algorithms like GJK and EPA (Expanding Polytope Algorithm) are used for intersection and penetration depth calculation.
- Concave (Non-Convex) Meshes: Represent complex geometry (e.g., a detailed robot gripper). They require decomposition into convex parts (convex decomposition) or slower, more general methods like triangle-triangle intersection tests.
- Signed Distance Fields (SDFs): Represent space as a grid of distances to surfaces. Collision checking becomes a fast lookup, and penetration depth is readily available, useful for optimization and control.
Static vs. Dynamic Environments
The assumed behavior of obstacles dictates algorithmic strategy.
- Static Environments: The obstacle map is fixed. This allows for extensive precomputation, such as building spatial acceleration structures (Bounding Volume Hierarchies - BVHs, kd-trees, octrees) that are queried during runtime for fast broad-phase culling.
- Dynamic Environments: Obstacles can move. This invalidates precomputed structures, requiring incremental updates or algorithms designed for moving objects, like Dynamic AABB Trees. It also introduces the challenge of predicting future obstacle states for proactive avoidance, linking collision detection to motion planning.
Deterministic vs. Probabilistic
Relates to the certainty and completeness of the collision check.
- Deterministic (Exact): Algorithms that provide a definitive yes/no answer and often exact contact data (penetration depth, contact normal). Used for physics simulation and precise manipulation where exact contact resolution is required.
- Probabilistic (Approximate): Used in sampling-based motion planning (e.g., RRT, PRM). A collision checker is queried millions of times. For complex geometry, an exact check may be too slow. Instead, a probabilistic collision detector may sample points on the robot's surface, providing a high-confidence (but not guaranteed) answer much faster, trading perfect accuracy for planning speed.
Integration with Motion Planning
Collision detection is not an isolated module but deeply integrated into the planning pipeline.
- Validity Checking: The core service: answering
isStateValid(config)orisPathValid(trajectory)for a planner. - Distance Queries: Beyond binary checks, many planners need distance-to-collision or penetration depth. This gradient information is used by gradient-based optimizers (e.g., CHOMP, STOMP) to push trajectories out of collision.
- Time Parameterization: After a geometric path is found, it must be assigned speeds and timings. Collision-aware time parameterization uses velocity-dependent swept volumes and CCD to ensure the final trajectory is dynamically feasible and safe.
Efficient collision checking is often the bottleneck in motion planning systems.
How Collision Detection Works
Collision detection is the computational process of determining whether two or more geometric objects intersect or are in contact, a fundamental requirement for safe motion planning and simulation.
At its core, collision detection is a geometric intersection test. For motion planning, it must be performed millions of times to verify that every proposed robot configuration, or state along a trajectory, lies within free space and does not intersect with obstacles. Efficient algorithms use spatial data structures like bounding volume hierarchies (BVH) or signed distance fields (SDF) to avoid expensive pairwise checks between all object primitives. This enables planners to quickly query whether a given robot pose is collision-free.
The process is often separated into a broad phase and a narrow phase. The broad phase uses coarse volumetric approximations to identify pairs of objects that are potentially colliding. The narrow phase then performs precise geometric calculations on those candidate pairs using convex decomposition or triangle mesh intersection tests. For real-time robotic control, deterministic and low-latency collision checking is critical, often leveraging GPU acceleration or specialized physics engines to meet tight loop deadlines for safe operation.
Applications and Use Cases
Collision detection is a foundational computational primitive enabling safe and effective physical interaction. Its applications span from real-time robotic control to high-fidelity simulation and interactive digital experiences.
Manipulation & Grasping
For a robot to manipulate objects, it must understand spatial relationships. Collision detection is used for:
- Grasp Synthesis: Evaluating candidate gripper poses to avoid colliding with the object or the environment.
- Task and Motion Planning (TAMP): Sequencing manipulation actions where each step must be collision-free.
- Contact State Estimation: Determining if and how the end-effector is touching an object, which is critical for force-controlled operations like insertion or assembly. Here, collision models often incorporate tolerances and Signed Distance Fields (SDFs) to measure proximity, not just binary contact.
Autonomous Vehicle & Drone Navigation
Self-driving cars and drones use collision detection at multiple levels of their autonomy stack:
- Global Path Planning: Finding a coarse, obstacle-free route using map data.
- Local Perception & Prediction: Using sensor data (LiDAR, radar) to dynamically construct a representation of nearby obstacles (often as bounding boxes or occupancy grids) for continuous collision checking.
- Emergency Braking & Evasion: Executing last-minute, safety-critical maneuvers. The challenge scales with speed and requires probabilistic checks to account for sensor noise and prediction uncertainty.
Computer-Aided Design (CAD) & Manufacturing
In industrial engineering, collision detection prevents costly errors:
- Assembly Planning: Verifying that parts can be assembled in a specified sequence without interference.
- CNC Toolpath Verification: Simulating the milling tool's movement to prevent collisions with the workpiece or machine fixtures.
- Robotic Cell Layout: Ensuring industrial robots have sufficient clearance from walls, other robots, and human workers. These applications often use precise, tessellated mesh representations of parts and require static and kinematic collision checks.
Computer Graphics, Gaming & VR/AR
This domain demands extremely high-speed collision detection for realism and interactivity:
- Rendering & Physics: Determining object interactions for realistic physics simulations (ragdolls, destruction).
- Character Animation: Enabling inverse kinematics (IK) solvers to position characters without interpenetration (e.g., feet sliding into floors).
- User Interaction: Detecting clicks, grabs, and raycasts in VR/AR environments. Efficiency is paramount, leading to widespread use of broad-phase algorithms (like BVH trees) to quickly cull impossible collisions before precise narrow-phase checks.
Collision Detection Algorithm Comparison
A comparison of core algorithms used to determine intersection between geometric primitives, highlighting trade-offs in computational complexity, accuracy, and suitability for different stages of the motion planning pipeline.
| Algorithm / Feature | Broad-Phase (Bounding Volume) | Narrow-Phase (Exact Geometry) | Continuous Collision Detection (CCD) |
|---|---|---|---|
Primary Purpose | Cull non-interacting object pairs efficiently | Compute precise contact for candidate pairs | Detect collisions between moving objects across a time interval |
Typical Primitives | Axis-Aligned Bounding Box (AABB), Sphere, Oriented Bounding Box (OBB) | Convex Polygons/Polyhedra, Triangles, Spheres | Swept Volumes, Linear/Bilinear Vertex Trajectories |
Algorithmic Complexity (Pair Check) | O(1) for overlap test (e.g., AABB) | O(n) for GJK; O(log n) for EPA termination | O(n) for linear CCD; higher for rotational |
Output | Boolean: Potential Collision | Boolean + Contact Data (Penetration Depth, Normal, Points) | Boolean + Time of Impact (TOI) + Contact Data at TOI |
Common Algorithms | Sweep & Prune, Grid/Octree Spatial Hashing, Bounding Volume Hierarchies (BVH) | Gilbert–Johnson–Keerthi (GJK), Expanding Polytope Algorithm (EPA), Separating Axis Theorem (SAT) | Conservative Advancement, Continuous GJK, Root-finding on motion equations |
Use Case in Planning | Global path validation, dynamic environment updates | Final path verification, contact modeling for manipulation | High-speed trajectory validation, simulation safety |
Tunable Accuracy | Low (Conservative) | High (Exact for convex shapes) | Variable (Depends on tolerance and time step subdivision) |
Implementation Libraries | Bullet (Broadphase), FCL, OMPL (geometric components) | Bullet Collision, FCL, Open Dynamics Engine (ODE) | Bullet, MuJoCo, Drake |
Frequently Asked Questions
Collision detection is a foundational computational geometry problem for robotics and simulation. These questions address its core mechanisms, performance considerations, and integration into larger systems.
Collision detection is the computational process of determining whether two or more geometric objects intersect or are in contact. It works by mathematically testing for overlap between the shapes representing objects in a scene. For simple shapes like spheres or axis-aligned bounding boxes (AABBs), this involves checking if the distance between centers is less than the sum of their radii or if their extents overlap along all axes. For complex polygonal meshes, the process typically employs a multi-phase approach: a broad phase uses simple bounding volumes to quickly cull pairs of objects that are far apart, followed by a narrow phase that performs exact geometric intersection tests (e.g., using the Separating Axis Theorem for convex polyhedra) on the remaining candidate pairs. The output is a boolean result (collision/no collision) and often additional data like contact points, penetration depth, and collision normals.
Enabling Efficiency, Speed & Accuracy
Intelligent Analysis, Decision & Execution
We build AI systems for teams that need search across company data, workflow automation across tools, or AI features inside products and internal software.
Talk to Us
Search across company data
Give teams answers from docs, tickets, runbooks, and product data with sources and permissions.
Useful when people spend too long searching or get different answers from different systems.

Automate internal workflows
Use AI to route work, draft outputs, trigger actions, and keep approvals and logs in place.
Useful when repetitive work moves across multiple tools and teams.

Add AI to products and internal tools
Build assistants, guided actions, or decision support into the software your team or customers already use.
Useful when AI needs to be part of the product, not a separate tool.
Related Terms
Collision detection is a foundational component within a broader algorithmic stack for safe robotic motion. These related concepts define the spaces, constraints, and planning methods that rely on its results.
Configuration Space (C-Space)
The Configuration Space (C-Space) is a mathematical transformation where every possible state of a robot (its joint angles, position, orientation) is mapped to a single point. This simplifies collision checking from complex 3D geometry to a point-in-region test. Obstacles in the physical world become forbidden regions, or C-obstacles, within this abstract space. Planning algorithms like RRT and PRM operate directly in C-Space to find paths where the robot, represented as a point, never enters these forbidden zones.
Signed Distance Field (SDF)
A Signed Distance Field (SDF) is a volumetric data structure that, for any point in 3D space, stores the Euclidean distance to the nearest object surface. The sign indicates whether the point is inside (negative) or outside (positive) an object. SDFs provide a continuous, differentiable representation of geometry, enabling:
- Efficient proximity queries for collision detection.
- Gradient information for optimization-based planners to push trajectories away from obstacles.
- Smooth cost functions in trajectory optimization, penalizing proximity to surfaces.
Rapidly-exploring Random Tree (RRT)
Rapidly-exploring Random Tree (RRT) is a sampling-based motion planning algorithm designed for high-dimensional spaces. It incrementally builds a tree of collision-free configurations, randomly exploring the C-Space. At each iteration:
- A random sample is drawn from C-Space.
- The nearest node in the existing tree is found.
- A new node is created by extending from the nearest node toward the random sample.
- The new edge is validated via collision detection. If collision-free, it's added to the tree. This process continues until a node is placed near the goal. RRT is probabilistically complete, meaning it will find a path if one exists, given enough time.
Probabilistic Roadmap (PRM)
Probabilistic Roadmap (PRM) is a sampling-based planner that operates in two phases: a learning phase and a query phase.
- Learning Phase: Random, collision-free robot configurations (nodes) are sampled in C-Space. Nearby nodes are connected with local paths, each rigorously checked with collision detection, forming a graph (the roadmap).
- Query Phase: Given a specific start and goal, they are connected to the roadmap, and a standard graph search (e.g., A*) finds a path. PRM is efficient for multiple queries in static environments, as the computationally expensive collision checking is performed once during roadmap construction.
Velocity Obstacle (VO)
The Velocity Obstacle (VO) is a geometric method for local, reactive collision avoidance with moving obstacles. It works in the robot's velocity space. For each dynamic obstacle, the VO defines the set of all robot velocities that would cause a collision within a specified time window (τ). The core principle:
- The robot selects a new velocity from outside the union of all Velocity Obstacles.
- This velocity is also constrained by the robot's dynamics and kinematic limits. Methods like the Dynamic Window Approach (DWA) use this concept to find safe, reachable velocities in real-time, relying on continuous collision detection predictions.
Control Barrier Function (CBF)
A Control Barrier Function (CBF) is a mathematical formalism for synthesizing safety-critical controllers. It defines a safety set (e.g., all states where the robot is collision-free) using a continuously differentiable function. The controller is designed to ensure this function's derivative along the system's trajectories keeps it positive, thereby guaranteeing the state remains in the safe set. CBFs provide a formal proof of collision avoidance when integrated with a motion planner or controller, moving beyond heuristic collision checks to provably safe control laws.

About the author
Prasad Kumkar
CEO & MD, Inference Systems
Prasad Kumkar is the CEO & MD of Inference Systems and writes about AI systems architecture, LLM infrastructure, model serving, evaluation, and production deployment. Over 5+ years, he has worked across computer vision models, L5 autonomous vehicle systems, and LLM research, with a focus on taking complex AI ideas into real-world engineering systems.
His work and writing cover AI systems, large language models, AI agents, multimodal systems, autonomous systems, inference optimization, RAG, evaluation, and production AI engineering.
Partnered with leading AI, data, and software stack.
How We Work
Custom AI workflows for your Business
One-fit-all AI don't work for modern businesses. At Inferensys, we aim to understand your business & custom requirements; which we use to define most efficient agentic workflows, the data, and the tools for your business.
01
Review the use case
We understand the task, the users, and where AI can actually help.
Read more02
Pick the right approach
We define what needs search, automation, or product integration.
Read more03
Build the first useful version
We implement the part that proves the value first.
Read more04
Improve from there
We add the checks and visibility needed to keep it useful.
Read moreThe first call is a practical review of your use case and the right next step.
Talk to Us