C2-151 commited on
Commit
828dac5
·
1 Parent(s): 8c7a278
.github/wgm-hive.yml ADDED
@@ -0,0 +1,2 @@
 
 
 
1
+ # WGM Hive Growth Loop Consent configuration
2
+ consent: true
Dockerfile CHANGED
@@ -15,8 +15,10 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
15
  libgl1 \
16
  libglib2.0-0 \
17
  git \
 
18
  python3-tk \
19
  tk-dev \
 
20
  && rm -rf /var/lib/apt/lists/*
21
 
22
  # Copy file requirements.txt trước để tận dụng cache Docker
 
15
  libgl1 \
16
  libglib2.0-0 \
17
  git \
18
+ git-lfs \
19
  python3-tk \
20
  tk-dev \
21
+ && git lfs install \
22
  && rm -rf /var/lib/apt/lists/*
23
 
24
  # Copy file requirements.txt trước để tận dụng cache Docker
development_logs/2026-07-08_13-03-02_reapply-cors-lfs-fixes.md ADDED
@@ -0,0 +1,32 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Nhật ký phát triển (Development Log) - 2026-07-08 13:03:02
2
+
3
+ ## Yêu cầu của người dùng
4
+ Chạy `/wgm` để kiểm tra xem các lỗi trước đó (không tải được LFS, lỗi CORS khi hiển thị texture trên Hugging Face, và lỗi nút Reset Scene không cập nhật giao diện) có bị tái diễn trong phiên bản hiện tại của kho lưu trữ (repository) hay không. Nếu có, thực hiện sửa lại.
5
+
6
+ ## Phạm vi và giả định
7
+ - Xác nhận các sửa đổi trong phiên làm việc trước (ngày 4 tháng 7 năm 2026) đã bị hoàn tác (reverted) bởi các commit gần đây.
8
+ - Khôi phục lại các đoạn mã sửa lỗi mà không làm ảnh hưởng đến các logic tính năng mới đã được phát triển thêm.
9
+
10
+ ## File đã thêm/sửa/xóa
11
+ - **Sửa:**
12
+ - [Dockerfile](file:///c:/users/admin/Robot/Dockerfile)
13
+ - [frontend/app.js](file:///c:/users/admin/Robot/frontend/app.js)
14
+ - [frontend/interactive_server.py](file:///c:/users/admin/Robot/frontend/interactive_server.py)
15
+ - **Thêm:**
16
+ - [development_logs/2026-07-08_13-03-02_reapply-cors-lfs-fixes.md](file:///c:/users/admin/Robot/development_logs/2026-07-08_13-03-02_reapply-cors-lfs-fixes.md)
17
+
18
+ ## Hành vi trước và sau
19
+ - **Trước khi sửa:**
20
+ - Thiếu `git-lfs` trong Dockerfile khiến các file OBJ/MTL của PyBullet Objects Model biến thành pointer (lỗi không vẽ được đồ vật).
21
+ - Không có header phân giải CORS (`CORSMiddleware`) ở backend và frontend, khiến WebGL chặn nạp texture đồ vật (tất cả robot và đồ vật bị đen xì).
22
+ - Lỗi Nút Reset: Tính năng gửi `init_payload` để giao diện đồng bộ reset scene đã được bạn tích hợp trong commit mới nhất nên **không bị lỗi**.
23
+ - **Sau khi sửa:**
24
+ - Đã bổ sung lại cài đặt `git-lfs` vào Dockerfile.
25
+ - Khôi phục lại cấu hình CORS `setCrossOrigin` ở frontend và `CORSMiddleware` ở backend.
26
+
27
+ ## Lệnh kiểm tra và kết quả
28
+ - `python -m py_compile frontend/interactive_server.py` biên dịch thành công.
29
+ - `git diff` phản ánh chính xác nội dung thay đổi đúng như trước đó.
30
+
31
+ ## Tính năng hiện có đã được bảo toàn
32
+ - Toàn bộ các tính năng WebRTC, TTS, Speech, LLM Agents và nhiều môi trường (environments) mới bạn vừa bổ sung trong các commit gần đây đều được bảo toàn nguyên vẹn.
frontend/__pycache__/interactive_server.cpython-310.pyc CHANGED
Binary files a/frontend/__pycache__/interactive_server.cpython-310.pyc and b/frontend/__pycache__/interactive_server.cpython-310.pyc differ
 
frontend/app.js CHANGED
@@ -12,6 +12,7 @@ let eeDummy = null;
12
  let placementSurfaceZ = 0.3;
13
  const OBJ_LOADER = new THREE.OBJLoader();
14
  const MTL_LOADER = new THREE.MTLLoader();
 
15
  let socket = null;
16
  let currentPrompt = '';
17
  const runtimeClientId = localStorage.getItem('llm-panda-client-id') || crypto.randomUUID();
 
12
  let placementSurfaceZ = 0.3;
13
  const OBJ_LOADER = new THREE.OBJLoader();
14
  const MTL_LOADER = new THREE.MTLLoader();
15
+ MTL_LOADER.setCrossOrigin('anonymous');
16
  let socket = null;
17
  let currentPrompt = '';
18
  const runtimeClientId = localStorage.getItem('llm-panda-client-id') || crypto.randomUUID();
frontend/interactive_server.py CHANGED
@@ -34,7 +34,15 @@ _logger_setup.setup()
34
  from frontend.web_runtime import WebRuntime
35
  import pybullet_data
36
  from pybullet_object_models import ycb_objects
 
37
  app = FastAPI(title="LLM-Panda Web-Embedded PyBullet Simulation")
 
 
 
 
 
 
 
38
  # Serve static files from the frontend directory itself
39
  static_dir = os.path.dirname(__file__)
40
  app.mount("/static", StaticFiles(directory=static_dir), name="static")
 
34
  from frontend.web_runtime import WebRuntime
35
  import pybullet_data
36
  from pybullet_object_models import ycb_objects
37
+ from fastapi.middleware.cors import CORSMiddleware
38
  app = FastAPI(title="LLM-Panda Web-Embedded PyBullet Simulation")
39
+ app.add_middleware(
40
+ CORSMiddleware,
41
+ allow_origins=["*"],
42
+ allow_credentials=True,
43
+ allow_methods=["*"],
44
+ allow_headers=["*"],
45
+ )
46
  # Serve static files from the frontend directory itself
47
  static_dir = os.path.dirname(__file__)
48
  app.mount("/static", StaticFiles(directory=static_dir), name="static")