---
title: Local Safety Ball (LSB) in Robotics Safety
url: https://www.emergentmind.com/topics/local-safety-ball-lsb
type: topic
---

# Local Safety Ball (LSB) in Robotics Safety

Searching arXiv for the specified papers and related "Local Safety Ball" terminology to ground the article in current arXiv records.
arxiv_search.query{"search_query":"all:\"2509.16037\" OR ti:\"Learning Safety for Obstacle Avoidance via Control Barrier Functions\"","max_results":5}
arxiv_search.query: {"search_query":"all:\"2509.16037\" OR ti:\"Learning Safety for Obstacle Avoidance via Control Barrier Functions\"","max_results":5}
arxiv_search.query{"search_query":"all:\"2103.09230\" OR ti:\"Lyapunov Barrier Policy Optimization\"","max_results":5}
Local Safety Ball (LSB) denotes a local safety set constructed around a configuration or state so that admissible motion or policy updates remain within a certified safe neighborhood. In "Learning Safety for Obstacle Avoidance via Control Barrier Functions," the LSB is a Euclidean ball whose radius is given by a learned clearance predictor and whose center is anchored at an extreme point of the robot boundary, yielding a shape-aware collision-avoidance certificate for rigid-body motion [2509.16037]. In "Lyapunov Barrier Policy Optimization," the same term is used in a sublevel-set sense: the local safe neighborhood is induced by a Lyapunov-barrier inequality around each visited state, with conservativeness controlled by slack and barrier parameters under a KL-trust-region update [2103.09230]. The common structure is a state-dependent local envelope that converts safety into barrier-enforced forward invariance or safe policy improvement.

## 1. Conceptual forms of the Local Safety Ball

In the obstacle-avoidance setting, the LSB is explicitly geometric. Let \(q \in \mathbb{R}^n\) denote the robot’s configuration and \(o\) the union of obstacle boundaries. A neural network predicts a clearance \(\hat d(q,o)\), and that prediction is used as the radius of a ball attached to the robot geometry. Safety is then enforced by requiring the rigid-body transition over one time step to remain inside that local ball [2509.16037].

