Obstacle avoidance in aerial pursuit

Collision avoidance [1–4] and target pursuit [5–8] are challenging flight behaviors for any animal or autonomous vehicle, but their interaction is even more so [9–11]. For predators adapted to hunting in clutter, the demands of these two tasks may conflict, requiring effective reconciliation to avoid a hazardous collision or loss of target. Technical approaches to obstacle avoidance rely mainly on path-planning algorithms [12], but these are unlikely to be effective during closed-loop pursuit of a maneuvering target, so collision avoidance must instead be implemented reactively during prey pursuit. For example, the pursuit-avoidance behavior of predatory flies has been successfully modelled by combining feedback on target motion with feedback on obstacle looming [13]. It is unclear, however, whether this mechanism will generalize to complex environments with many looming obstacles, and it remains unknown how aerial predators reconcile the conflict between obstacle avoidance and prey pursuit in clutter. Here we use high-speed motion capture data to show how Harris’ hawks Parabuteo unicinctus avoid collisions by making open-loop steering corrections during closed-loop pursuit. We find that hawks combine continuous feedback on target motion with a discrete feedforward steering correction aimed at clearing an upcoming obstacle as closely as possible at maximum span. By biasing the hawk’s flight direction, this guidance law provides an effective means of prioritizing obstacle avoidance whilst remaining locked-on to the target. We anticipate that a similar mechanism may be used in terrestrial and aquatic pursuit. The same biased guidance law could be used for obstacle avoidance in drones designed to intercept other drones in clutter, or in drones using closed-loop guidance to navigate between fixed waypoints in urban environments.

generalize to complex environments with many looming obstacles, and it remains unknown how 23 aerial predators reconcile the conflict between obstacle avoidance and prey pursuit in clutter. 24 Here we use high-speed motion capture data to show how Harris' hawks Parabuteo unicinctus 25 avoid collisions by making open-loop steering corrections during closed-loop pursuit. We find 26 that hawks combine continuous feedback on target motion with a discrete feedforward steering 27 correction aimed at clearing an upcoming obstacle as closely as possible at maximum span. By 28 biasing the hawk's flight direction, this guidance law provides an effective means of prioritizing 29 obstacle avoidance whilst remaining locked-on to the target. We anticipate that a similar 30 mechanism may be used in terrestrial and aquatic pursuit. The same biased guidance law could 31 be used for obstacle avoidance in drones designed to intercept other drones in clutter, or in 32 drones using closed-loop guidance to navigate between fixed waypoints in urban environments.

34
Pursuing prey through clutter is a complex and risky activity requiring the integration of distinct 35 guidance subsystems for obstacle avoidance and target pursuit. Harris' hawks offer an excellent 36 model system for studying this problem, because their pursuit behavior has been well characterized 37 in the open [11], but their hunting strategy involves making short flights after terrestrial prey in habitat 38 clutter [14]. Previous work has found that their unobstructed pursuit trajectories are well modelled 39 by assuming that turning is commanded at an angular rate: (1) 43 where , and are fitted constants, where ̇ is the angular rate of the line-of-sight from the pursuer 44 to the target, where is the signed deviation angle between the pursuer's flight direction and its line-45 of-sight to the target, and where is time [11]. Here, we use a high-speed motion capture system to 46 reconstruct the flight trajectories of = 4 hawks chasing a lure towed along an unpredictable path 47 about a series of pulleys in a large hall with or without obstacles (Video 1). We then simulate these 48 data computationally using several alternative models of the guidance dynamics, which we use for 49 hypothesis testing.

