================================================================================
  OptiNV 4D ACOUSTIC FUSION & TRIANGULATION SERVER (LINUX RELEASE)
================================================================================
Nov. 24, 2026

1. OVERVIEW
-----------
This package provides a standalone 4D spacetime acoustic triangulation engine
(fusionE) and a reference visualization/telemetry receiver (mock_receiverD).
No Python installation or external libraries are required to run the compiled
binaries.

Package Contents:
  README.txt                This quick-start guide
  run.sh                    Master launcher script (Demo and Headless modes)
  fusionE                   Standalone 4D fusion and triangulation server
  mock_receiverD            Standalone telemetry monitor and 3D/2D plot display
  config.json               Network, array geometry, gating, and display config
  examples/mock_receiverD.py Reference Python source showing how to receive JSON
                            output from fusionE over TCP


2. EXTRACTION & SETUP
---------------------
Extract the archive and enter the release folder:

  tar -xzvf acoustic_tracker_release_YYYYMMDD.tar.gz
  cd acoustic_tracker_release


3. CONFIGURING ARRAYS & PARAMETERS (config.json)
------------------------------------------------
Before starting the system, edit config.json to match your array deployment:

  "sources":
    List each acoustic array's IP address, TCP port (default 9431), physical
    East-North-Up coordinates in meters ("enu": [E, N, U]), and orientation
    quaternion ("q": [qx, qy, qz, qw]).

  "target":
    IP address and TCP port (default 127.0.0.1:6000) where fusionE streams
    JSON triangulation matches and single-array bearings.

  Fusion & Gating Parameters:
    "buffer_size"               Ring-buffer history length (default: 100)
    "tempC"                     Ambient air temperature in Celsius
    "rhPct"                     Relative humidity (%)
    "max_mahalanobis_distance"  4D Chi-squared gating limit (e.g., 0.1 - 5.0)
    "min_height"                Minimum source height above array (meters)
    "max_spect_error"           Max RMS spectral difference in dB (e.g., 6.0)
    "min_spect_level"           Minimum spectral bin level in dB (e.g., -15.0)

  Display Settings (used by mock_receiverD):
    "target_persistance_time"   Display persistence for tracks/rays (seconds)
    "view_volume"               3D plot bounds (min/max east, north, up in m)


4. RUNNING THE SYSTEM
---------------------
A. Demo Mode (Starts both the visual dashboard and fusionE):
     ./run.sh

B. Headless / Custom Integration Mode (Starts fusionE only):
     ./run.sh --headless
   Use this mode on machines without a monitor or when your own software is
   listening on Port 6000 to ingest fusionE's JSON output stream.

Press Ctrl+C in the launcher terminal to cleanly shut down all processes.


5. RUNTIME COMMANDS (PORT 7000)
-------------------------------
While fusionE is running, you can send live text commands to 127.0.0.1:7000
(e.g., via netcat: `nc 127.0.0.1 7000`) to adjust local gating parameters or
broadcast control commands to all connected BeamformX arrays:

  thresh <val>    Set Mahalanobis gating limit (0.1 - 5.0)
  spect <dB>      Set max error for comparing spectra
  temp <deg C>    Set local temperature
  rh <%>          Set relative humidity
  freq <kHz>      Set beamforming center frequency (2-6)
  dynamic <dB>    Set hardware dynamic range (usually 30)
  integ <sec>     Set integration time constant (0.5 or 1.0)
  dthresh <dB>    Set drone metric detection threshold (0)
  min <dB>        Set min. SPL detection threshold (-25 to 0)
  report <mode>   Output (nothing, time, peaks, spectra)
  pause / resume  Pause or Resume hardware frame tracking
  log             Begin logging data to dateTime.bin
  log <filename>  Begin logging to filename such as fileA.bin
  stop            Stop logging data
  folder <path>   Set the folder on the BeamformX PCs to Log and Load files
  load <filename> Open a data file fileA.bin and play it
  exit            Exit BeamformX with prefs saved
  help            Display this command list in the fusionE console


6. OUTPUT FORMAT & LOGS
-----------------------
* Live TCP Stream (Port 6000): Newline-delimited JSON objects (JSON Lines)
  with two possible message types:

  1. Triangulated Match ("status": "acoustic_triangulation_match")
     Emitted when two arrays intersect within the Mahalanobis and spectral
     thresholds:
       - "peak_enut": [E, N, U, T]    Solved 4D coordinates (meters & Unix sec)
       - "mahalanobis_dist": float    4D spacetime mismatch score
       - "spect_rms_error": float     Propagation-adjusted spectral RMS diff (dB)
       - "timestamp_processed": float Fusion server processing timestamp
       - "station_data": [...]        Array IDs and raw spectra from both stations

  2. Single-Array Line of Bearing ("status": "single_array_detection")
     Emitted when an upward-pointing detection does not match a second array:
       - "sender_id": int             Reporting array index
       - "origin_enu": [E, N, U]      Reporting array coordinates (meters)
       - "global_bearing_theta_deg"   Global zenith/elevation angle (degrees)
       - "global_bearing_phi_deg"     Global compass azimuth from North (degrees)
       - "estimated_range_m": float   Nominal ray display length (meters)
       - "spectrum": [...]            Frequency bin levels from the reporting array

* Disk Logs: Automatically saved as JSON-lines files in ./logs/ upon startup.
* Custom Integration: See examples/mock_receiverD.py for a complete example
  of parsing both JSON payload types over TCP.