In the safe-RL setting, the LSB is not fundamentally Euclidean. Standard LSB in safe-RL is often written as
\[
LSB(s,r) := \{\, s' : \|s'-s\| \le r \,\}
\]
subject to a state-based safety predicate \(g(s') \le 0\). By contrast, the barrier-based LSB in LBPO is
\[
\{ s' : B(s',\theta) \le 0 \},
\]
where \(B(\cdot)\) is learned from the cost-\(Q\) of a baseline policy. The source text describes this as a model-informed sublevel set that can adapt to local dynamics and safety-landscape [2103.09230].

These two constructions differ in metric and implementation, but both are local, state-dependent, and enforced through barrier conditions. This suggests a unifying interpretation of LSB as a locally certified safe neighborhood whose geometry is inherited either from clearance in configuration space or from a Lyapunov-style residual in state-action space.

## 2. Learned-clearance LSB for obstacle avoidance

The learned-clearance formulation begins with a predictor
\[
\hat d(q,o) \approx \min_{r\in\partial \mathcal{R}(q)} \min_{o'\in\partial \mathcal{O}} \|r-o'\|_2.
\]
The radius is set as
\[
r(q) = \hat d(q,o),
\]
and the associated hazard function is introduced as
\[
h(q) = \hat d(q,o) - r(q) = 0.
\]
Because \(h(q)=0\) by construction, a nontrivial safety constraint is obtained by anchoring the ball at an extreme point of the robot boundary. Let \(s\) be the robot’s reference point and define
\[
r_c(q) \in \arg\max_{r\in\partial \mathcal{R}(q)} \|r-s\|_2.
\]
The Local Safety Ball is then
\[
LSB(q) \coloneqq \mathbb{B}\bigl(r_c(q),\,r(q)\bigr),
\]
where \(\mathbb{B}(c,R)=\{x\in\mathbb{R}^2:\|x-c\|_2\le R\}\) [2509.16037].

Lemma 1 states that if the rigid-body transition over one time step moves every boundary point by at most \(r(q)\), then the entire continuous trajectory of the robot lies within its LSB and hence remains collision-free. This shifts the safety problem from analytic clearance computations, which are described as infeasible for complex geometries, and from polytopic approximations, which are described as intractable when robot configurations are unknown, to learned clearance prediction and local geometric certification.

The formulation is explicitly intended for robots with arbitrary and nonconvex geometries operating in cluttered environments. The abstract further states that the resulting method handles arbitrary, including nonconvex, robot geometries and generates collision-free, dynamically feasible trajectories in cluttered environments [2509.16037].

## 3. Discrete-time high-order CBF encoding

The LSB is encoded as a Discrete-Time High-Order CBF (DHOCBF). The requirement is that between discrete updates \(t \to t+1\), the reference point \(s_t\) does not leave the translated LSB centered at \(r_{c,t}=r_c(q_t)\) with radius \(\tilde d_t=f_\phi(q_t)\). The zero-th-order barrier function is defined as
\[
\psi_0(q_t) \coloneqq \tilde h(q_t) \coloneqq \tilde d_t - \|r_c(q_t)-r_{c,t}\|_2.
\]
By construction, \(\psi_0(q_t)\ge 0\) iff \(s_t\) lies within the ball. If \(\psi_0\) has relative degree \(m\) under the discrete-time dynamics
\[
x_{t+1}=f(x_t,u_t),
\]
the high-order discrete-time CBF sequence is introduced for \(i=1,\dots,m\) as
\[
\psi_i(x_t)=\psi_{i-1}(x_{t+1})-\psi_{i-1}(x_t)+\alpha_i\bigl(\psi_{i-1}(x_t)\bigr),
\]
where each \(\alpha_i\) is a class-\(\kappa\) function and is often chosen as \(\alpha_i(x)=\gamma_i x\) with \(0<\gamma_i\le 1\). In compact form,
\[
\psi_i(q_t)=\Delta \psi_{i-1}(q_t)+\alpha_i(\psi_{i-1}(q_t)),
\]
and the DHOCBF constraint is
\[
\psi_m(q_t)\ge 0.
\]
For one-step look-ahead with \(m=1\),
\[
\psi_1(q_t)=\psi_0(x_{t+1})-(1-\gamma_1)\psi_0(x_t)\ge 0,
\]
and in the general form,
\[
\psi_0(x_{t+1})+\sum_{i=1}^{m}\alpha_i\bigl(\psi_{i-1}(x_{t+1-i})\bigr)\ge 0
\]
[2509.16037].

The significance of this construction is that the boundary of the local ball is not merely monitored geometrically; it is transformed into a discrete-time barrier condition with tunable decay rates. A plausible implication is that the method uses the learned clearance only as a local geometric primitive, while the actual safety enforcement occurs through the DHOCBF recursion.

## 4. Nonlinear optimization and relaxed feasibility

At each time \(t\), the controller solves a one-step nonlinear program over \((u_t,x_{t+1},\Omega_t)\) with objective
\[
J = p(x_{t+1}) + q(x_t,u_t,\Omega_t) - \lambda \tilde d_{t+1},
\]
subject to
\[
x_{t+1}=f(x_t,u_t),
\]
state and input bounds \(u_t\in\mathcal{U}\), \(x_{t+1}\in\mathcal{X}\), and relaxed DHOCBF constraints
\[
\psi_{i-1}(x_{t+1},\Omega_t)+\omega_{i,t}(\gamma_i-1)\psi_{i-1}(x_t,\Omega_t)\ge 0,\qquad i=1,\dots,m,
\]
where
\[
\Omega_t=[\omega_{1,t},\dots,\omega_{m,t}]^\top
\]
is a vector of nonnegative slack variables with \(0\le \omega_{i,t}<1\) [2509.16037].

The cost terms are specified as follows. \(p(x_{t+1})\) penalizes deviation of the next state from the goal. \(q(x_t,u_t,\Omega_t)\) includes tracking of a nominal control and a penalty on \(\Omega_t\). The term \(-\lambda \tilde d_{t+1}\) encourages the robot to maintain large clearance at the next step. The source text states that, by multiplying the slack in front of \((\gamma_i-1)\) rather than adding it, the safety guarantee is preserved whenever \(0\le \omega_{i,t}<1\).

This relaxation is presented as a feasibility improvement rather than a weakening of the safety theorem. The abstract states that a novel relaxation technique is applied to improve feasibility, and that the resulting framework ensures that the robot’s rigid-body motion between consecutive time steps remains collision-free, effectively bridging discrete-time control and continuous-time safety [2509.16037].

## 5. Safety guarantee and forward invariance

The formal safety statement consists of two linked results. Lemma 1, Ball Containment, states: if the one-step rigid motion of the robot moves every boundary point by at most \(d\), then all intermediate points of every boundary trajectory lie in the corresponding ball of radius \(d\). Since that ball was defined to not contain any obstacle point, the motion is collision-free in continuous time [2509.16037].

Theorem 2, Relaxed Forward-Invariance, states that under the relaxed DHOCBF constraints with \(0<\gamma_i\le 1\) and \(\omega_i\ge 0\), if \(\psi_0(x_0)\ge 0\) initially, then enforcing
\[
\psi_{i-1}(x_{t+1},\Omega_t)+\omega_{i,t}(\gamma_i-1)\psi_{i-1}(x_t,\Omega_t)\ge 0,\qquad i=1,\dots,m
\]
for all \(t\) implies
\[
\psi_0(x_{t+m})\ge 0
\]
for all \(t\). Combined with Lemma 1, this ensures that the robot remains collision-free at all times.

The theoretical role of the LSB is therefore not only descriptive but certifying. It provides the local geometric object to which forward-invariance arguments attach. This is the mechanism by which continuous-time collision freedom is recovered from discrete-time optimization.

## 6. Barrier-sublevel LSB in Lyapunov Barrier Policy Optimization

LBPO realizes a Local Safety Ball via a per-state Lyapunov constraint. Starting from a safe baseline policy \(\pi_B\) with known per-state cost \(Q\)-function \(Q^C_{\pi_B}(s,a)\), the constraint residual is defined as
\[
\Delta Q(s,\theta) \coloneqq Q^C_{\pi_B}(s,\pi_\theta(s)) - Q^C_{\pi_B}(s,\pi_B(s)),
\]
and the slack budget as
\[
\hat \epsilon(s) = (1-\gamma)\bigl(d_0-D_{\pi_B}(s_0)\bigr).
\]
The Lyapunov-barrier function is
\[
B(s,\theta):=\Delta Q(s,\theta)-\hat \epsilon(s).
\]
By construction, enforcing \(B(s,\theta)\le 0\) guarantees that the one-step increase in cost does not exceed the budget, and hence the new policy remains safe [2103.09230].

The induced safe set at level \(\eta=0\) is
\[
S_0 := \{\, s\in S : B(s,\theta)\le 0 \,\}
= \{\, s : Q^C_{\pi_B}(s,\pi_\theta(s)) - Q^C_{\pi_B}(s,\pi_B(s)) \le \hat \epsilon(s) \,\}.
\]
The source text states that one can view \(S_0\) geometrically as a local safety ball around each visited \(s\): because the policy change \(\|\pi_\theta(\cdot|s)-\pi_B(\cdot|s)\|\) is small via a KL-trust-region, the resulting change in cost-\(Q\) is bounded by \(\hat \epsilon(s)\). Thus the new state \(s'\) reached under \(\pi_\theta\) will lie “within” a model-based cost-contour around \(s\), with the metric induced by the cost-\(Q\) rather than Euclidean distance.

LBPO replaces the hard constraint \(B(s,\theta)\le 0\) by a differentiable log-barrier penalty. For each constraint \(i=1,\dots,m\),
\[
\psi_i(s,\theta)
=
-\beta \log\!\left[\hat \epsilon_i(s) - \bigl(Q^{C_i}_{\pi_B}(s,\pi_\theta(s)) - Q^{C_i}_{\pi_B}(s,\pi_B(s))\bigr)\right]
=
-\beta \log[-B_i(s,\theta)].
\]
The policy update is a trust-region-constrained minimization of reward-loss plus the sum of barriers:
\[
\theta_{k+1}
=
\arg\min_\theta
\mathbb{E}_{s\sim \rho^{\pi_B}}
\left[
- Q^R_{\pi_B}(s,\pi_\theta(s))
+ \sum_{i=1}^{m}\psi_i(s,\theta)
\right]
\]
subject to
\[
\mathbb{E}_{s\sim \rho^{\pi_B}}
\left[
KL(\pi_\theta(\cdot|s)\|\pi_B(\cdot|s))
\right]
\le \mu.
\]

The same source identifies two parameters controlling conservativeness. First, the slack \(\hat \epsilon(s)\) sets the maximum allowable one-step cost-\(Q\) increase, and larger \(\hat \epsilon(s)\) implies a larger local “ball.” Second, the barrier weight \(\beta\) controls how steeply the objective blows up as \(B(s,\theta)\to 0^{-}\): as \(\beta\to\infty\), the barrier becomes nearly-infinite just inside the boundary and updates stay well inside the LSB; as \(\beta\to 0\), one recovers an almost-unconstrained update with only a mild penalty near the boundary. A first-order Taylor approximation around \(\pi_B\) yields an approximate radius:
\[
\Delta Q(s,\theta)\approx \nabla_a Q^C_{\pi_B}(s,a)\rvert_{a=\pi_B(s)}\cdot (\pi_\theta(s)-\pi_B(s)),
\]
so that enforcing \(\Delta Q(s,\theta)\le \hat \epsilon(s)\) is equivalent to
\[
\|\pi_\theta(s)-\pi_B(s)\| \le \frac{\hat \epsilon(s)}{\|\nabla_a Q^C\|}.
\]
The key theoretical guarantee stated in the source is that at each iteration \(\pi_B\) remains in the sublevel set \(\{B(s,\cdot)\le 0\}\) for all visited \(s\), hence \(D_{\pi_B}(s_0)\le d_0\) at every step [2103.09230].

## 7. Implementation profile and computational characteristics

The obstacle-avoidance realization of LSB uses a residual MLP as the clearance predictor \(f_\phi(q)\). The architecture is specified as input-processing layers \(3\to h/4 \to h/2 \to h\) with \(h=2048\), followed by \(L_b=6\) residual blocks of width \(h\) with identity skips plus non-adjacent skips every two blocks,
\[
z_{i+2}\leftarrow z_{i+2}+A_i z_i,
\]
and head layers \(h\to h/2 \to h/4 \to 1\), with BatchNorm+GELU nonlinearities [2509.16037].

Dataset generation is also given explicitly. The procedure samples \(9{,}345\) \((x,y)\) grid points and, at each, discretizes \(\theta\) over \(360^\circ\), yielding \(3.4\)M training samples. Ground-truth clearance is obtained by exhaustive boundary-sample search, and an additional \(0.7\)M samples are held out for testing. Training uses log-normalization of targets,
\[
\bar d = (\log(d+\epsilon)-\mu_{\log})/\sigma_{\log},
\]
with MSE in normalized space, AdamW with \(lr\in[10^{-4},10^{-3}]\), cyclic scheduling, gradient clipping, and early stopping.

The reported evaluation metrics and runtimes are: test MSE in original units below \(0.01\) for most \((x,y,\theta)\); MLP inference is sub-millisecond on CPU; and one-step NLP solve times are \(13\)–\(16\) ms on a Ryzen 7 5800U with IPOPT through CasADi. The source summarizes the resulting framework as one that “(i) learns a fast, accurate clearance predictor, (ii) converts it into a shape-aware Local Safety Ball via the EPA, (iii) enforces continuous-time collision-free motion by embedding a relaxed DHOCBF in a nonlinear program, and (iv) runs in real time with millisecond-level latency” [2509.16037].

Taken together, these implementation details place LSB at the intersection of learned geometric perception, barrier-certified control, and real-time nonlinear optimization. In the LBPO variant, the corresponding computational burden is shifted from reachability-style set construction to online evaluation of \(Q\)-functions and log-barrier gradients inside a trust-region policy update, rather than to offline reachability or Lyapunov-level-set computation [2103.09230].

Source: https://www.emergentmind.com/topics/local-safety-ball-lsb