Skip to content

Commit

Permalink
doc: readme.
Browse files Browse the repository at this point in the history
  • Loading branch information
tsengyushiang committed May 5, 2024
1 parent bae78f6 commit b93939b
Show file tree
Hide file tree
Showing 2 changed files with 51 additions and 5 deletions.
56 changes: 51 additions & 5 deletions README.md
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)
Binary file added demo.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit b93939b

Please sign in to comment.