This commit is contained in:
33
README.md
33
README.md
@@ -1,22 +1,24 @@
|
||||
# Robot App Web (Test3)
|
||||
# Robot App Web (RBS)
|
||||
|
||||
Chức năng:
|
||||
- Đăng ký danh sách cảm biến LiDAR (tên, ip, port)
|
||||
- Đăng ký IMU (tên, frame_id, topic, nguồn) và pose trên robot
|
||||
- Kéo thả icon LiDAR/IMU trên canvas để set vị trí (robot frame)
|
||||
- Nhiều layout — mỗi layout lưu tại `data/models/{id}.json`; catalog trong `data/state.json`
|
||||
- Nhiều layout — mỗi layout lưu profile trong SQLite (`layout_profiles`); catalog trong document `state`
|
||||
- Database SQLite: `data/RBS.db` (WAL mode). Thư mục media: `data/maps/`, `data/sounds/`, `data/recordings/`
|
||||
|
||||
## Build
|
||||
|
||||
```bash
|
||||
cd /home/robotics/RD/Test3
|
||||
cd /home/robotics/RD/RBS
|
||||
# Ubuntu/Debian: sudo apt install libsqlite3-dev
|
||||
cmake -S . -B build
|
||||
cmake --build build -j
|
||||
```
|
||||
|
||||
## Run
|
||||
|
||||
Chạy mặc định port 8080, phục vụ static từ `www/`, dữ liệu ở `data/state.json`:
|
||||
Chạy mặc định port 8080, phục vụ static từ `www/`, dữ liệu SQLite tại `data/RBS.db`:
|
||||
|
||||
```bash
|
||||
./build/lidar_manager_web
|
||||
@@ -25,14 +27,29 @@ Chạy mặc định port 8080, phục vụ static từ `www/`, dữ liệu ở
|
||||
Hoặc chỉ định:
|
||||
|
||||
```bash
|
||||
./build/lidar_manager_web 8080 ./www ./data/state.json
|
||||
./build/lidar_manager_web 8080 ./www ./data/RBS.db
|
||||
```
|
||||
|
||||
Mở trình duyệt: `http://localhost:8080/`
|
||||
|
||||
### API Maps & Sounds (SQLite)
|
||||
|
||||
| Method | Endpoint | Mô tả |
|
||||
|--------|----------|-------|
|
||||
| GET | `/api/maps` | Danh sách map |
|
||||
| POST | `/api/maps` | Tạo map (JSON metadata) |
|
||||
| GET/PUT/DELETE | `/api/maps/{id}` | CRUD map |
|
||||
| GET/POST | `/api/maps/{id}/image` | Tải/xem ảnh map (file trong `data/maps/{id}/`) |
|
||||
| GET | `/api/sounds` | Danh sách sound |
|
||||
| POST | `/api/sounds` | Tạo sound |
|
||||
| GET/PUT/DELETE | `/api/sounds/{id}` | CRUD sound |
|
||||
| GET/POST | `/api/sounds/{id}/file` | Tải/upload file âm thanh |
|
||||
| GET/PUT | `/api/dashboards` | Dashboard (server-side, thay localStorage) |
|
||||
| GET | `/api/recordings` | Stub — trả về `[]` (Phase sau) |
|
||||
|
||||
### Đăng nhập (Signing in — MiR §2.1)
|
||||
|
||||
Trang web **bắt buộc đăng nhập**. Hai tab: tên/mật khẩu hoặc **Mã PIN** (keypad 4 số). Tài khoản mặc định (`data/auth.json`):
|
||||
Trang web **bắt buộc đăng nhập**. Hai tab: tên/mật khẩu hoặc **Mã PIN** (keypad 4 số). Tài khoản mặc định (trong `data/RBS.db`, seed lần đầu):
|
||||
|
||||
| User | Password | Nhóm |
|
||||
|------|----------|------|
|
||||
@@ -50,7 +67,7 @@ Tài liệu đầy đủ: [`docs/Reference_guide.md` §2.1](docs/Reference_guide
|
||||
Mô phỏng cấu hình controller tối thiểu SICK (Dual-Core, 4 GB) trên máy dev:
|
||||
|
||||
```bash
|
||||
cd /home/robotics/RD/Test3
|
||||
cd /home/robotics/RD/RBS
|
||||
./scripts/lm.sh docker up
|
||||
# hoặc: sudo docker compose up --build -d
|
||||
```
|
||||
@@ -93,7 +110,7 @@ cat /proc/meminfo | head
|
||||
Chạy toàn bộ: unit C++ (GTest), API smoke (`curl`), pytest integration.
|
||||
|
||||
```bash
|
||||
cd /home/robotics/RD/Test3
|
||||
cd /home/robotics/RD/RBS
|
||||
chmod +x scripts/lm.sh scripts/test/*.sh
|
||||
./scripts/lm.sh test run
|
||||
```
|
||||
|
||||
Reference in New Issue
Block a user