Density Function Construction
A concise summary of the analytical construction used in the examples.
Run
Generate a minimal density-feedback rollout using the same density construction.
python examples/single_integrator/static_single_obstacle/density_feedback.py
Interactive Density Function
Tune the obstacle geometry and target exponent, then rotate the 3D surface to see how the density vanishes around unsafe states and concentrates near the target.
System and Sets
Consider the control-affine system \(\dot{x}=f(x)+g(x)u\). Let \(\mathcal{X}\) be the state space, \(\mathcal{X}_u\) the unsafe set, and \(\mathcal{X}_T\) the target set. The goal is to construct a density function \(\rho:\mathcal{X}\setminus\mathcal{X}_u\to\mathbb{R}_{>0}\) that guides almost all initial conditions to \(\mathcal{X}_T\) while avoiding \(\mathcal{X}_u\).
Obstacle and Sensing Regions
Represent obstacle \(i\) by a smooth function \(h_i:\mathcal{X}\to\mathbb{R}\), with the unsafe set described by a sublevel set. A larger set \(\mathcal{X}_{s,i}\) defines the region where the density transitions around the obstacle.
For a circular obstacle, \(h_i(x)=\|x-c_i\|^2-r_{u,i}^2\) defines the unsafe set and \(s_i(x)=\|x-c_i\|^2-r_{s,i}^2\) defines the larger sensing boundary, with \(r_{s,i}>r_{u,i}\).
Encoding the Obstacles
The inverse bump gives a smooth transition from zero to one. The obstacle factor \(\phi_i\) is zero on the unsafe set and smoothly transitions to one outside the sensing region.
Encodring the Target
Choose a positive target function \(V_T(x)\) that vanishes on the target set and is positive away from it. The density combines the obstacle product with the target factor.
Overall Density function
Density-Based Safety Condition
The density is used to synthesize safe feedback or to constrain a filter/MPC. For the continuous-time control-affine system, the density-based safety condition is written as