How abhiramv010/captaingemma works
AI Pilot is a Cessna 172 simulation with a language-model captain, PID autopilot, live display, and optional Arduino hardware that mirrors aircraft attitude. The principal workflow is: the main loop advances the sim, sends state to the captain, applies returned targets, and forwards servo offsets to the serial bridge. The bridge also relays rudder-button events back to the loop. Weather, crash handling, and manual hardware controls are additional product capabilities. Firmware relationships are based on the README; unsampled firmware internals are not inferred.
Main entry points: main.py Run coordinator · sim.py Flight model · captain.py Captain worker · bridge.py Serial bridge
Components 16
Simulation runtime
- Run coordinator
main.py - Flight model
sim.py - PID autopilot
sim.py - Wind and gusts
sim.py
AI captain
- Captain worker
captain.py - Captain settings
config.py
Hardware control
- Serial bridge
bridge.py - Arduino aircraft controls
firmware/pilot_slider/pilot_slider.ino
Operator interface
- Live flight display
display.py - Manual control GUI
gui.py
Other components
- Operator
- Ollama backend
- Hosted API backend
- PRY log
pry.csv - Rudder button
- JSBSim engine
Connections 22
- Operator → Run coordinator: starts run
README.md - Run coordinator → Flight model: steps and resets
main.py - PID autopilot → Flight model: sets flight controls
sim.py - Wind and gusts → Flight model: sets wind
sim.py - Flight model → PID autopilot: provides state
sim.py - Run coordinator → Captain worker: updates state
main.py - Captain worker → Run coordinator: returns targets
main.py - Run coordinator → Flight model: sets targets
main.py - Captain worker → Captain settings: reads settings
captain.py - Captain worker → Ollama backend: requests completion
captain.py - Captain worker → Hosted API backend: requests completion
captain.py - Run coordinator → Live flight display: updates view
main.py - Run coordinator → Serial bridge: sends offsets
main.py - Run coordinator → Serial bridge: signals crash
main.py - Serial bridge → Run coordinator: reports button presses
main.py - Serial bridge → Arduino aircraft controls: sends axis commands
README.md - Arduino aircraft controls → Serial bridge: reports button press
README.md - Rudder button → Arduino aircraft controls: triggers input
README.md - Operator → Manual control GUI: adjusts controls
README.md - Manual control GUI → Arduino aircraft controls: sends axis commands
gui.py - Manual control GUI → PRY log: saves settings
gui.py - Flight model → JSBSim engine: runs aircraft model
README.md