; Fire Gimbal Control - example configuration.
;
; Copy this file to "config.ini" and edit for your deployment:
;     cp config/config.example.ini config.ini
;
; The real config.ini is gitignored because it contains credentials.
; MQTT credentials may instead be supplied via the environment variables
; FGC_MQTT_USER and FGC_MQTT_PW, which take precedence over the values here.

[General]
; Tower identity, substituted into all MQTT topics and CamEvent payloads.
tower_name = ExampleTower
; Seconds between captures.
image_interval = 5
; 1 = print motor telemetry each loop tick, 0 = quiet.
debug = 0

[Network]
; MQTT broker address (the ground-station / ZKMS server).
zkms_server_ip = 127.0.0.1
; Prefer the FGC_MQTT_USER / FGC_MQTT_PW environment variables over these.
mqtt_user = CHANGE_ME
mqtt_pw = CHANGE_ME

[Camera]
; Camera IDs: GigE IP (e.g. 192.168.11.101) or USB device ID (e.g. DEV_1AB22C0AADED).
; Leave entries blank/absent for cameras you do not have. Order maps to RGB, ACR, NIR.
id_Cam1 = DEV_0000000000
id_Cam2 =
id_Cam3 =
id_Cam4 =

[Serial]
; Motor-controller serial device and baud rate.
device = /dev/ttyACM0
baud = 115200

[Motor]
; Degrees<->encoder-counts calibration for each axis. The firmware speaks only
; in absolute encoder counts; these map them to the heading/elevation degrees
; used by MQTT (target_HDG) and CamEvent. CALIBRATE on the rig after homing:
;   counts = zero_count + deg * counts_per_deg
; counts_per_deg may be negative to flip direction. min/max_deg clamp commands.
; Yaw starting point: firmware steps_per_rev=177000 over ~180 deg => ~983.33.
yaw_counts_per_deg = 983.33
yaw_zero_count = 500000
yaw_min_deg = -90
yaw_max_deg = 90
; Pitch (physical endstops, ~0..60 deg). CALIBRATE counts_per_deg/zero_count.
pitch_counts_per_deg = 8333.33
pitch_zero_count = 0
pitch_min_deg = 0
pitch_max_deg = 60

[Scan]
; Capture scan grid (the (yaw,pitch) waypoints auto-sweep steps through).
; If grid_file is set, that CSV is used verbatim (one "yaw_deg,pitch_deg" per
; line, '#' comments allowed) - edit it to define exact scan coordinates.
; If grid_file is blank, a grid is generated: yaw_intervals positions across
; [yaw_min_deg, yaw_max_deg] at each pitch level, traversed ping-pong.
grid_file =
yaw_intervals = 56
yaw_min_deg = -90
yaw_max_deg = 90
pitch_levels = 10,30,50

[Paths]
; Directory for saved .jxl images. Supports leading ~ and $ENV expansion.
; If blank, defaults to $XDG_DATA_HOME/fire_gimbal_control/images
; (i.e. ~/.local/share/fire_gimbal_control/images).
output_dir =

[Features]
; Enable/disable subsystems and select mock (simulated) implementations.
; CLI flags (e.g. --no-mqtt, --mock-camera, --mock-serial) override these.
enable_mqtt = true
enable_camera = true
enable_serial = true
mock_camera = false
mock_serial = false

[UI]
; Full-screen terminal dashboard (sectioned, colored, live status + log pane).
; false => headless line console (default; stdin commands, stdout logs).
; CLI --tui / --no-tui override this. Requires a build with WITH_TUI=ON.
enable_tui = false

[Logging]
; level: trace|debug|info|warn|error|off (default info). --log-level overrides.
level = info
; Verbatim per-category wire tracing, independent of the level above. Comma list
; of: serial, mqtt, camera, control, all, none. OFF by default. --trace overrides.
; Lines are tagged [SERIAL]/[MQTT]/[CAMERA]/[CONTROL] with TX/RX direction, e.g.
;   [SERIAL] TX kd180   /   [SERIAL] RX $;1234;0;...
trace =
