CPSC 8050 Advanced Computer Graphics - Google Search
Transcript of CPSC 8050 Advanced Computer Graphics - Google Search
Today
• Local Collision Avoidance (Part III)
• Continue from where we left off
• Resources (papers, code, etc) will be online
• Assign first homework (maybe?)
Velocity-Based Approaches
• Can be more intuitive than force-based approaches
• Formulate collision avoidance as an optimization problem
• Sampling-based
• Linear programming
A Sampling-Based Approach
• Consider an agent A having a goal velocity vg that has to navigate amidst other agents without collisions
• At each time step, let AV denote the set of admissible velocities for the agent. For example, if the agent is subject to a maximum speedυmax and a maximum acceleration αmax
• We can uniformly sample Ν candidate velocities from AV and select an optimal one according to a specific cost function
A Sampling-Based Approach
• Typically, we would like to choose a new velocity vn that minimizes the deviation from the goal velocity and the risk of collision with any of the other agents
• Here, tc denotes the minimum time that will take for the agent to collide with any of the other agents assuming that it selects a velocity vi
cand (perform time-to-collision computations for each neighbor). The constant γ controls the relative importance of the two cost terms
A Sampling-Based Approach
• Runtime complexity assuming n agents
• Naïve implementation scheme: Each agents checks interactions with the remaining n-1 agents O(n2)
• Using a sensing radius: Assuming that agents do not collide, there is an upper bound (k) on the # neighbors that each agent interacts with O(kn)
• Assuming k is constant, the runtime per time step is (asymptotically) equivalent to O(n)
A Sampling-Based Approach
• Performance is significantly affected by the computation of nearest neighbors
• Iterating over all other agents results in quadratic runtime
• Linear-time implementation for proximity queries can be employed based on spatial hashing schemes or grid maps. See, e.g., the work in http://www.red3d.com/cwr/papers/2000/pip.pdf
A Sampling-Based Approach
• Disadvantages
• Can be slow depending on the number Ν of candidate velocities that we evaluate
• Cannot guarantee collision-free motion due to sampling
Velocity Obstacles
• Introduced by [Fiorini and Shiller ‘98]
• Definition
Given two agents, A and B, the velocity obstacle VOA|B
(read: the velocity obstacle of A induced by B) is the set of all relative velocities that will lead to a collision between the two agents at some moment in time τ>=0
Velocity Obstacles• Geometric Definition
A cone with its apex at the origin and its legs tangent to the disc of radius rA + rB centered at xB - xA
xB-xA
Velocity Obstacles
• Revising the VO Definition
Given two agents, A and B, the velocity obstacle VOA|B is the set of all relative velocities that will lead to a collision between the two agents at some moment in time τ>=0. Assuming A and B are approximated as discs of radius rA
and rB, respectively, VOA|B
where D(x,r) denote a disc centered at x having radius r
Velocity Obstacles
• This is basically a ray-disc intersection problem
• which is ….
𝜏𝒗 − (𝒙𝐵 − 𝒙𝐴) < 𝑟
Last lecture: Time-to-Collision (τ)
• Formally, a collision exists if
𝒙 + 𝒗𝜏 = 𝑟
• Squaring and expanding, leads to the following quadratic equation for τ
𝒗 ⋅ 𝒗 𝜏2 + 2 𝒙 ⋅ 𝒗 𝜏 + 𝒙 ⋅ 𝒙 − 𝑟2 = 0
Time Horizon & Velocity Obstacles
Given two agents, A and B, the velocity obstacle VOA|B
(read: the velocity obstacle of A induced by B for time horizon τΗ) is the set of all relative velocities that will lead to a collision between the two agents at some moment within the next τΗ sec. Assuming A and B are approximated as discs of radius rA and rB, respectively
τΗ
τΗ
τΗ
Time Horizon & Velocity Obstacles• Geometric interpretation
A truncated cone with its apex at the origin and its legs tangent to the disc of radius rA + rB centered at xB – xA. The cone is truncated by an arc of a disc of radius (rA + rB)/τH centered at (xB – xA)/τH.
xB-xA
Collision-Free Velocities
• Let CFVA|B denote the set of collision-free velocities for agent A induced by agent B.
xB
xA
rB
rA
Collision-Free Velocities
xB
xA
rB
rA
• Let CFVA|B denote the set of collision-free velocities for agent A induced by agent B
• What is CFVA|B if B stands still?
Collision-Free Velocities
The set of collision-free velocities CFVA|B for agent A given an agent B is the set of all velocities that lie outside the VOA|B translated by B’s velocity vB. Formally
Where denotes the Minkowski sum. Given two sets X and Y:
Collision-Free Velocities
• Agent A may also need to account for its set of admissible velocities AV if it is subject to kinodynamics constraints. Then
Selecting a Collision-Free Velocity
• Recall: For a given agent A, we need to compute a collision-free velocity that is as close as possible to its goal velocity
• Formulate this as an optimization problem
Sampling-Based Approach
• Sample admissible velocities and solve
• Already discussed issues that arise with this approach
Optimal Reciprocal Collision Avoidance
• Popular framework to reason about velocity-based collision avoidance
• Proposed by [van den Berg et al., 2011]
• Builds on the concept of Velocity Obstacles
• Widely known as ORCA
ORCA
• Anytime the relative velocity between agent A and agent B falls into VOA|B, we know that A heads into a collision with B.
ORCA
• Anytime the relative velocity between agent A and agent B falls into VOA|B, we know that A heads into a collision with B.
vA - vB
ORCA
• Let u denote the smallest change in relative velocity required to resolve the collision
• We can easily find u by simply projecting the relative velocity to the closest point on the boundary of the VO
vA - vBvA - vB
ORCA
• If A were to take vA + u for the next time step and nothing else changes, the collision will be resolved. But, by symmetry, B faces the exact same condition and will try to take vB - u• Waste a lot of “effort”
• Oscillations
vA - vBvA - vB
Reciprocity in ORCA
• Agents will split the effort to avert the collision. So, agent A can move by at least ½ ||u|| in the direction of u, that is velocities that get at least halfway out of VOA|B
vA - vB
ORCA Constraint
• The set ORCAA|B of permitted velocities for A for optimal reciprocal collision avoidance with B is given by
vA - vB
ORCA Constraint
• The set ORCAA|B of permitted velocities for A for optimal reciprocal collision avoidance with B is given by
vA - vB
vA - vB
ORCA Constraint
• The set ORCAA|B of permitted velocities for A for optimal reciprocal collision avoidance with B is given by
vA - vB
vA - vBvA - vB
ORCA Constraint
• The set ORCAA|B of permitted velocities for A for optimal reciprocal collision avoidance with B is given by
vA - vB
vA - vBvA - vB
ORCA Constraint
• The set ORCAA|B of permitted velocities for A for optimal reciprocal collision avoidance with B is given by
vA - vB
vA - vBvA - vB