Safe Control Density

Multi-Agent Navigation

Multi-agent unicycle navigation with density feedback and density filters. The examples compare position-only bump density, collision-cone density, and velocity-obstacle density.

Run

Run a minimal multi-agent crossing scenario with the three density constructions.

python examples/multi_agent/density_feedback/reactive.py --scenario crossing6
python examples/multi_agent/density_feedback/collision_cone.py --scenario crossing6
python examples/multi_agent/density_feedback/velocity_obstacle.py --scenario crossing6

System Dynamics

Each agent is a unicycle with state \(x_i=[p_{x,i},p_{y,i},\theta_i]\) and controls \(u_i=[v_i,\omega_i]\). The density construction is pairwise: every other agent contributes a smooth obstacle term.

$$ \dot p_{x,i}=v_i\cos\theta_i,\qquad \dot p_{y,i}=v_i\sin\theta_i,\qquad \dot\theta_i=\omega_i $$ $$ \rho_i(x_i)= \frac{\prod_{j\ne i}\Phi_{ij}(p_i,p_j,v_i,v_j)} {\left(\|p_i-p_i^\star\|^2+w_\theta\,\mathrm{wrap}(\theta_i-\theta_i^\star)^2\right)^\alpha} $$

Density Constructions

The baseline only sees distance. Collision-cone and velocity-obstacle density also use relative velocity, so agents react differently when another agent is crossing, approaching, or moving away.

Reactive bump

A neighbor is a circular bump obstacle. This is simple and fast, but it cannot tell whether the neighbor is actually moving toward a future collision.

$$\Phi_{ij}=\beta(\|p_i-p_j\|;r_{\mathrm{safe}},r_{\mathrm{sense}})$$

Collision cone

agent i agent j collision cone

The cone is built from relative position and relative velocity. If the relative velocity points into the cone, the density term activates before the disks touch. We keep the usual spatial bump and multiply it by a second smooth bump on the collision-cone margin.

$$ \Phi_{ij}^{\mathrm{cc}} =\beta_{\mathrm{space}}(\|p_i-p_j\|) \,\beta_{\mathrm{vel}}(h_{\mathrm{cc}}) $$ $$ h_{\mathrm{cc}}=p^\top v+\|p\|\|v\|\cos\phi $$

Velocity obstacle

candidate velocity unsafe VO v_x v_y

Velocity obstacles work directly in velocity space. Candidate velocities inside the cone would produce a future collision, so the density pushes the command toward a cone boundary. As with collision cones, the final obstacle term is a spatial bump times a smooth bump on the velocity-obstacle margin.

$$ \Phi_{ij}^{\mathrm{vo}} =\beta_{\mathrm{space}}(\|p_i-p_j\|) \,\beta_{\mathrm{vel}}(h_{\mathrm{vo}}) $$ $$ h_{\mathrm{vo}}=\max(\mathrm{cross}(\ell,v_{\mathrm{rel}}),\mathrm{cross}(v_{\mathrm{rel}},r)) $$

Interactive Result Viewer

Select a controller, density construction, and scenario. The feedback controller is fast and smooth because it maps a planar density command to unicycle inputs. The filter solves a one-step constrained unicycle problem at every timestep.

Crossing 2 Comparison Dashboards

The dashboards replay methods one after another. Completed tracks stay visible, while the active method shows moving triangles. The live plots show each agent's forward speed, yaw rate, and minimum pairwise clearance over time.

Density feedback methods

Density filter methods

Velocity obstacle: feedback vs filter

Collision cone: feedback vs filter

Controller Setups

The same density constructions can be used in two different control loops. Feedback is fast and direct; the filter is more faithful to the unicycle dynamics because it solves over the actual controls.

Scenario Comparisons

Each section fixes the scenario. Within each density construction, the feedback result and filter result are shown side by side.