-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
bae78f6
commit b93939b
Showing
2 changed files
with
51 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,54 @@ | ||
# React + Vite | ||
# Triangle localization Simulator | ||
|
||
This template provides a minimal setup to get React working in Vite with HMR and some ESLint rules. | ||
Explore triangulation localization in action with our app. See how it precisely determines the 3D position of a target from sensor distances, and visualize it instantly. We use a TSDB to store data for easy visualization. Experience the simplicity and power of triangulation localization with our app. | ||
|
||
Currently, two official plugins are available: | ||
![demo](./demo.gif) | ||
|
||
- [@vitejs/plugin-react](https://github.com/vitejs/vite-plugin-react/blob/main/packages/plugin-react/README.md) uses [Babel](https://babeljs.io/) for Fast Refresh | ||
- [@vitejs/plugin-react-swc](https://github.com/vitejs/vite-plugin-react-swc) uses [SWC](https://swc.rs/) for Fast Refresh | ||
## Quick start | ||
|
||
### Development Environment Setup | ||
|
||
``` | ||
// Start the service | ||
docker-compose up -d | ||
// Shut down the service | ||
docker-compose down | ||
``` | ||
|
||
### Endpoints | ||
|
||
- `http://localhost/triangle-localization-simulator/simulator`: Access the 3D webpage to gather sensor data from a synthetic scene. | ||
- `http://localhost/triangle-localization-simulator/viewer`: Retrieve data from Prometheus and visualize the target in 3D. | ||
- `http://localhost/api/`: Prometheus APIs. | ||
- `http://localhost/update`: Node server api for saving current sensor data. | ||
- `http://localhost/metrics`: Endpoints for Prometheus to collect data. | ||
- `http://localhost/:3000`: Grafana for visualizing data in a line chart. | ||
|
||
## Dependencies | ||
|
||
- [mui](https://mui.com/x/react-charts/lines/): Utilize MUI to create a line chart visualization on the webpage. | ||
- [three](https://threejs.org/): Incorporate Three.js to render a 3D synthetic scene, complete with camera controls, object transformation tools, and mouse-click 3D point detection. | ||
- [three-pathfinding](https://github.com/donmccurdy/three-pathfinding): Utilize Three.js Pathfinding to implement a tool for finding paths from point to point based on a given navigation model. | ||
- [numeric](https://github.com/sloisel/numeric): A library for numerical analysis, used in our case to solve Triangle Localization equations. | ||
|
||
## Dataflow | ||
|
||
```mermaid | ||
sequenceDiagram | ||
participant Simulator | ||
participant Viewer | ||
Simulator->>+Server: /update {user_id, sensor_id, distance } | ||
Server->>-Simulator: ok | ||
Prometheus->>+ Server: /metrics | ||
Server->>- Prometheus: data | ||
Viewer->>+ Prometheus: /api/v1/query { query, time } | ||
Prometheus->>- Viewer: data | ||
Grafana->>+ Prometheus: datasource | ||
Prometheus->>- Grafana: data | ||
``` | ||
|
||
## References | ||
|
||
- [Explanation of Triangle Localization](https://4rdp.blogspot.com/2008/05/gps.html) |