51
Experimental design. We used two rows of hanging ropes as obstacles: the first forming a dense 52 clump that the bird had to fly around, and the second simulating a row of trees that the bird had to fly 53 between (Fig. 1A,B). The full dataset contains four subsets: (i) a set of n=128 obstacle-free training  Model validation. We begin by using our new sample of n=128 obstacle-free training flights to 78 validate the mixed guidance law (Eq. 1). We match the hawk's simulated speed to its measured speed 79 and use Eq. 1 to model its horizontal turning behavior, taking the measured trajectory of the lure as a 80 given, and matching the initial conditions of each simulation to the measured data. We define the 81 prediction error of the simulation, ( ), as the distance between the measured and simulated 82 trajectories, which we summarize by reporting the mean prediction error ( ) for each flight, and its 83 median () over all the flights within a subset. Simulating the obstacle-free training flights at the 84 published [11] parameter settings of = 0.7, = 1.2 s !" and = 0.09 s typically resulted in a low 85 mean prediction error, with a median value of ̃= 0.22 m over the n=128 flights (95% CI: 0.20, 0.28 86 m). By comparison, the median over the independent data set of n=50 obstacle-free flights to which 87 Eq. 1 was originally fitted was ̃= 0.34 m (95% CI: 0.24, 0.53 m). Eq. 1 therefore models our sample 88 of n=128 obstacle-free training flights at least as well as the sample of n=50 outdoor flights to which 89 it was fitted, validating its suitability as a model of unobstructed pursuit behavior in Harris' hawks.

90
Because Eq. 1 feeds back the deviation angle , it produces a characteristic tail-chasing behavior that 91 is hypothesised to promote implicit collision avoidance when chasing a target that is itself weaving 92 between obstacles [11]. The lure travelled through the gaps between obstacles on the n=16 obstacle 93 familiarization flights, so we tested this hypothesis by using Eq. 1 to simulate these flights at the 94 parameter settings above. Although the model does not always predict the hawk's turning behavior 95 closely at the point of capture, it predicts the earlier sections of each flight well, following the lure 96 through the gaps between obstacles (Fig. S1A). The target pursuit subsystem that Eq. 1 describes is 97 therefore capable of producing a safe path through clutter when chasing a target that itself passes 98 safely between obstacles.

100
Model refinement. We next refined the parameters of the mixed guidance law (Eq. 1) by re-fitting 101 these to the n=260 test flights that we recorded. For direct comparability with the results of our 102 modelling using the original mixed guidance law [11], all of our simulations begin from 0.09 s after 103 the start of each recording, allowing the fitting of a sensorimotor delay of ≤ 0.09 s. We began by 104 fitting separate models to the test flights with and without obstacles, finding the guidance parameter 105 settings that minimized the median of the mean prediction error, , over each subset of flights (see 106 Materials and Methods). However, as the optimized parameters were similar for each subset ( = 107 0.75, = 1.15 s !" and = 0.005 s for the n=106 obstacle-free test flights; = 0.75, = 1.15 s !" 108 and = 0.015 s for the n=154 obstacle test flights), and were close to those fitted in previous work

109
[11], we re-fitted the model to the union of the test flights with and without obstacles. Because flights 110 with obstacles are overrepresented in this sample relative to flights without obstacles, we used a 111 subsampling procedure in which we randomly subsampled 80 flights without replacement from each 112 subset and identified the parameter settings that minimized ̃ over that subsample (see Materials and 113 Methods). We repeated this sampling experiment 100,000 times and took the median of the best- . We therefore take this refined mixed guidance 120 law as our best-supported model of the target pursuit subsystem of Harris' hawks.

122
Take-off direction is biased to avoid obstacles. The refined mixed guidance law usually predicted a 123 collision-free path around the first row of obstacles ( Fig. S1C), which reflects the fact that our 124 simulations are initialized using the bird's measured take-off velocity. Hence, if a hawk sets its take-125 off direction to avoid the first set of obstacles, then the resulting bias in the initial value of its deviation 126 angle will be embedded in its simulated pursuit behavior. We tested this prediction by comparing 127 the distribution of the initial deviation angle, # , measured between the hawk's flight velocity and its 128 line-of-sight to the lure at the start of the simulation, for the different test flight subsets (Fig. 3).

129
Whereas the distribution of # was unimodal with a mode at # ≈ 0˚ for the test flights without 130 obstacles, it was bimodal with modes at # ≈ ±20˚ for the test flights with obstacles ( Fig. 3A).

