This program is used for creating a graphic representation of where a TAG is located based on the distances between TAGs and ANCHORS. Summary
When the program is executed it takes 2 parameters as input: the path to the configuration file and the device ID from which you are running the program.
The configuration file has the list of services that need to be enabled for the device you are currently running the program from. These are some of the services:
anchor: opens a serial port connection to the Arduino that has the DW1000 antenna connected and every time it receives a range report from the Arduino, it sends the distance to the master service using an HTTP request.
master: this service enables an HTTP server. Other anchor services will send HTTP requests to the server sending as a parameter the anchor ID, the tag ID and the distance between this 2.
webApp: this is the frontend of the application. The webpage will draw a graphic representation of where the Anchors are located and the calculated position of the Tag.
For calculating the position of the Tag, we use a method called trilateration. This method takes as input the distance between 3 Anchors and the Tag along with the coordinates of each Anchor. Since we already know the location of the 3 Anchors, it's possible to calculate the location of the Tag.
Example
YouTube video:
This is an example of the architecture I have running. The **anchor** services are running in 3 different devices: 2 raspberry pi and 1 mac. The mac is also running the **master** service and the **webApp** service. Architecture
The program has been tested in Mac OS and in Raspbian Running the program
<path to JAR>: this is the path to the generated JAR. <path to config file>: this is the path to the JSON config file (an example can be found in the doc folder) <device id>:device ID of the computer you are running the program from.
java -Djava.library.path=/usr/lib/jni -cp \ common.Program configPath:\ deviceId:\ Raspbian
Example: java -Djava.library.path=/usr/lib/jni -cp /home/pi/dw1000server.jar common.Program configPath:/home/pi/dw1000server.JSON deviceId:raspberry1