Backend-neutral collision queries between implicit signed-distance shapes.
More...
#include <tesseract/collision/implicit_sdf_collision_solver.h>
#include <tesseract/geometry/geometries.h>
#include <tesseract/geometry/impl/signed_distance_field.h>
#include <algorithm>
#include <array>
#include <cmath>
#include <limits>
#include <stdexcept>
#include <utility>
Backend-neutral collision queries between implicit signed-distance shapes.
The multi-start optimization strategy is adapted from MuJoCo's SDF collision implementation: https://github.com/google-deepmind/mujoco/blob/main/src/engine/engine_collision_sdf.c MuJoCo is licensed under the Apache License, Version 2.0.
- Copyright
- Copyright (c) 2026, Tesseract Robotics
- License
- Software License Agreement (Apache License)
- Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0
◆ collideImplicitSDF()
Find contacts between two implicit signed-distance shapes.
This adapts MuJoCo's multi-start SDF collision strategy: deterministic Halton seeds are optimized over the overlap of the shapes' margin-expanded AABBs using a composite collision objective and backtracking gradient descent. Contact distance and nearest points are then recovered by projecting the converged point onto both zero level sets.
- Parameters
-
| shape0 | First implicit shape |
| shape1 | Second implicit shape |
| config | Solver configuration |
- Returns
- Contacts with normals directed from
shape0 toward shape1
- Exceptions
-
| std::invalid_argument | If either shape or any solver configuration value is invalid |
◆ makeImplicitSDFShape()
Create a world-coordinate implicit representation of a supported Tesseract geometry.
Supported geometries are box, sphere, cylinder, cone, capsule, and signed distance field. This adapter is backend-neutral and is used by FCL; other backends may provide callbacks around their native distance representations and call collideImplicitSDF directly.
- Parameters
-
| geometry | Geometry to represent |
| pose | Geometry pose in world coordinates |
- Returns
- A valid implicit shape when the geometry is supported, otherwise an invalid shape
- Exceptions
-
| std::invalid_argument | If the pose or supported geometry data is invalid, or if an SDF has nonuniform scale |
◆ gradient
Initial value:= [center0, center1](const Eigen::Vector3d& point) {
const Eigen::Vector3d offset0 = point - center0;
const Eigen::Vector3d offset1 = point - center1;
return (offset0.squaredNorm() < offset1.squaredNorm()) ? offset0.normalized() : offset1.normalized();
}