Flight-Tools Documentation

Revision 11/6/2025

Flight-Tools Documentation

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 analysis
  • webapp/routes/ – Flask route definitions
  • webapp/templates/ – HTML templates for web interface
  • webapp/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:

  1. Create a new script in tools/ with modular functions
  2. Add a route in webapp/routes/
  3. Create a matching template in webapp/templates/
  4. 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_FOLDER in config.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]