arXiv:2611.03944cs.RONov 2026

Manuscript Offprint

arXiv:2611.03944

h-NESDF: An Infinitely Differentiable Signed Distance Between Two Sets with Robotic Applications

Vinicius Mariano Gonçalves, Pedro Antonio de Souza Campos Rodrigues

Open access. PaperVantage converted this article to text, so layout and figures may differ from the original.

Vinicius Mariano Gonçalves, Pedro Antonio de Souza Campos Rodrigues

Abstract— Computing distances between sets is important in many robotic applications, such as motion planning and control. In many applications, derivatives of the distance are needed as well. It is well known that the Euclidean distance is not always differentiable, which create issues to algorithms that need a derivative. In this paper, we introduce NESDF, the Normal Euclidean Signed Distance Function between two general (with mild regularity assumptions but possibly non-convex) sets. This metric is still not differentiable, but it allows us to introduce a generalization, h-NESDF, which has a smoothing parameter hh such that the metric is infinitely differentiable for all h>0h > 0 and that reduces to the NESDF when hh goes to 0. The metric is amenable to GPU parallelization, and thus can be computed efficiently. We show extensive simulation results to evaluate its viability in motion planning.

Index Terms—Collision Avoidance, Computational Geometry, Constrained Motion Planning

I. INTRODUCTION

Distance computations are central to robot motion planning, collision detection, and control. Their integration into gradient-based planners and feedback controllers often requires more than accurate distance values: the underlying functions must also provide sufficiently regular derivatives. Control Barrier Functions (CBFs), for example, rely on gradients, and some formulations require higher-order derivatives of distance-like functions to enforce safety constraints [1]–[7]. Insufficient regularity can lead to excessively large control inputs [8] or noisy control signals [9]. Motion planners such as CHOMP [10] similarly use distance gradients to update trajectories and resolve collisions during optimization. In this setting, signed distance-like functions are particularly useful because their negative values encode overlap and provide information about infeasible configurations.

However, Euclidean distance functions are generally not differentiable at every configuration [11]. A common source of nonsmoothness is a change in the geometric features that determine the closest points. Such transitions often involve nonunique witness points, namely, pairs of points, one on each object, that attain the minimum distance. This can produce abrupt changes in the distance gradient as the relative pose of the objects varies.

Several works have investigated differentiable alternatives to Euclidean distance functions for robotic applications. The approach in [8] introduced an infinitely differentiable,

Figure

Fig. 1: The proposed NESDF and h-NESDF distance metrics between two objects A\mathcal{A} and B\mathcal{B} when one of them is rotating. Note that the NESDF has some sharp corners (non-differentiables), whereas the h-NESDF is infinitely differentiable.

unsigned distance-like function between convex sets and applied it to second-order kinematic control. The method generalized von Neumann's alternating projection algorithm into an iterative distance computation, but remained cumbersome to evaluate and did not guarantee a zero value when the sets overlapped. Subsequently, [9] introduced a substantially simpler formulation that correctly vanishes upon overlap, while retaining the convexity assumption and unsigned nature of the function. The work in [12] developed a differentiable distance-like function between a point and an object represented as a set of discrete points, and used it to construct safe and smooth guiding vector fields that avoid collision with obstacles represented as point clouds. Signed differentiable distance metric between convex sets were also developed in [6], [13], using different smoothing techniques and demonstrating applications to CBF-based control. Related constructions also arise outside robotics, particularly in surface reconstruction. For example, [14] reconstructs a smooth approximation of a point-to-set signed distance field from sampled surface data. Similarly, [15] proposes an explicit differentiable level-set formulation that approximates the signed distance to a geometry. The methods discussed above either assume convexity for both extended objects or address point-to-set distances. More recently, [16] introduced a smooth signed distance metric for nonconvex objects aiming to use it within a contact simulation framework. Table I shows comparisons between different differentiable distance approaches.

In this work, we propose a signed, infinitely differentiable distance-like function between two possibly nonconvex objects. We first introduce the Normal Euclidean Signed Distance Function (NESDF), a potentially nonsmooth function whose sign characterizes separation, contact, and interior overlap. We then apply a smoothing procedure to obtain the h-NESDF, which is infinitely differentiable with respect to

V. M. Gonçalves is with the Department of Electrical Engineering, Federal University of Minas Gerais (UFMG), Belo Horizonte, Brazil. Email: marianoauto@ufmg.br. P. A. S. C. Rodrigues with the Control and Automation Engineering Undergraduate Program at Federal University of Minas Gerais (UFMG), Belo Horizonte, Brazil. E-mail: pedro.ufmg2@gmail.com

TABLE I: Comparison of differentiable distances proposed in the literature. Here, “Detect Collision” means that the differentiable distance is positive if and only if there is no overlap between the objects, and hh is a smoothing parameter.

