This project is like indoor GPS.
An Electron TypeScript React app with extra horsepower from Rust server
The Rust CLI executable provides a protobuf gRPC API and handles the communication with the hardware devices, and calculates the position probability clouds.
The algorithm chosen is specifically designed to integrate with the visualization while preserving a high throughput of the original data. This is the opposite of some algorithms which only give you a (X, Y, Z) position for each tag.
- Electron App- Electron App Documentation
- Rust gRPC API- Rust App Documentation
Multilateration assumes that we already know the positions of the anchors, and we get distances of the various tags from some of the anchors. Not all tags necessarily manage to find all (or any) anchors at all times.
We don't necessarily trust distance measurements from hardware device, so the first step isn't to calculate a specific point estimate to where the tag is located.
Instead, we want to calculate a probability cloud, and display that.
That allows us to expose the inaccuracy of the hardware devices used.
- Decide on the maximum world size that this visualization supports
- Divide the world into voxels
- For each tag, go through all voxels and mark them with a transparency value to create a cloud of probabilities of the location for that tag.
- For each voxel, use pythagorian theorem to calculate distances from every relevant anchor.
- Compare the distances of the voxel from the anchors to the observed distances of the tag from the anchors. Say: the tag gave the distance to 4 anchors- we now have an array of 4 distance differences.
- Calculate a score for each voxel based on the distance differences. A smaller total difference indicates a higher probability that the tag is located in that voxel. You can use a scoring function that assigns higher scores to smaller differences, such as the inverse of the sum of squared differences or a Gaussian function. Inverse of the sum of squared differences is:
1 / [(x₁ - y₁)² + (x₂ - y₂)² + ... + (xₙ - yₙ)²]
we'll take that number (power 2) and put it into a variable P (default P=2) that can be adjusted with a slider.
Giving P a smaller value (such as 0.5) will cause large differences to have little effect.
Giving P a larger value (such as 2) will cause large differences to have greater effect than small differences.
- Normalize the scores such that the sum of scores for a single tag equals 1.0
- Give an allowance of brightness L of a specific color to each tag. Disperse the brightness to the voxels based on their relative scores (multiply by the scores).
Therefore, this algorithm has 2 adjustable variables:
- P for power in the "Inverse of the sum of squared differences" formula.
- L for the brightness allowance for each tag.
-
x86_64 Windows 10 22H2 or x86_64 Windows 11 23H2
-
16 GB RAM
-
No strict requirements for storage technology or capacity
-
System support for WebGL. Dedicated graphics card recommended
-
CPU with 6 CPU cores- 3 cores for Rust app, at least 2 cores for Electron app
-
Recommended mouse with mouse wheel for stable zooming gestures in the GUI
Run these commands in a cmd window:
cd rust_microservice
compile_ts_proto.bat
cd ../electron
npm run package
cd ../protobuf/rust_microservice
cargo clean
compile.bat
If you receive any errors during the build, follow the full build instructions and development environment setup for each of ./protobuf/rust_microservice
, ./electron
at their corresponding README.md
s.
Checkout to a new branch with the format: RLS_XX_XX_XX_YYYY_MM_DD
In the new branch- create a folder release
at the root directory of this repo.
Then copy the following into the release
folder:
protobuf/rust_microservice/target/release/grpc_microservice.exe
electron/release/build/____ Setup X.X.X.exe
Commit and push the release folder to that release branch, then checkout to master
. Do NOT create any release
folder in master
.
https://github.com/BigBIueWhale/multilateration_visualizer/tree/RLS_01_00_04_2024_05_10/release
- Fix annoying failure to reconnect: #2 (comment)
https://github.com/BigBIueWhale/multilateration_visualizer/tree/RLS_01_00_03_2024_03_30/release
- Disable auto-update: #1 (comment). It makes no sense for this app to have an auto-update functionality!
https://github.com/BigBIueWhale/multilateration_visualizer/tree/RLS_01_00_02_2024_03_25/release
-
Fix some graphics glitches in renderer, and improve graphics in general
-
Add app logo
-
Good default camera view (instead of being zoomed into the cube by default)
-
Fix warning when reloading Electron app 9 times (event emitter leak)
https://github.com/BigBIueWhale/multilateration_visualizer/tree/RLS_01_00_01_2024_03_24/release
-
Further optimizations (parallelism etc).
-
Include in the release folder: the source code required to do performance profiling to the compiled Rust executable.
https://github.com/BigBIueWhale/multilateration_visualizer/tree/RLS_01_00_00_2024_03_24/release
-
Front-end code contains 3d visualization of any voxels given by Rust server.
-
All parameters are hard-coded.
-
Rust algorithm code is not fully optimized yet, 2 frame per second at 128x128x128 world.
-
Simulator only.