Files
duru_pcd_viewer/README.md
T
Dongubak 6d995dfe44 Add macOS build instructions
The .app bundle's binary doesn't auto-update on rebuild without tauri-cli
(not installed on the dev machine) — document the manual sync step so a
fresh clone doesn't hit the "changes aren't showing up" trap.
2026-08-22 02:22:02 +09:00

2.2 KiB

PCD Viewer — macOS 네이티브 빌드

FAST-LIVO2용 포인트 클라우드 뷰어(pcd_viewer.html, Three.js)를 Tauri 2로 감싼 macOS 앱. 빌드 없는 단일 HTML이 웹의 단일 소스이고, src-tauri/가 그걸 그대로 실어 네이티브 창으로 띄운다.

준비물

  • Rust 툴체인 (rustup 권장, src-tauri/Cargo.tomlrust-version 확인)
  • Xcode Command Line Tools (xcode-select --install)
  • cargo tauri(tauri-cli)는 필요 없음 — 아래는 raw cargo build만으로 진행하는 절차

빌드

git clone <this-repo> && cd duru_pcd_viewer
sh src-tauri/stage-web.sh          # pcd_viewer.html + vendor/ 를 src-tauri/web/ 로 스테이징
cd src-tauri
cargo build --release              # target/release/pcd-viewer (원시 실행 파일)

.app 번들(target/release/bundle/macos/PCD Viewer.app)이 이미 존재한다면(첫 빌드가 아니라면), cargo build --release만으로는 그 안의 바이너리가 갱신되지 않는다 — cargo tauri build(번들러)가 만드는 별개 산출물이기 때문. 재빌드할 때마다 아래로 동기화한다.

cp target/release/pcd-viewer \
  "target/release/bundle/macos/PCD Viewer.app/Contents/MacOS/pcd-viewer"

tauri-cli(cargo install tauri-cli --version "^2")가 있다면 cargo tauri build로 번들·서명까지 한 번에 처리할 수 있다(위 수동 동기화 불필요).

실행

open "target/release/bundle/macos/PCD Viewer.app"

.pcd 파일은 앱에 번들되어 있지 않다 — 창에 드래그해서 불러오는 구조가 의도된 설계다 (DEFAULT_URL이 404 나는 게 정상이며, 그때 드래그 안내로 자연스럽게 떨어진다).

코드를 고쳤다면

web/은 빌드 시점에 바이너리로 임베드되므로, pcd_viewer.html만 고쳐서는 네이티브 앱에 반영되지 않는다. 위 빌드 절차(stage-web.shcargo build --release → 바이너리 동기화)를 다시 밟아야 한다.

그 밖의 문서

  • PCD_Viewer_가이드.md — 사용법(측정/실시간 모니터링). 아직 vendoring·Tauri 반영 전 버전.
  • ROS2_이관_체크리스트.md — ROS2 이관 체크리스트.