131
Accordingly, the median absolute initial deviation angle (Fig. 3B) was larger for the test flights with 132 obstacles (21.2º; 95% CI: 19.8º, 23.8º; n=154 flights) than for those without (11.7º; 95% CI: 9.1º, 133 13.9º; n=103 flights; see Fig. 3 legend for details of 3 exclusions). Hence, whereas the hawks took 134 off towards the lure when there were no obstacles present, they biased their take-off away from any 135 obstacle that was blocking their path to the lure. We next tested whether this observed bias in take-136 off direction was necessary and sufficient to ensure that the hawk's target pursuit subsystem would 137 produce a safe path around the first obstacle. We checked this by re-running the simulations for the 138 test flights with obstacles under the refined mixed guidance law, having set the initial deviation angle 139 as # = 0 (i.e., having set the simulation to take off directly towards the lure, despite the presence of 140 an obstacle blocking the way). These simulations often produced a collision with the first obstacle, 141 even when no collision had been predicted with # set to the value that we observed (Fig. 2). It follows 142 that the hawks' observed bias in take-off direction was both necessary and sufficient to cause their 143 target pursuit subsystem (Eq. 1) to produce a safe path around the first obstacle. Take-off bias minimizes obstacle clearance at maximum span. How did the hawks select an 170 appropriate take-off bias? Previous research on obstacle avoidance has found that domestic pigeons 171 Columba livia domestica target the centers of gaps between obstacles [2,16], and that Harris' hawks 172 look at the nearest edge of obstacles they are avoiding [17]. We therefore hypothesized that the hawks 173 took off by aiming at either the nearest edge of the obstacle or the midpoint of the gap between the 174 obstacle and the wall. We tested this by calculating the initial error angle, # , between the 175 hypothesized take-off aim and the direction of the hawk's flight and compared this to the equivalent 176 error angle for the lure (i.e., the initial deviation angle # ). The median absolute initial error angle 177 was smaller (Fig. 3C) when the hawk was assumed to have aimed its take-off at either the obstacle 178 edge (median | # |: 16.6º; 95% CI: 15.0, 18.6) or the gap center (median | # |: 16.1º; 95% CI: 14.4, 179 17.6) rather than the lure (median | # |: 21.2º; 95% CI: 19.8º, 23.8º). However, the initial error angle 180 was smaller again if the hawk was assumed to have aimed for a clearance of approximately one wing 181 length (0.5 m) from the obstacle edge (median | # |: 8.3º; 95% CI: 6.2º, 10.7º), with the median 182 absolute error angle, | B|, reaching a global minimum of 5˚ assuming a targeted clearance of 0.6 m on 183 approach to the first obstacle ( Fig. 4A,C). This strategy makes sense, because aiming at the edge of 184 an obstacle leaves no clearance and aiming at the center of a gap leaves more clearance than is 185 necessary for a gap larger than the wings' span. We conclude that the hawks biased their take-off 186 direction to turn tightly around the obstacle without having to close their wings, thereby reconciling 187 any initial conflict between obstacle avoidance and target pursuit without limiting their control 188 authority. The colored lines plot the same quantities for the subset of flights from each individual bird. Red dashed lines denote the 202 locations of the targeted clearances referred to in the main text; note that the exact position of the gap center varies 203 between trials owing to variation in the placement of the obstacles and is therefore summarized by its mean position 204 across trials. 205 Mid-course steering bias minimizes obstacle clearance at maximum span. The hawks' initial bias 206 in take-off direction explains how they avoided colliding with the first obstacle whilst chasing the 207 target, but not how they avoided colliding with the second (see Fig. 2). We therefore looked for 208 evidence of mid-course steering correction by comparing the time history of the median prediction 209 error ( ) under the refined mixed guidance law for the n=154 test flights with obstacles and the 210 n=106 test flights without (Fig. 5). Because the initial conditions of each simulation were matched to 211 those we had measured, (0) = 0 at the start of each flight. Thereafter, the simulations deviate from 212 the measured trajectories, but do so to a greater extent when obstacles are present (Fig. S1B,C). This 213 difference is consistent with the hypothesis that the hawks made mid-course steering corrections for 214 obstacle avoidance that the simulations under Eq. 1 alone do not capture. Moreover, the median 215 prediction error ( ) peaks at the times the hawks passed the first and second obstacles but does not 216 peak at those times for the test flights without obstacles (Fig. 5). The hawks therefore deviated most 217 strongly from the trajectory commanded by their target pursuit subsystem as they negotiated 218 obstacles, providing clear evidence of mid-course steering correction to avoid these. Given the biased 219 take-off mechanism that we have already identified, we hypothesize that mid-course steering 220 correction will likewise involve aiming for a clearance of approximately one wing length from any 221 obstacle blocking the path to the target. To test this hypothesis, we repeated the error angle analysis   second obstacles. Note that the median prediction error peaks at these times for the test flights with obstacles (orange) 240 but not for the test flights without obstacles (blue), providing evidence of mid-course steering correction to avoid them. between the obstacles, although it does not exclude the possibility that some other mechanism of 287 closed-loop obstacle avoidance was in operation. 288 We are left with the hypothesis that Harris' hawks pursue targets through clutter under the 289 mixed guidance law identified above, but that they avoid upcoming obstacles using feedforward  In cases where the obstacles were spaced less than 1.2 m apart, such that aiming for a clearance of avoidance whilst remaining locked-on to the target, and closely explains our data.

305
Target overshoot and residual collision risk. Unsurprisingly, our simulations do not capture every 306 detail of the hawks' turning behavior. In particular, the longest test-flight trajectories that we recorded 307 ended with the hawk overshooting the lure and making a hairpin turn to catch it. This behavior was 308 not captured by the refined mixed guidance law alone (Fig. S1B,C), yet perturbing the trajectory 309 commanded by the target pursuit subsystem by adding a feedforward steering correction to avoid the 310 second obstacle often caused the simulations to overshoot the lure in a more lifelike manner (Fig.   311 6A). The fact that a similar overshoot was also observed on the test flights without obstacles may 312 suggest that the real birds were unable to generate an accurate steering command (e.g. because of 313 sensor error), or were unable to meet this steering demand (e.g. because of physical constraint). It is 314 also possible that this overshoot was adaptive, reflecting an aspect of the control of the final strike 315 maneuver that our guidance simulations do not capture. Finally, although the hawks steered to avoid 316 the obstacles we presented, the compliant nature of their wings and the ropes used as obstacles meant 317 they could tolerate occasional collisions, like those they would experience when brushing past 318 vegetation in their natural environment. Our feedforward model of obstacle avoidance led to a 319 residual collision risk of 7% across the first and second obstacles, which closely matches the observed 320 collision rate of 6%.

322
Biased guidance as a biological strategy for pursuit-avoidance. Formally, we have evidence for 323 biased guidance of obstructed pursuit in Harris' hawks, with turning commanded at an angular rate: (2) 328 Here, is a bias command, is the distance to an upcoming obstacle, and is the signed error angle implementation has a clear behavioral interpretation, in that the bird is assumed to avoid obstacles by 341 making a saccadic flight maneuver analogous to those observed in insects.

342
It is reasonable to suppose that an analogous biased guidance model might successfully where ̇ is the looming rate of a narrow object (i.e., the rate of change in its apparent angular width). implicit obstacle avoidance if their target follows a safe path through clutter (Fig. S1A). In addition, 425 we find that Harris' hawks bias their take-off direction (Fig. 3) and make mid-course steering 426 corrections (Fig. 5) that perturb the deviation angle when a collision is imminent (Fig. 4), thereby 427 implementing explicit obstacle avoidance (Fig. 6). This obstacle avoidance subsystem is well 428 modelled by assuming that the hawks make a discrete steering correction when they encounter an 429 obstacle blocking their path at close range, aiming for a clearance of just over one wing length from  Parabuteo unicinctus pursuing a falconry lure towed along a zigzagging course around a set of 440 pulleys, with or without obstacles present (Fig. 1A). The birds included one 7-year old female (Ruby) 441 that had been included in a previous study [11], plus three first-year males (Drogon,Rhaegal,442 Toothless) that had not previously chased a target. A subset of the flights without obstacles that we 443 report are described and analyzed elsewhere using a related method [15], but the flights with obstacles

461
We used a simplified pulley configuration at the start of the initial training phase, with four 462 pulleys placed in a diamond-shaped configuration (Pulleys 1-4 in Fig. 1A). This layout produced two 463 possible lure courses, with an unpredictable bifurcation at the first pulley followed by two predictable 464 changes in target direction at the next two pulleys. We modified the pulley setup before the end of 465 the training phase, placing six pulleys in a chevron-shaped configuration (Fig. 1A,B). This layout 466 produced six possible courses, with two or three unpredictable bifurcations in target direction, and 467 one predictable change in direction at the last pulley. The lure course and hawk starting position were 468 randomly assigned before each flight, and we laid dummy towlines to make it harder for the hawks 469 to anticipate the lure's course (Fig. 1A,B). The speed of the lure was randomized within the range 6-470 8 m s -1 for each flight; at higher speeds, the hawks were unable to catch the lure before the end of the 471 course. Following the initial training phase, we randomized the presence or absence of obstacles 472 between test flights. This took considerable time, however, and was an unnecessary source of stress 473 for the birds, so we subsequently randomized the presence or absence of obstacles once at the start of 474 each day.  were mounted on a scaffold at a height of 3 m, spaced around the perimeter of the flight hall to 496 maximize coverage (Fig. 1A,B). The motion capture system was turned on at least an hour before  to label the anonymous markers in the rigid templates. Our first step was to identify markers that 518 remained stationary through the trial as being obstacle markers. For the remaining markers, we used 519 their height above the floor to distinguish between markers on the bird and the lure and used a 520 clustering algorithm to distinguish between markers on the backpack and the tail-pack. We used the 521 centroid of the backpack and lure as our initial estimate of their respective positions, treating any 522 frames in which fewer than three markers were detected on the backpack, tail-pack, or lure as missing 523 data.

524
The initial position estimates for the backpack, tail-pack and lure were contaminated by 525 misidentified markers, which we excluded by removing points falling further than 0.5 m from the 526 smoothed trajectory obtained using a sliding window mean of 0.05 s span. We then repeated this 527 sliding window mean elimination on the raw data with extreme outliers excluded, this time using a 528 distance threshold of 0.075 m. Our next step was to crop the trajectories to begin at the first frame on 529 which both the bird and lure were visible, and to end at the point of intercept defined as the point of 530 minimum distance between the bird and lure. We then used cubic interpolation to fill in any missing 531 data points and fitted a quintic spline to smooth the 3D data, using a tolerance of 0.03 m for the bird 532 and 0.01 m for the lure. Finally, we double-differentiated the spline functions, which we evaluated 533 analytically to estimate the velocity and acceleration of the bird and lure at 20 kHz, resulting in a 534 suitably small integration step size for our simulations.

536
Guidance simulations. As the birds always flew close to the ground plane, our guidance analysis 537 concerns only the horizontal components of the pursuit. We used the same forward Euler method and 538 MATLAB code described previously [11] to simulate the hawk's horizontal flight trajectory given the 539 measured trajectory of the lure. We modelled the hawk's turning using the mixed guidance law in 540 Eq. 1 for a given set of parameter settings , , and , matching its simulated flight speed to its 541 measured flight speed. In cases where the hawk's simulated trajectory resulted in an earlier intercept 542 than its measured trajectory, we matched the continuation of the simulated trajectory to that of the lure up to the measured point of intercept. By default, we matched the hawk's initial flight direction 544 in the simulations to that which we had measured. However, we also ran versions of the simulations 545 in which we re-initialized the hawk's flight direction at take-off or 4 m from the second obstacle, by 546 directing its flight towards some specified location (see Results). We defined the prediction error for 547 each flight, ( ), as the distance between the measured and simulated flight trajectories.

549
Statistical analysis. We optimized the guidance parameters , , and by minimizing the median 550 of the mean prediction error, , over a given subset of flights. We did this using an exhaustive search 551 procedure for values of and from 0 to 2 at intervals of 0.05, and for values of from 0 to 0.09 s 552 in intervals of 0.005 s. To ensure that we modelled the same section of flight for all values of , we 553 began each simulation at 0.09 s after the start of the trajectory. Although we optimized the guidance 554 parameters for the obstacle and obstacle-free test flights separately at first, we subsequently combined 555 these subsets, owing to the observed similarity of their best-fitting parameter settings. Because there 556 were more test flights with obstacles than without, we used a balanced subsampling procedure to 557 avoid biasing the fitting of the joint model in favor of obstructed pursuit. Specifically, we sampled 558 80 flights at random from each subset and identified the parameter settings that minimized ̃ over that 559 sample. We repeated this sampling experiment 100,000 times and took the grand median of the 560 resulting best-fitting parameter settings as our refined model. We quantified the goodness of fit of a 561 given guidance model by computing the mean prediction error, , for each flight. We then used a bias 562 corrected and accelerated percentile method to compute a bootstrapped 95% confidence interval for 563 the median of the mean prediction error ̃ at the best-fitting parameter settings. We report