An OptiNav multi-array drone tracking system has several microphone arrays, each connected to a Windows PC running BeamformX. There is also
a Linux PC running a program called fusionE that connects to all of the BeamformX processors using TCP/IP sockets. The drone sightings 
are reported to fusionE in the form of JSON strings containing the bearring to the drone, a rough estimate of the range, and
a narrowband acustic spectrum.  fusionE processes these strings to try to find 3D triangulation points in (East, North, Up) coordinates
and emission time.  If a triangulation point is found, then fusionE reports the source information as well as the two acoustic spectra
from the two arrays to a receiver computer, also in JSON formart using TCP/IP sockets. If no acceptable triangulation is found, 
then fusionE reports the line of bearing information that was provided to it by BeamformX, including the direction to the source,
the approximate distance, and an acoustic spectrum observed from the source at the single array. Thus, fusionE can produce two kinds
of JSON output strings, "acoustic_triangulation_match" and "single_array_detection". 

The system consuming the strings from fusionE will depend on the particular installation.  To provide an example of the 
string how to use the data, the Python program mock_receiverD.py is provided. It makes a dynamic 3D plot showing the
array locations and either 3D sightings (red balls) or rays extending from the array locations, depending the fusionE
string type. It is assumed that mock_receiverD.py will be replaced with an appropriate code for the application. mock_receiverD.py is provided 
in both compiled and source form.

The configuration file config.json, documents the IP addresses and ports of the BeamformX PCs and the receiver PC as well as ENU coordinates of the arrays,
rotation quaternions of the arrays, temperature, and ray intersection criteria. It is best to locate the arrays so they are horizontal with the "top" edge
facing North.  Then the rotation quaternion can be left at the default values shown in the example file. The triangulation 
acceptance parameters, max_mahalanobis_distance and max_spatial_sigma in config.json affect how often the intersection criteria is met: bigger 
numbers give more intersections. The parameter tempC sets the temperature. This only has to be within a few degrees of the correct value.

The linux script run_remote.sh runs both mock_receiverD and fusionE. 
 
Required settings of BeamformX for each of the array machines:

On startup, set transform length to 1024 and the frame rate to 2 fps

In Drone Hound dialog, set maximum frequency to 6 kHz and make sure the Drone threshold is set to 0.

In Camera choose Fisheye view

In Settings, set dynamic range to 30 dB and the integration time to 0.5 s.

Press Remote to find the IP address and port to connect to this BeamformX. This goes into config.json on the Linux machine, along with the location of the connected array.


