A Simulation Toolkit for the Kinematics of Flapping-Wing Micro Aerial Vehicles
Project description
FlapKine – A Simulation Toolkit for the Kinematics of Flapping-Wing Micro Aerial Vehicles
Overview
FlapKine is a modular, PyQt5-based application designed for 3D visualization of forward and inverse kinematics in flapping-wing systems. Its hybrid architecture allows it to operate as both an intuitive graphical user interface (GUI) and a Python library, enabling researchers to simulate and animate flapping-wing motion either interactively or through code using FlapKine’s core classes.
The GUI is built to assist researchers who may not be proficient in programming, offering an accessible platform for scientific exploration and analysis.
FlapKine is lightweight and relies on a few essential libraries:
Key Features:
- Inverse Kinematics Engine — Compute and visualize 3D joint trajectories using custom analytical models.
- Control timelines, playback speed, and rendering in real time.
- Import and display STL files with real-time transformation tracking.
- Project Setup Panel — Configure video, camera paths, STL export, lighting, and reflections.
- Optimized Performance — Built on VTK + PyQt5 with multithreaded rendering for speed.
For the full documentation, tutorials, and API reference, visit the FlapKine Docs!
The source code can be found in the GitHub repository and is fully open source under MIT license. Consider starring FlapKine to support its development.
Installation
🔹 Option A: Windows Installer
Download the latest release from the Releases Page and run the installer. This will install Flapkine on your system with optional desktop shortcuts.
🔹 Option B: Developer Mode (Python)
Set up FlapKine locally for development using the steps below:
-
Clone the Repository
git clone https://github.com/ihdavjar/FlapKine.git cd FlapKine
-
(Recommended) Create a Conda Virtual Environment
conda create -n flapkine-env python=3.10.3
-
Activate the Virtual Environment:
conda activate flapkine-env
-
Install Required Dependencies:
pip install -e.
-
Launch the Application:
python -m FlapKineLauncher.py
Note: For proper video rendering support, you must install the K-Lite Codec Pack (Basic or Standard version is enough). Without it, some video player features may not work, due to missing codec issues.
Example
Get started with FlapKine using ready-to-run example projects. Each example showcases a different kinematic configuration and demonstrates how to:
- Set up and simulate motion
- Visualize results using the FlapKine interface
- Reproduce the setup entirely from scratch
Each project includes:
- A pre-configured scene file (
scene.pkl) - A complete simulation config (
config.json) - Required resources to build the project from scratch
- Instructions to both run and rebuild the project
For detailed insights into the project structure and usage patterns, check out the Examples section in the FlapKine documentation. It showcases practical implementations and helps you understand how the components fit together seamlessly.
1-DOF Flapping Wing System
Download the project.zip
This example simulates a wing structure undergoing:
- Rotation about a single axis (z-axis)
- Visualization of a 3D wing mesh loaded from an STL file
It includes all necessary configuration settings, time-varying angle inputs, and STL files required to run and reproduce the simulation in FlapKine.
Files Included
project.zip: A compressed archive containing both the full simulation project and the necessary resource files.
Upon extraction, the contents of project.zip are organized into two main folders:
1_DOF_1/: Contains the actual project setup, which can be loaded into FlapKine.resources/: Contains supporting files required for reproducing the project from scratch, such as STL meshes, angle time series, and plots.
resources/ Contents
resources/
├── angles/
│ ├── alpha_data.csv # Rotation about the x-axis (all zeros)
│ ├── beta_data.csv # Rotation about the y-axis (all zeros)
│ └── gamma_data.csv # Rotation about the z-axis (time-series values)
│
├── stl/
│ └── wing.stl # 3D mesh of the wing
│
└── angle_plot.png # Plot of the rotation angles over time
Simulation Details
This is a single degree-of-freedom system, where only the rotation about the z-axis (gamma_data.csv) is active. The alpha and beta angles (which can also be verified by visualizing the CSV files in resources/angles) remain zero throughout the simulation.
Below is a plot showing the time-series data for each rotation angle given in the angles/ folder:
Figure: Time-series plot of the rotation angles (alpha, beta & gamma) used in this example.
Running the Example
- Extract the
project.ziparchive to your desired directory. - Launch the FlapKine application and select Load Project.
- Navigate to the
1_DOF_1/folder and select the directory. - The project will load with a pre-configured scene. Below is a video of the simulation output:
Figure: Animation showing the flapping wing simulation rendered by FlapKine.
For more examples and detailed steps to rebuild the project from scratch, please visit the official documentation: FlapKine Examples and Tutorials
Acknowledgements
FlapKine has been developed as part of an undergraduate research initiative with strong interdisciplinary underpinnings spanning mechanical design, computer vision, and applied machine learning. Special thanks to:
- Professors and Mentors at IIT Jodhpur for their constant guidance and feedback during the development of the analytical models and kinematic pipelines.
- The open-source communities behind VTK, PyQt5, and NumPy, whose robust libraries form the backbone of this simulation toolkit.
- Researchers and users of DLTdv tools for inspiring the need for a modern, standalone 3D tracking solution tailored to flapping-wing MAVs.
- ChatGPT by OpenAI, for serving as an AI assistant in drafting high-quality documentation, generating professional Sphinx-style docstrings, and assisting with the creation of the FlapKine logo.
Contributing and Future Roadmap
Contributions to FlapKine are welcome and encouraged! Whether it's code, bug reports, feature suggestions, or documentation improvements — feel free to open a GitHub Issue or submit a Pull Request.
Planned Enhancements
- Flexible Wing Models (in progress): Enable simulation of deformable and compliant wing structures, moving beyond rigid-body assumptions.
- Multi-View Calibration System: Integrate multi-stereo camera calibration tools natively within the GUI for seamless experimental video setup.
- DLTdv Replacement Pipeline: Implement a modern Direct Linear Transform-based module to reconstruct 3D points from video footage, eliminating reliance on software like DLTdv.
- Plugin Architecture: Enable external researchers to contribute new kinematic models or analysis tools as plug-and-play modules.
The long-term goal is to position FlapKine as a self-sufficient, GUI-driven alternative to legacy motion tracking tools used in flapping-wing biomechanics and robotics, while retaining code-level access for power users.
If you're passionate about bio-inspired flight, computer vision, or robotics — your contribution can shape the next chapter of FlapKine.
✅ To-Do List
- Add example projects
- Improve the documentation
- Finalise paper.md
- Link all referenced sections consistently across README
- Add algorithm references (e.g., DLT explanation) with citations
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file flapkine-0.2.1.tar.gz.
File metadata
- Download URL: flapkine-0.2.1.tar.gz
- Upload date:
- Size: 88.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.10.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9010252062d85692c7a46d77882834b34423bf6a6d84945e0334a648c66101de
|
|
| MD5 |
fa83a52fa715fd656e5d5e4f84787438
|
|
| BLAKE2b-256 |
100a83b9ee1f6e5c74fb14366e51ed3d3f06302609c4a9f3fb84de2ae42b675e
|
File details
Details for the file flapkine-0.2.1-py3-none-any.whl.
File metadata
- Download URL: flapkine-0.2.1-py3-none-any.whl
- Upload date:
- Size: 103.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.10.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
59eddce70485e4983a4e072a3834747e11d7b11bea87150d75b07b7301255cb0
|
|
| MD5 |
9221df72a65b72cd6d9c78691b4f3789
|
|
| BLAKE2b-256 |
89ea8d92667dc60bc9a1adb834cf51bd6da6eeeb9613a3ccc6f5537649653c66
|