Utilities for generating UAV trajectory datasets in RotorPy, adding configurable sensor noise, and plotting the resulting trajectories. The current workflow focuses on a smooth conical spiral flight path and produces CSV files that are useful for filtering, state-estimation, and sensor-fusion experiments.
This repository provides three main capabilities:
- Run a RotorPy simulation of a spiral flight path and export the resulting CSV logs.
- Augment a simulation CSV with noisy IMU, mocap or GPS-style measurements, plus a drifting dead-reckoned state.
- Visualize tracking quality and noisy-vs-clean position data.
The code is organized as a small Python package in neurofly_dataset_generation, while the original top-level scripts remain as compatibility entry points:
main.py: run the simulation and export datasetsinject_trajectory_noise.py: create a noisy CSVvisualise_traj.py: plot desired vs followed trajectoryplot_noisy_position.py: plot clean vs noisy position
The preferred interface is now the package CLI:
python -m neurofly_dataset_generation <command> [options]Available commands:
generateadd-noiseplot-trackingplot-noisy
- Python 3.10+
numpyscipymatplotlibrotorpy
Dependencies are declared in pyproject.toml and requirements.txt.
If you already have a working environment with RotorPy installed, you can use it directly. In this workspace there is also a local virtual environment under rotorpy/.
Example setup:
python3 -m venv .venv
. .venv/bin/activate
pip install -r requirements.txt
pip install -e .If you prefer the existing local environment in this folder:
rotorpy/bin/pip install -e .rotorpy/bin/python main.py --plot-tracking --tracking-output-dir trajectory_plotsEquivalent package CLI:
rotorpy/bin/python -m neurofly_dataset_generation generate --plot-tracking --tracking-output-dir trajectory_plotsThis writes:
basic_usage.csv: full RotorPy state and reference logspiral_flight_data.csv: compact IMU-oriented exporttrajectory_plots/: optional tracking plots
Useful flags:
--no-plot--no-animate--quiet--sensor-csv <path>--simulation-csv <path>
python3 inject_trajectory_noise.py basic_usage.csv --output basic_usage_noisy.csv --abs-sensor mocap --seed 7Equivalent package CLI:
python3 -m neurofly_dataset_generation add-noise basic_usage.csv --output basic_usage_noisy.csv --abs-sensor mocap --seed 7Options:
--abs-sensor mocap--abs-sensor gps--abs-sensor none--noise-scale <float>--mode deadreckon
The generated noisy CSV appends:
- noisy accelerometer and gyro channels
- optional noisy mocap or GPS-like position channels
- noisy wind and rotor-speed channels
- a dead-reckoned drifting state estimate
python3 visualise_traj.py basic_usage.csv --output-dir trajectory_plots --showEquivalent package CLI:
python3 -m neurofly_dataset_generation plot-tracking basic_usage.csv --output-dir trajectory_plots --showpython3 plot_noisy_position.py basic_usage_noisy.csv --output-dir trajectory_plots --showEquivalent package CLI:
python3 -m neurofly_dataset_generation plot-noisy basic_usage_noisy.csv --output-dir trajectory_plots --showneurofly_dataset_generation/
cli.py Command-line entry points
config.py Shared defaults
io_utils.py CSV and filesystem helpers
noise.py Noise injection and dead reckoning
plotting.py Visualization helpers
simulation.py RotorPy simulation orchestration
trajectories.py Spiral trajectory definitions
- Generated CSV files and plot outputs are ignored by Git by default.
- The local
rotorpy/directory is treated as an environment directory and is also ignored. - The simulation entry point requires a Python environment where the
rotorpypackage is installed.