WorkType of SetSignedDetect CollisionTime Complexity
Liu et al. (2021) [14]A point and a possibly nonconvex set in R3\mathbb{R}^3, represented as a point cloudYesNoO(K)\mathcal{O}(K) per query for the full formula, in which KK is the number of points. Local evaluation uses k=10k=10 nearby points, plus neighbor-search cost
Hicken et al. (2022) [15]A point and a possibly nonconvex set in R2\mathbb{R}^2 or R3\mathbb{R}^3, represented as a point cloudYesNoO(K)\mathcal{O}(K) per query for the full formula, in which KK is the number of points. The implementation uses k=10k=10 nearest points, plus neighbor-search cost
Gonçalves et al. (2024) [8]Two convex sets in Rn\mathbb{R}^n. Only give practical approximate formulae for balls, boxes and cylinders.NoNo, with arbitrarily small error as h→+0h \to +0Iterative, no fixed number of steps
Beker et al. (2025) [16]Almost arbitrary sets in Rn\mathbb{R}^n, represented as point cloudsYesNo, with arbitrarily small error as h→+0h \to +0O(KAKB)\mathcal{O}(K_{\mathcal{A}}K_{\mathcal{B}}), where KAK_{\mathcal{A}} and KBK_{\mathcal{B}} are the numbers of points in the respective objects
Wu et al. (2025) [6]Two convex polyhedral sets in R2\mathbb{R}^2YesNo; conservative for finite smoothing, with arbitrarily small error as h→+0h \to +0O(VAVB)\mathcal{O}(V_{\mathcal{A}}V_{\mathcal{B}}), where VAV_{\mathcal{A}} and VBV_{\mathcal{B}} are the numbers of vertices
Gonçalves et al. (2026) [9]Two convex sets in Rn\mathbb{R}^n. Only gives practical formulae for polyhedra.NoYesIterative, no fixed number of steps. If the two objects are polyhedral and have FA,FBF_{\mathcal{A}}, F_{\mathcal{B}} faces, respectively, each step is O(FA+FB)\mathcal{O}(F_{\mathcal{A}}+F_{\mathcal{B}})
Nunes et al. (2026) [12]Point cloud and a point in Rn\mathbb{R}^nNoYesO(K)\mathcal{O}(K), where KK is the number of points
Bartelt et al. (2026) [13]Two convex polyhedral sets in R3\mathbb{R}^3YesNot exactly, but collision detection can become arbitrarily accurate by increasing the number of normals NNO(VAVBN)\mathcal{O}(V_{\mathcal{A}}V_{\mathcal{B}}N), where VAV_{\mathcal{A}} and VBV_{\mathcal{B}} are the numbers of vertices and NN is the number of normals used. The paper proposes, by default, N=O(VA+VB)N=\mathcal{O}(V_{\mathcal{A}}+V_{\mathcal{B}}).
OursAlmost arbitrary sets in Rn\mathbb{R}^n, one of them at least represented as a point cloudYesNo, with arbitrarily small error as h→+0h \to +0If A\mathcal{A} is represented by a point cloud with KAK_{\mathcal{A}} points, the complexity is O(KA)\mathcal{O}(K_{\mathcal{A}}) calls of a function related to B\mathcal{B}. If B\mathcal{B} is also a point cloud, each call is O(KB)\mathcal{O}(K_{\mathcal{B}}), resulting in O(KAKB)\mathcal{O}(K_{\mathcal{A}}K_{\mathcal{B}}).

smoothly parameterized rigid motions. Its sampled approximation is amenable to GPU parallelization. Figure 1 shows an example of the hh-NESDF computed for two LL shapes as one of them rotates, with three different values of hh, one of them being as h→+0h \to +0, that is, the non-differentiable case.

Our construction differs from the proposed metric in [16] in several respects, bringing some benefits. One distinction concerns the use of the gradient of the metric in a gradient-ascent procedure for resolving overlap between two objects, useful, for example, in motion planning. In some deeply overlapping configurations, the metric in [16] produces an ascent direction that increases geometric overlap, whereas ours produces the correct behavior. These distinctions are examined in detail throughout the paper.

The contributions of this paper are then:

  1. NESDF, the Normal Euclidean Signed Distance Function, a novel signed distance metric between two general, possibly non-convex sets in Rn\mathbb{R}^n. We establish that this metric has the expected behavior of being positive when the two objects do not overlap and negative when they overlap. This metric is also amenable for a smoothification procedure.

  2. hh-NESDF, a smoothed version of NESDF that is infinitely differentiable, with smoothing parameter hh that controls the smoothing. We show that when h→+0h \to +0, NESDF is recovered. This metric can be implemented in an approximated manner using sampled point clouds and normal vectors, and parallelized on a GPU. This metric brings benefits when compared to other comparable approaches, as [16].

  3. We present extensive computational experiments assessing hh-NESDF efficiency and usefulness in motion planning .

For readability, all proofs and auxiliary lemmas are deferred to the Appendix.

References (25)