Every agent (the robot and each pedestrian) picks a preferred velocity toward its own goal. To avoid collisions, each pair of nearby agents A, B computes a truncated velocity obstacle: the set of relative velocities that would bring their circular bodies (radius rA+rB) within a time horizon τ.
relPos = posB − posA
relVel = velA − velB
w = relVel − relPos/τ
if |w| escapes the truncation cone:
u = (minimal vector to leave the cone) − relVel
else:
u = projection onto the nearest cone leg
This is the ORCA (Optimal Reciprocal Collision Avoidance) construction, following van den Berg et al. 2011. Each agent then takes only a share of the fix, u·share, added to its own velocity — the other agent implicitly takes the rest, so both sides change course a little instead of one dodging entirely. The half-plane {v : (v − (vel+u·share))·n ≥ 0} becomes a linear constraint; a few passes of projecting the preferred velocity onto every active constraint (Gauss–Seidel relaxation) converge to a collision-free velocity, which is then clamped to the agent's max speed.
- Sensing radius — only neighbors inside this distance generate a constraint (a real robot's LIDAR/camera range).
- Robot yield share — the fraction of the avoidance vector u the robot itself absorbs against a pedestrian; 0 = pedestrians always give way, 1 = the robot always yields, 0.5 = textbook reciprocal ORCA.
- Time horizon τ — how far ahead the robot "looks" for a future collision; a small τ reacts late and abruptly, a large τ reacts to distant, still-uncertain futures and produces gentler, earlier course changes.
- Pedestrian–pedestrian pairs always split 50/50, which is what keeps the crowd itself collision-free.
This 2D top-down view renders the same planar agent positions the 3D version moves in space — the underlying ORCA solve is identical, only the camera changes. Real-world relevance: this exact velocity-obstacle math (RVO/ORCA) is what lets event-security and logistics robots move through dense, unpredictable crowds at concerts, stadiums and exhibitions without freezing up or shoving people — the same technique underlies multi-drone swarms and warehouse AMR fleets.