78 lines
1.6 KiB
Markdown
78 lines
1.6 KiB
Markdown
# LiDAR Manager Web (Test3)
|
|
|
|
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`
|
|
|
|
## Build
|
|
|
|
```bash
|
|
cd /home/robotics/RD/Test3
|
|
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`:
|
|
|
|
```bash
|
|
./build/lidar_manager_web
|
|
```
|
|
|
|
Hoặc chỉ định:
|
|
|
|
```bash
|
|
./build/lidar_manager_web 8080 ./www ./data/state.json
|
|
```
|
|
|
|
Mở trình duyệt: `http://localhost:8080/`
|
|
|
|
## Docker (giới hạn 2 CPU, 4 GB RAM)
|
|
|
|
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
|
|
sudo docker compose up --build -d
|
|
# hoặc: sudo ./scripts/docker-up.sh
|
|
```
|
|
|
|
Kiểm tra giới hạn:
|
|
|
|
```bash
|
|
sudo ./scripts/docker-stats.sh
|
|
```
|
|
|
|
Dừng:
|
|
|
|
```bash
|
|
sudo docker compose down
|
|
```
|
|
|
|
Dữ liệu layout vẫn lưu tại `data/` trên host (volume mount).
|
|
|
|
Kiểm tra tài nguyên trong container:
|
|
|
|
```bash
|
|
# Vào shell container
|
|
sudo docker exec -it lidar-manager-limited bash
|
|
# hoặc: sudo ./scripts/docker-shell.sh
|
|
|
|
# Trong container, thử:
|
|
htop # CPU/RAM (q để thoát)
|
|
free -h # RAM
|
|
nproc # số CPU nhìn thấy
|
|
ps aux # process
|
|
cat /proc/meminfo | head
|
|
```
|
|
|
|
```bash
|
|
# htop / stats từ ngoài (không cần vào shell)
|
|
sudo ./scripts/docker-htop.sh
|
|
sudo ./scripts/docker-stats.sh
|
|
```
|
|
|