Data and code from: The aerial combat strategy of dragonflies
Data files
May 01, 2026 version files 10.06 MB
-
Dragonfly_Data_and_Code.zip
10.05 MB
-
README_for_Dragonfly_Aerial_Combat.md
6.90 KB
-
README.md
6.80 KB
Abstract
Associated Publication
Samuel T. Fabian, Alexandra M. Yarger, Szu-Lung Chen, Huai-Ti Lin; The Aerial Combat Strategy of Dragonflies. J Roy Soc Interface, 2026
Dataset Overview
This dataset contains 3D reconstructed flight trajectories of aggressive aerial interactions between male dragonflies (Trithemis aurora), along with MATLAB scripts used for kinematic analysis and simulation studies presented in the associated publication. All data and code is located in the file titled 'Dragonfly_Data_and_Code.zip'. This readme is also enclosed as 'README_for_Dragonfly_Aerial_Combat.md'.
The dataset includes:
- Reconstructed 3D trajectories from stereo high-speed video recordings
- Paired interactions (dogfights) between two male dragonflies
- MATLAB scripts for:
- Kinematic analysis and figure reproduction
- Simulation of pursuit-based guidance strategies
Dataset scale:
- 102 paired interactions
- 204 individual trajectories
- Median trajectory length: ~1.06 s
- Recordings captured at 250 fps, typically with ~2000 frames per recording
Each recording may contain multiple interactions, but each interaction involves only two individuals.
A trajectory corresponds to a single continuous track of an individual dragonfly during an interaction.
File Structure
All Dogfighting Trajectories/
Contains .mat files for individual recordings. Each file may include one or more interactions between two dragonflies.
functions/
MATLAB helper functions for data loading, kinematic calculations, and plotting. Automatically added to the MATLAB path by the main scripts.
main_DogfightKinematicAnalysis.m
Primary script used to reproduce analyses and figures from the publication.
main_SteeringDuel.m
Simulation of two interacting agents using pursuit-based control laws. Multiple configurations are available in the script comments.
main_SingleRecordingPlotting.m
Example script for visualising trajectories from a single recording.
Experimental Methods Summary
- Recordings were made using a calibrated stereo camera system with frame-synchronised high-speed cameras.
- Videos were recorded at 250 frames per second, typically with ~2000 frames per recording.
- The recording volume was approximately 2 m x 2 m x 1.5 m around freshwater ponds.
- 2D trajectories were manually curated and triangulated to reconstruct 3D motion.
- Trajectories were smoothed using cubic spline fitting after removal of high-error points.
- Each interaction consists of two male dragonflies engaged in aggressive aerial pursuit, with frequent role switching between chaser and evader.
Data Structure
Each file named DF_xxxx_3D_Trajectories.mat contains two MATLAB structures:
1. metadata
| Variable | Description | Units | Notes |
|---|---|---|---|
| stereoParams | Stereo camera calibration parameters | - | Used for triangulation |
| fps | Frame rate | Hz | Typically 250 Hz |
| smoothCnst | Smoothing constant | - | Used in spline smoothing |
| smoothDistLim | Distance threshold for filtering | mm | Excludes outliers |
| smoothRMSEThresh | Reprojection error threshold | pixels | Excludes poor reconstructions |
| trackC1, trackC2 | 2D tracked positions | pixels | Cell arrays of [X,Y]; NaN = not visible |
| nf | Number of frames | - | Typically ~2000 |
2. DF_interactionData
| Variable | Description | Units | Notes |
|---|---|---|---|
| rawTraj | Raw 3D trajectories | mm | Cell array of [X,Y,Z]; cell 1 is often empty in dyadic interactions |
| rawTrajRMSE | Reprojection error | pixels | Per-point reconstruction error |
| smoothTraj | Smoothed 3D trajectories | mm | Filtered trajectories used for kinematic analysis |
| flappingState | Wing state classification | - | 1 = gliding, 2 = flapping |
Coordinate system: positions are expressed relative to camera 1 and rotated so that the Z-axis is aligned vertically using the plane of the water surface.
Reference frame: trajectories are expressed in the ground reference frame. Wind effects are assumed negligible because recordings were taken in a sheltered location.
Behavioural Context
All trajectories represent male-male aerial contests (dogfights).
Key behavioural features:
- Interactions involve two individuals with no physical contact
- Roles (chaser and evader) frequently switch during an interaction
- Flight paths include looping, spiralling, and tight turning manoeuvres
- The behavioural objective is not interception, but maintaining a favourable relative position
How to Use This Dataset
-
Load a trajectory file in MATLAB:
load('DF_xxxx_3D_Trajectories.mat') -
Access trajectory data:
DF_interactionData.rawTraj -
Key usage notes:
rawTrajcontains reconstructed 3D positions- In most files,
rawTraj{1}is empty - Remaining cells correspond to individual dragonflies
- Units are millimetres (mm)
-
For example visualisation:
main_SingleRecordingPlotting.m
Data Usage Notes and Limitations
- Sections of missing data are represented as
[NaN, NaN]in 2D tracks. - Reconstruction accuracy varies; points with high reprojection error (>5 pixels) may be unreliable.
- Smoothed trajectories are provided for convenience but may not be suitable for all analyses.
- Users performing detailed kinematic analysis are encouraged to reprocess raw trajectories as needed.
- Individual dragonflies are not tracked across recordings; trajectories represent independent interaction segments.
Reproducing Analyses
-
Main kinematic analyses:
main_DogfightKinematicAnalysis.m -
Simulation of pursuit interactions:
main_SteeringDuel.m
Requirements
- MATLAB R2022b (or compatible version)
Contact
Samuel T Fabian,
University of Oxford,
