Collision Detection for Agents in Multi-Agent Pathfinding

Recent work on the multi-agent pathfinding problem (MAPF) has begun to study agents with motion that is more complex, for example, with non-unit action durations and kinematic constraints. An important aspect of MAPF is collision detection. Many coll…

Authors: Thayne T. Walker, Nathan R. Sturtevant

Collision Detection for Agents in Multi-Agent Pathfinding
Collision Detection f or Agents in Multi-Agent Pathfinding Thayne T . W alker 1 , Nathan R. Sturtev ant 2 1 Univ ersity of Den ver , Denv er , USA 2 Univ ersity of Alberta, Edmonton, Canada Abstract Recent work on the multi-agent pathfinding problem (MAPF) has begun to study agents with motion that is more complex, for example, with non-unit action du- rations and kinematic constraints. An important aspect of MAPF is collision detection. Many collision detec- tion approaches exist, but often suf fer from issues such as high computational cost or causing false negati ve or false positiv e detections. In practice, these issues can re- sult in problems that range from inef ficiency and anno y- ance to catastrophic. The main contrib ution of this tech- nical report is to provide a high-level overvie w of ma- jor cate gories of collision detection, along with methods of collision detection and anticipatory collision av oid- ance for agents that are both computationally ef ficient and highly accurate. 1 Introduction Multi-agent pathfinding (MAPF) is the problem of find- ing paths for a set of agents from respectiv e start loca- tions to goal locations in a shared space while a voiding conflicts. MAPF has applications in robotics, naviga- tion, games, etc. The problem of detecting collisions between agents (robots, objects, players, etc.) is of central importance for MAPF . There is a fundamental trade-off between accuracy and computation time; more accurate collision detection is often preferred in systems with strict safety requirements (e.g. human transport) while others may trade accuracy for speed when safety is not an issue (e.g. games). This technical report first provides definitions and background for collision detection, a broad overvie w and categorization of existing methods and summarizes the advantages and disadvantages of each. Then ef fi- cient and exact equations for collision detection for cir - cular and spherical agents with constant velocity and initial velocity with constant acceleration are formally defined. Finally , conic equations for anticipatory col- lision av oidance for circular and spherical agents are introduced. Many examples are used to illustrate the problem for 2-dimensional spaces, ho wev er , the case of 3-dimensional spaces is directly applicable. 2 Background Conflict detection is important for many problems with multiple moving agents. For the purposes of this tech- nical report, agents hav e spatial locations and a physi- cal shapes such as circles, spheres, polygons or polygo- nal meshes. Agents may only occupy one location at a time, situated using a r efer ence point (Li et al. 2019). In the case of navigation and routing problems for multiple agents, feasible joint solutions cannot be found or veri- fied without proper conflict detection. A conflict repre- sents a simultaneous attempt to access a joint resource. Depending on the target domain a conflict may have dif- ferent meanings, for example when states hav e dimen- sions other than spatial components such as scheduling problems or resource allocation problems (e.g. allo- cating time slots for classrooms or coordinating mem- ory and cpu allocation for processing jobs) or when ab- stract states are used such as in dimensionally-reduced spaces. T ypically , when considering only temporospa- tial aspects, conflict detection is referred to as collision detection . Collision detection has been extensi vely studied in the fields of computational geometry , robotics, and computer graphics. When selecting a method for check- ing conflicts we need to be cognizant of type I and type II errors (Ne yman and Pearson 1933), that is, false pos- itiv es (reporting a conflict that does not actually occur) and false negati ves (not reporting a conflict that actu- ally does occur). A method that exhibits type II errors should nev er be used because type II errors can lead to infeasible solutions. A method that exhibits type I errors may be used, but may be incomplete or lead to sub-optimal solutions. In this section we provide a brief taxonomy of collision detection techniques for multiple moving agents. This tech report focuses on solutions for se gmented motion . Segmented motion is defined as a series of mov ements (or actions) for agents that hav e a discrete length. Segmented motion is the natural product of path planning for agents in discretized spaces such as grids, graphs and robotic latices. A segment of mo- tion is defined by a pair of states: h s start , s end i where s start is the state of the agent at the beginning of mo- tion and s end is the state of the agent at the end of mo- (a) (b) (c) Figure 1: Collision detection using geometric contain- ers. A collision is correctly detected between agents (a) and (b), but erroneously detected between (a) and (c). tion. For example, a state may be defined as a position and time s = h x, y, t i or it may also include veloc- ity (and acceleration) components: s = h x, y , ˙ x, ˙ y , t i ; s = h x, y, ˙ x, ˙ y , ¨ x, ¨ y , t i . The definition of states, in- cluding the number of dimensions will depend upon the application. A motion segment is continuous between s start and s end , thus the transition between them must be kinematically feasible. Finally , a path is composed of a sequence of states π = [ s 0 , ..., s d ] , or alternately , a sequence of motions π = [ m 0 , ..., m d ] where each s end ∈ m i = s start ∈ m i +1 . 2.1 Geometric Containers Geometric containers encapsulate portions of seg- mented motion in time and space using polygons, poly- topes or spheres (W agner, Willhalm, and Zaroliagis 2005). Then intersection detection is detected between the geometric containers of differing agents to deter- mine if a collision has occurred. There are various approaches to intersection detection for stationary ob- jects (Jim ´ enez, Thomas, and T orras 2001; Kockara et al. 2007). In Figure 1 an example of this approach is shown which uses axis-aligned bounding boxes as geometric containers. The temporal dimensions are not shown, but each bounding box also has a temporal compo- nent. Agent (a), (b) and (c) take actions (represented as directed edges) to arrive at their goal. Axis-aligned bounding boxes are reserved for each of these edges, then an intersection check is carried out. Although a collision is correctly detected between (a) and (b), an erroneous collision is detected between (b) and (c). Al- though this approach is computationally fast, it will re- serve more temporospatial area than necessary , espe- cially when long edges are present in a path, resulting in the possibility of type I errors. 2.2 Incremental/Sampling-Based This approach in v olves translating objects along their trajectories incrementally and using static collision de- tection methods to detect overlaps at each increment. Figure 2 shows an example of this approach. Agents are translated to regular interv als along their trajecto- ? (a) (b) (c) Figure 2: Sampling-based collision detection. A colli- sion is not detected between agents (a) and (b). −0.2 0.2 0.6 1.0 −0.2 0.0 0.2 0.4 0.6 0.8 1.0 (a) X Y P1 P2 vx 1 vy 1 vx 2 vy 2 −0.2 0.2 0.6 1.0 −0.2 0.0 0.2 0.4 0.6 0.8 1.0 (b) X Y P1 P2 vx 1 vy 1 vx 2 vy 2 ax 1 ay 1 ax 2 ay 2 Figure 3: Algebraic collision detection for trajectories with (a) constant v elocity and (b) initial velocity with constant acceleration ries, then intersection checks are performed at each in- terval. In contrast to the example in Figure 1, there is no erroneous collision detected (type I error) between agent (a) and agent (c). Howe ver , a false negati v e (type II error) occurs between agent (a) and (b). The sampling approach is very important, samples too far apart may leav e a collision undetected, but samples very close to- gether are computationally costly . Adaptiv e sampling approaches can help improv e the accuracy and compu- tational cost (Gilbert and Hong 1989). In grid worlds, Brezenham’ s line algorithm (Bresen- ham 1987), a coarse form of collision detection can be used for selecting a specific set of grid-squares cov- ered by a trajectory and then checking whether multiple agents are in the same grid square at intersecting times. A tighter approach based on W u’ s antialiased line algo- rithm (W u 1991) is used in the AA-SIPP(m) (Y akovle v and Andreychuk 2017) algorithm. These methods may cause type I errors, but are guaranteed to avoid type II errors. 2.3 Algebraic By parameterizing the trajectory , closed-form solutions to continuous-time conflict detection for circular , spher - ical, (Ericson 2004; Ho et al. 2019) and triangular (Moore and W ilhelms 1988) shaped agents have been formulated. An example for circular agents is shown in Figure 3. In diagram (a), Agents move along their re- spectiv e trajectories shown as a solid arrow . These tra- Figure 4: Constructiv e solid geometry collision detec- tion. Time is extruded into the model as an extra di- mension, after which polygonal intersection detection is performed. (a) − − → V A − − → V B A B (b) A + − − → V A A + − − → V B A V O B r A + r B Figure 5: V elocity Obstacle (V O) construction based on (a) two agents with motion vectors. The trajectories and shapes of agents are interpreted to create (b) the velocity obstacle – labeled ’V O‘ jectories are parameterized by the x, y velocity v ectors as shown with dashed arro ws. Diagram (b) shows a sim- ilar scenario with acceleration vectors added to the tips of the velocity arro ws shown with dotted arro ws. Alge- braic methods will calculate the exact time of collision between tw o moving agents assuming constant velocity and direction and also with acceleration. When dealing with discrete-length motion segments, algebraic methods can be used to determine whether a collision will occur during the segment of motion. Deeper details of these calculations for circular agents are discussed in section 3. 2.4 Geometric Geometric solutions are the most computationally ex- pensiv e collision detection approaches, howe ver they are formulated for many different obstacle shapes - typ- ically primitiv e shapes, polygons or meshes. T wo of the most popular approaches are constructi ve solid geome- try (CSG) (Requicha and V oelcker 1977), and velocity obstacles (V O) (Fiorini and Shiller 1998). CSG approaches treat the time domain as an addi- tional polygonal dimension, extruding polygons into the time dimension, after which a static polygonal intersec- tion check is applied. Computation of the extruded vol- umes can be very expensi ve and formulating ways to enhance CSG has been a subject of ongoing research (Dyllong and Grimm ; Kiel, Luther , and Dyllong 2013). V elocity obstacles have been formulated for infinite length vector collision detection for arbitrary-shaped agents (Fiorini and Shiller 1998). A velocity obstacle is depicted in Figure 2.4. A V O is created for two agents A and B , located with center points A and B as sho wn in diagram (a). The agents hav e shapes – here shown as circles with radius r A and r B . The agents’ motion follows v elocity vectors V A and V B shown as arro ws. In order to construct the VO, first, the shape of agent B is inflated by computing the Minko wski sum A ⊕ B of the two agent’ s shapes. Next, two tangent lines from point A to the sides of A ⊕ B are calculated to form a polygon. Finally , the polygon is translated so that its apex is at A + V B . The area between the translated tangent lines is the velocity obstacle (labeled VO in the diagram). The VO represents the unsafe region of ve- locity for agent A , assuming agent B does not change it’ s trajectory . If the point A + V A lies inside the VO, agent A will collide with agent B some time in the infi- nite future. In the case of segmented motion, V Os can still be used for collision detection with some adaptations (An- dreychuk et al. 2019). In addition, collision av oidance can be achiev ed by choosing a velocity for A such that A + V A lies outside the V O. One approach is to set V A so that A + V A lies on the intersection point of either of the V O tangent lines ±  . 2.5 Summary Depending on the application, any of the abo ve meth- ods may meet the problem constraints. Static detection is the approach of choice for domains with discretized- time mov ement models as it is the cheapest and (de- pending on the mov ement model) may yield no loss in accuracy . In continuous-time domains, one of the latter choices is usually preferable, with sampling of- ten being the cheapest approach, followed by algebraic and geometric approaches. There is a trade-off with re- spect to accuracy and computational cost. The latter approaches provide the most flexibility when high ac- curacy and comple x agent shapes are necessary . 3 Closed-F orm Collision Detection for Circular Agents Figure 3 shows an example of two-agent motion for fixed v elocity (a) and initial velocity with fixed acceler - ation (b). Computing the time and duration of conflict for two circular agents can be done by solving equa- tions for the squared distance between agents (Ericson (2004)). 3.1 Constant V elocity Giv en P 1 = h x 1 , y 1 i , the start position of agent 1 , and P 2 = h x 2 , y 2 i , the start position of agent 2 , velocity vectors V 1 = h v x 1 , vy 1 i , V 2 = h v x 2 , vy 2 i , and radii r 1 , r 2 respectiv ely , the location in time of an agent is defined as: P 0 = P + V t (1) The following equation specifies the squared distance between the centers of the agents ov er time: sq dist ( t ) = V ∆ 2 t 2 + 2 V ∆ · P ∆ t + P ∆ 2 (2) where P ∆ = P 1 − P 2 V ∆ = V 1 − V 2 V ia substitution, this equation is simplified to a quadratic equation: sq dist ( t ) = at 2 + bt + c 0 (3) where a = V ∆ 2 b = 2 V ∆ · P ∆ c 0 = P ∆ 2 A collision will occur when the squared distance be- tween the agents is less than or equal to the squared sum of the radii, giving the follo wing inequality . at 2 + bt + c 0 ≤ ( r 1 + r 2 ) 2 Solving the inequality gives the equation for collision between the agent’ s edges: 0 ≥ at 2 + bt + c 0 − ( r 1 + r 2 ) 2 sq E dg eD ist ( t ) = at 2 + bt + c (4) where c = P 2 ∆ − ( r 1 + r 2 ) 2 Solving equation 4 for t will determine the exact times where the squared distance between agent’ s edges is zero – the time when collision occurs. Section 4 dis- cusses the process for determining the conflict interval for using this equation. 3.2 Initial V elocity with Constant Acceleration Equation (4) can be extended for constant acceleration. Giv en P 1 = h x 1 , y 1 i , the start position of agent 1 , and P 2 = h x 2 , y 2 i , the start position of agent 2 , velocity vectors V 1 = h v x 1 , vy 1 i , V 2 = h v x 2 , vy 2 i , acceleration vectors A 1 = h ax 1 , ay 1 i , A 2 = h ax 2 , ay 2 i and radii r 1 , r 2 respectiv ely , the location in time of an agent is defined as: P 0 = P + V t + At 2 2 (5) The following inequality specifies the collision con- dition as a quartic equation: at 4 + bt 3 + ct 2 + dt + e 0 ≤ ( r 1 + r 2 ) 2 (6) where a = A ∆ 2 4 b = A ∆ · V ∆ c = A ∆ · P ∆ + V ∆ 2 d = 2 V ∆ · P ∆ e 0 = P ∆ 2 for P ∆ = P 1 − P 2 V ∆ = V 1 − V 2 A ∆ = A 1 − A 2 which gi ves the equation for the squared distance be- tween circular edges: sq E dg eD ist ( t ) = at 4 + bt 3 + ct 2 + dt + e (7) where e = P ∆ 2 − ( r 1 + r 2 ) 2 Again, solving for t will yield the time of collision, which is discussed further in the next section. 4 Computing the Exact Conflict Interval The exact conflict interv al is determined by solving for the roots of (4) or (7) using the quadratic and quartic formulas respectively . These solutions assume that both agents are at P 1 and P 2 at the same time. Howe v er , if there is an offset in time, e.g. agent 1 starts moving at time t 1 and agent 2 starts moving at time t 2 , then P ∆ must be adjusted to reflect this offset by projecting the position of the earlier agent to be at the position when the later agent starts its motion. If the earlier agent were agent 1, the adjustment would be as follo ws: P ∆ = P 1 + V 1 ( t 2 − t 1 ) − P 2 (8) Otherwise, the adjustment will be analogously done for agent 2. In the case of acceleration, the position and velocity must be adjusted (again, assuming agent 1 starts early) as: P ∆ = P 1 + V 1 ( t 2 − t 1 ) + A 1 ( t 2 − t 1 ) 2 2 − P 2 (9) V ∆ = V 1 + A 1 ( t 2 − t 1 ) − V 2 (10) 0.0 0.5 1.0 0.0 0.5 1.0 X Y 0.2 0.4 0.6 0.8 1.0 1.2 −0.2 0.0 0.2 0.4 0.6 0.8 1.0 Time Dist Sq. Figure 6: Agents Trajectories and Corresponding Squared Distance Plot 4.1 Constant V elocity For the quadratic form, if the discriminant ( b 2 − 4 ac ) is less than zero, V 1 and V 2 are parallel and no colli- sion will ever occur . Assuming the discriminant is pos- itiv e, the collision interval is defined as the roots of the quadratic formula: t interv al = − b ± √ b 2 − 4 ac 2 a (11) In the case of a double root, the edges of the agents just touch, but no overlap actually occurs (assuming open interv als). See Figure 6 for an example of two- agent motion and the resulting squared-distance plot. When the distance is less than zero, there is overlap of the agents. Giv en this interval, it is possible to deter - mine whether a collision will occur in the future and at what time, or if the agents are currently colliding. 4.2 Initial V elocity with Constant Acceleration This case uses the quartic formula to find roots to (7). The quartic formula will yield 4 roots, some of which may be imaginary resulting in 0, 1 or 2 conflict inter- vals. Imaginary roots will tell us the time(s) at which agents are locally closest together , but do not actually ov erlap (local minima). Imaginary roots are always double roots, and can be discarded. If all 4 roots are imaginary , the agents ne ver overlap. If there is a double real root, then the two agents touch edges at exactly one point in time, creating an instantaneous interval. Because our equation is based on distance, the quar- tic function will always be conca ve up. Hence, the o ver - lapping interv als can only be between roots 1,2 and 3,4. If roots 1,2 and/or 3,4 are real, then the agents continu- ously ov erlap between 1,2 and/or 3,4 respecti vely . Four real roots means that the objects ov erlap twice, contin- uously between root pairs 1,2 and 3,4. This is possible because agents may hav e curved trajectories. See Fig- ure 3 (b) for an example. 5 Determining Exact Minimum Delay or V elocity Adjustment f or Conflict A voidance It is often useful, not just to determine if and when agents are going to collide, but to determine a delay time to av oid collision. 5.1 Exact Delay f or Constant V elocity In order to determine the minimum delay required for an agent to av oid conflict, we adjust (3) to incorporate δ = t 2 − t 1 , a delay variable, by plugging equation (8) into equation (2) to get: sq E dg eD ist ( t, δ ) = At 2 + B tδ + C δ 2 + Dt + E δ + F (12) where A = V ∆ 2 B = 2( V 2 1 − V 1 · V 2 ) C = V 1 2 D = 2( P 2 · V 2 − P 2 · V 1 + P 1 · V 2 − P 1 · V 1 ) E = − 2( P 2 · V 1 + P 1 · V 1 ) F = V ∆ 2 − ( r 1 + r 2 ) 2 Equation (12) is the standard form of a conic section. Note that the sign of both A and C are positi ve, there- fore, this conic section will always be an ellipse, except for two degenerate cases: (1) agents’ motion is paral- lel and (2) at least one agent is waiting in place. For - tunately , both cases are easy to detect and solve. The con version of (8) to canonical form for an ellipse will not be cov ered here, nor is it necessary . Figure 7(a) shows an example of agent trajectories, the squared distance plot (equation (4)) when del ay = 0 , and the resulting conic section (equation (12)). Note that the horizontal line at δ = 0 passes through the ellipse at the exact same time points that the squared distance plot does. If agent 1 were to delay by  , the horizontal line would move up, resulting in a different collision interval (see Figure 7(b)). If agent 2 were to delay by  , the horizontal line would mo ve do wn, again resulting in a different collision interval. The question we want to solve is: what value of delay will result in no collision? In other words, we want to find the pos- itiv e value of δ , such that the radii of the agents just touch, i.e. (12) yields a double root. The targeted delay interval is deriv ed by determining the top and bottom extrema of the ellipse (Hendricks 2012). delay Rang e = center δ ± √ (2 B D − 4 AE ) 2 +4(4 AC − B 2 )( D 2 − 4 AF ) 2(4 AC − B 2 ) (13) where center δ is the y-coordinate of the ellipse cen- ter: center δ = B D − 2 AE 4 AC − B 2 0.0 0.5 1.0 0.0 0.5 1.0 X Y 0.2 0.4 0.6 0.8 1.0 1.2 −0.2 0.2 0.4 0.6 0.8 1.0 Time Dist Sq. 0.0 0.5 1.0 1.5 −0.5 0.0 0.5 Time Delay (a) 0.0 0.5 1.0 0.0 0.5 1.0 X Y 0.2 0.4 0.6 0.8 1.0 1.2 1.4 −0.2 0.2 0.4 0.6 0.8 1.0 Time Dist Sq. 0.0 0.5 1.0 1.5 −0.5 0.0 0.5 Time Delay (b) Figure 7: (a) Agent trajectories, squared distance plot and ellipse sho wing collision intervals for V arying delay and (b) the same trajectories where the red agent is delayed delayed by 0.2 seconds The collision times of the endpoints of the de- layRange are computed via: coll isionT imes = − B ( del ay Rang e ) − D 2 A (14) Note that (13) is undefined when the discriminant is negati ve, which can only happen for a = 0 or c = 0 . This can only happen when agents’ motion vectors are parallel (moving the same or opposite directions) or ei- ther agent is waiting in place. These cases are easy to detect. When the motion is not of infinite length, i. e. seg- mented motion, we must also take into account the beginning and end of the duration of motion. Ef fec- tiv ely , we treat agents as if they appear at their start time and disappear at their end time. When the move- ment of agents 1 and 2 start at t 1 and t 2 and end at t 0 1 and t 0 2 respectiv ely , we measure time relativ e to t 0 = M I N ( t 1 , t 2 ) and t max = M I N ( t 0 1 , t 0 2 ) . In the case that δ = t 1 − t 2 is outside of the range delay Rang e as calculated via (13), no collision will occur . If ei- ther of the collision times (as calculated in (14) for each 0 1 2 3 4 0 1 2 3 4 X Y 2.5 3.5 4.5 5.5 −0.2 0.2 0.4 0.6 0.8 1.0 Time Dist Sq. 3.0 4.0 5.0 −1.5 −0.5 0.5 1.0 1.5 Time Delay Figure 8: An example where the maximum delay time happens after the first agent arriv es at its destination. point in del ay R ang e occur before t 0 , or after t max , the delay times need to be re-computed for t 0 or t max as necessary using (15). An example where t max occurs too early is shown by the vertical dashed line in Figure 8. This yields the algorithm detailed in Algorithm 1 for computing the unsafe interv al for segmented motion. The algorithm is straightforward and utilizes the follow- ing additional formulas: The value of δ , giv en a time which is deriv ed from (12), solved for δ : δ = − p ( B t + E ) 2 − 4 C ( t ( At + D ) + F ) + B t + E 2 C (15) The leftmost t coordinate on the ellipse: minC ol lisionT ime = center t − √ (2 BE − 4 C D ) 2 +4(4 AC − B 2 )( E 2 − 4 C F ) 2(4 AC − B 2 ) (16) where center t is B E − 2 C D 4 AC − B 2 At Algorithm 1, lines 5-9 check the actual delay ( δ = t 2 − t 1 ) between the tw o agents against the unsafe delay range per equation (13). If there is no collision (e.g. in the case of parallel mo vement) or δ does not fall inside the unsafe range, no collision will occur . Lines 10-23 compute the unsafe time interval per equation (14) and then adjust the endpoints accordingly per t0 and tmax using equation (15). The final result is the adjusted unsafe interval for agent 1. This interval can no w be used to instruct agent 1 not to start execution of its action inside the interval (e.g. by starting its action sooner or later). Note that the unsafe interval for agent 2 is the neg ated interv al for agent 1 – [-range[2],-range[1]]. 5.2 Exact Delay f or Initial V elocity with Constant Acceleration The equi v alent conic equation for 4th order biv ariates is called a quartic plane curve. A closed-form solution for unsafe intervals is still an open question. Ho wev er , an interativ e solution has been formulated for the con- stant velocity case which is generalizable to this case (Andreychuk et al. 2019). The algorithm starts by e valuating (7) at t 0 , retriev- ing an initial upper bound from the interval which is closest to and greater than t 0 . Then performs a binary search, from both ends of the interval until the interval is determined within a predetermined accuracy thresh- old. Binary search is a well known algorithm and will not be repeated here. 5.3 Minimum V elocity Change f or Constant V elocity In order to determine the minimum velocity change nec- essary to a void collision for segmented motion, a V O is created as shown in Figure 9 which is similar to Figure 2.4, b ut with motion se gments added. Motion segments Algorithm 1 Unsafe Interval Computation for Seg- mented Motion 1: INPUT : P1,P2,V1,V2,t1,t2,t1’,t2’,r1,r2 2: t0=MAX(t1,t2) 3: tmax ← MIN(t1’,t2’) 4: δ =t2-t1 5: // Execute equation (13) to get unsafe delay range 6: range ← delayRange(P1,P2,V1,V2,r1,r2) 7: if range= ∅ or range[1] > δ or range[2] < δ then 8: retur n NO COLLISION 9: end if 10: // Execute equation (14) to get unsafe time range 11: collisionTimes ← delayT imes(P1,P2,V1,V2,r1,r2) 12: minCollisionTime ← MIN(collisionT imes) 13: maxCollisionTime ← MAX(collisionT imes) 14: // Truncate delay for motion time se gments 15: if minCollisionTime < t0 then 16: // Get delay for t0 via (15) 17: range[1] ← delayAtT ime(P1,P2,V1,V2,r1,r2,t0) 18: end if 19: if maxCollisionTime < t0 then 20: // Get delay for tmax via (15) 21: range[2] ← delayAtT ime(P1,P2,V1,V2,r1,r2,t0) 22: end if 23: // Return the unsafe interval by adding the delay to the start time 24: return [t0+range[1],MIN(tmax,t0+range[2])] are sho wn as dotted arrows with large points at the be- ginning and end of the segment. V elocities that lie on the segment are the only valid choices, hence a veloc- ity that lies just outside of the V O as sho wn in diagram (b) is desirable for determining the minimum necessary change to avoid collision. There may be kinematic con- straints on agents, such as a maximum velocity . The following steps can be undertaken to determine the appropriate action for the agent, which may result in the agent waiting in place or using a ne w velocity: 1. Detect if a collision will occur inside the segments. This can be done via equation (4). • Return if no collision 2. Construct a VO, then compute a ne w velocity that lies on the segment and intersects with the edges of the V O as sho wn in Figure 9 (b) for agent A. Ths can be done using a formula for the line intersection point (Antonio 1992) of the motion vector and both of the V O tangent lines. • Return new velocity if either of the velocities at the intersection points are kinematically feasible. 3. Construct and check a VO for a new velocity for agent B. • Return new velocity if either of the velocities at the intersection points are kinematically feasible. 4. If the current state of the agent will allo w it to wait in place, compute the delay using Algorithm 1. (a) − − → V A − − → V B A B (b) A V O B r A + r B Figure 9: V elocity Obstacle (V O) construction based on (a) two agents moving on edges. (b) The minimum change for safe velocity is determined by the intersec- tion points of the edge and the velocity obstacle. • Return original velocity and new delay . 5. Otherwise, return NO SOLUTION 6 Conclusion In this paper , we hav e provided an o vervie w of collision detection for polygonal and circular agents. W e have also provided deriv ations for computing the exact inter - val of collision between two agents with constant v eloc- ity or intial velocity with constant acceleration. W e have additionally deriv ed a formulation for computing unsafe intervals (the range of start times in which agents come into collision) for two circular agents with constant ve- locity and differing start times. An algorithm was then shown for computing the unsafe intervals in the case of segmented motion. Finally , an algorithm for computing safe velocities and delay times was outlined. Future w ork may in volv e deri v ations of the exact for- mulation of unsafe interv als for agents with accelera- tion. References [Andreychuk et al. 2019] Andreychuk, A.; Y akovle v , K.; Atzmon, D.; and Stern, R. 2019. Multi-agent pathfinding with continuous time. In Proceedings of the T wenty-Eighth International Joint Confer ence on Artifi- cial Intelligence, IJCAI-19 . International Joint Confer- ences on Artificial Intelligence Organization. [Antonio 1992] Antonio, F . 1992. Faster line segment intersection. In Gr aphics Gems III (IBM V ersion) . Else- vier . 199–202. [Bresenham 1987] Bresenham, J. E. 1987. Ambiguities in incremental line rastering. IEEE Computer Graphics and Applications 7(5):31–43. [Dyllong and Grimm ] Dyllong, E., and Grimm, C. V er- ified adaptive octree representations of constructive solid geometry objects. Citeseer . [Ericson 2004] Ericson, C. 2004. Real-time collision detection . CRC Press. [Fiorini and Shiller 1998] Fiorini, P ., and Shiller , Z. 1998. Motion planning in dynamic en vironments us- ing velocity obstacles. The International Journal of Robotics Resear ch 17(7):760–772. [Gilbert and Hong 1989] Gilbert, E. G., and Hong, S. 1989. A new algorithm for detecting the collision of moving objects. In Robotics and Automation, 1989. Pr oceedings., 1989 IEEE International Conference on , 8–14. IEEE. [Hendricks 2012] Hendricks, M. C. 2012. Rotated el- lipses and their intersections with lines. [Ho et al. 2019] Ho, F .; Salta, A.; Geraldes, R.; Goncalves, A.; Cav azza, M.; and Prendinger, H. 2019. Multi-agent path finding for uav traffic management. In Pr oceedings of the 18th International Confer ence on Autonomous Agents and MultiAgent Systems , 131–139. International Foundation for Autonomous Agents and Multiagent Systems. [Jim ´ enez, Thomas, and T orras 2001] Jim ´ enez, P .; Thomas, F .; and T orras, C. 2001. 3d collision detec- tion: a survey . Computers & Gr aphics 25(2):269–285. [Kiel, Luther , and Dyllong 2013] Kiel, S.; Luther , W .; and Dyllong, E. 2013. V erified distance computa- tion between non-conv ex superquadrics using hierar- chical space decomposition structures. Soft Computing 17(8):1367–1378. [K ockara et al. 2007] Kockara, S.; Halic, T .; Iqbal, K.; Bayrak, C.; and Rowe, R. 2007. Collision detection: A survey . In 2007 IEEE International Confer ence on Systems, Man and Cybernetics , 4046–4051. IEEE. [Li et al. 2019] Li, J.; Surynek, P .; Felner , A.; Ma, H.; and Satish, K. T . 2019. Multi-agent pathfinding for large agents. In AAAI . [Moore and W ilhelms 1988] Moore, M., and W ilhelms, J. 1988. Collision detection and response for com- puter animation. In ACM Siggr aph Computer Graphics . A CM. [Neyman and Pearson 1933] Neyman, J., and Pearson, E. S. 1933. The testing of statistical hypotheses in relation to probabilities a priori. In Mathematical Pr o- ceedings of the Cambridge Philosophical Society , vol- ume 29, 492–510. Cambridge Uni versity Press. [Requicha and V oelck er 1977] Requicha, A. A., and V oelck er , H. B. 1977. Constructi ve solid geometry . [W agner , W illhalm, and Zaroliagis 2005] W agner , D.; W illhalm, T .; and Zaroliagis, C. 2005. Geometric containers for ef ficient shortest-path computation. Journal of Experimental Algorithmics (JEA) 10:1–3. [W u 1991] W u, X. 1991. An efficient antialiasing tech- nique. In Pr oceedings of the 18th Annual Confer ence on Computer Graphics and Interactive T echniques , SIG- GRAPH ’91, 143–152. Ne w Y ork, NY , USA: A CM. [Y akovle v and Andreychuk 2017] Y akovle v , K., and Andreychuk, A. 2017. Any-angle pathfinding for mul- tiple agents based on sipp algorithm. arXiv pr eprint arXiv:1703.04159 .

Original Paper

Loading high-quality paper...

Comments & Academic Discussion

Loading comments...

Leave a Comment