How waleed999ahmed/mio-tac works
Project Type and Purpose
• This is a standalone desktop application (Python) for automated hardware testing of a gimbal (Pan, Tilt, Roll).
• Key responsibilities:
• Read configuration (serial port)
• Open MAVLink communication over serial
• Send test commands to gimbal motors
• Receive telemetry (orientation)
• Render real‐time gauges in a modern GUI
File Structure
• main.py – entry point: orchestrates startup, reads config, spawns threads, initializes GUI.
• connection.txt – simple config file storing COM port and baud rate.
• requirements.txt – declares external Python libraries (e.g., pymavlink, ttkbootstrap, tkinter).
• README.md – project overview and instructions.
• MIO-TAC.mp4 – demo video (optional documentation asset).
Extract Architecture Insights from README
• GUI: built with Tkinter + ttkbootstrap, displays real‐time gauge meters.
• Communication: MAVLink protocol over serial port.
• Concurrency: uses Python threads to avoid blocking the UI.
• Hardware target: Daly BMS–compatible gimbals.
Main Components
A. Configuration Module
• Reads connection.txt (COM port, baud rate) on startup.
B. Communication Layer
• Serial Port Interface
• MAVLink Message Parser & Encoder (via pymavlink)
• Command Scheduler (automates Pan/Tilt/Roll test sequences)
• Telemetry Listener
C. Business Logic / Controller
• Test Sequence Manager (decides next gimbal movement, verifies responses)
D. Presentation Layer (GUI)
• Tkinter Main Window
• Gauge Widgets (ttkbootstrap) showing Pan/Tilt/Roll angles in real time
• Status console or logs (optional)
E. Threading & Synchronization
• UI Thread (mainloop)
• Comm Thread (handles all MAVLink send/receive)
• Shared Data Structures / Thread‐safe Queues for passing telemetry and commands
Relationships and Data Flows
• Startup → Config Module loads parameters → passes to Communication Layer
• Comm Thread ↔ Serial Port ↔ Gimbal Hardware (via MAVLink)
• Comm Thread → pushes telemetry updates → Business Logic & GUI
• Business Logic → generates next movement commands → Comm Thread
• GUI Thread reads shared telemetry → updates gauges
Architectural Patterns / Principles
• Layered Architecture: clear separation of UI, control logic, and hardware interface.
• Producer–Consumer (Threading): Comm Thread produces telemetry; UI thread consumes it.
• Single Responsibility: each module does one job (config, comms, UI, test logic).
Technologies & Frameworks to call out
• Python 3.x
• pymavlink (MAVLink protocol)
• Tkinter + ttkbootstrap (UI)
• threading or concurrent.futures (Python threading)
• Serial (pyserial – implied for COM port access)