Revision 11/6/2025
Flight-Tools Documentation
This documentation supports both human contributors and future AI sessions. It is designed for clarity, reproducibility, and sustainable engagement.
Table of Contents
Project Overview
Flight-Tools is a modular toolkit for analyzing PX4 and ArduPilot logs. It supports both CLI and Flask modes, with a focus on contributor clarity and reproducibility.
[Insert project diagram or logo here]
Directory Structure
The project is organized into logical subdirectories. Key folders include:
tools/– Python scripts for log analysiswebapp/routes/– Flask route definitionswebapp/templates/– HTML templates for web interfacewebapp/uploads/– Temporary storage for uploaded log files
[Insert visual directory tree from flight-tools-directory.txt]
Script Anatomy
Each tool script follows a consistent structure:
- Modular functions for parsing, extracting, and formatting data
- Optional CLI entry point for standalone use
- Flask entry point for web integration
Flask Integration
Flask routes are defined in ulg_routes.py and bin_routes.py. Each route:
- Handles file upload and validation
- Calls the appropriate tool function
- Renders the result using a matching HTML template
[Insert screenshot of Flask output or form interface]
Template Design
Templates use Jinja2 syntax and support:
- Conditional rendering of charts, tables, and messages
- Fallback messaging for missing data
- Stateless re-entry for multi-step tools
Adding or Modifying Tools
To add a new tool:
- Create a new script in
tools/with modular functions - Add a route in
webapp/routes/ - Create a matching template in
webapp/templates/ - Test both CLI and Flask modes
Deployment Notes
Flight-Tools runs on a Raspberry Pi with Python 3 and Flask. Key deployment notes:
- Use virtualenv for isolation
- Configure
UPLOAD_FOLDERinconfig.py - Consider adding a cron-based cleanup script for uploads
AI Re-engagement Tips
To re-engage Copilot or another AI assistant:
- Share this documentation link
- Describe the last working state
- Ask for clean copies of scripts or templates
- Use phrases like “remind me how this works” or “help me re-sync”
Glossary
- Dual-mode – Supports both CLI and Flask execution
- Summary dictionary – A structured output used for rendering results
- Fallback messaging – Graceful handling of missing or invalid data
- Stateless route – Flask route that doesn’t rely on persistent session state
- Contributor clarity – Design principle focused on maintainability and onboarding
Appendices
- Appendix A: Sample `.ulg` and `.bin` files
- Appendix B: Template snippets and reusable blocks
- Appendix C: Cleanup script architecture (planned)
[Insert contributor credits or version history here]