ros-tviewer
ROS 2 카메라 토픽을 터미널에서 재생하는 CLI 뷰어.
sensor_msgs/msg/Image 및 sensor_msgs/msg/CompressedImage 토픽을
tcamviewer의 Half-Block TrueColor(24-bit ANSI) 렌더러로
터미널에 실시간(30~60+ FPS) 재생한다.
uv run ros-tviewer play /camera/image_raw
▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
요구 사항
| 항목 | 설명 |
|---|---|
| OS | Linux |
| Python | 3.12 (ROS 2 Jazzy ABI 매칭) |
| ROS 2 | Jazzy/Humble (rclpy는 시스템 ROS에서 로드 — pip 설치 불가) |
| 빌드 도구 | cmake, FFmpeg dev 라이브러리 (libavcodec-dev 등) — tcamviewer sdist 빌드용 |
| 터미널 | TrueColor 지원 (echo $COLORTERM → truecolor/24bit) |
시작하기
설치
# uv tool (권장)
uv tool install ros-tviewer
# 또는 pipx / pip
pipx install ros-tviewer
pip install ros-tviewer
PyPI 배포 전 개발 트리에서는 저장소 클론 후 실행한다:
개발 트리에서 실행
uv sync
# 1) 광고 중인 카메라 토픽 확인
uv run ros-tviewer topics
# 2) 재생 (ROS 환경 미 source 시 자동 감지·재실행)
source /opt/ros/jazzy/setup.bash # 권장 — 미실행 시 자동 부트스트랩이 시도됨
uv run ros-tviewer play /camera/image_raw
# 옵션 예시
uv run ros-tviewer play /camera/image_raw/compressed --fps 30 --rotate 90 --stretch
uv run ros-tviewer play /camera/image_raw --frames 100 # 100 프레임 렌더 후 종료 (테스트/데모)
uv run ros-tviewer config # 현재 설정 출력 (= config show)
uv run ros-tviewer config init # 플랫폼 사용자 설정 파일 생성
uv run ros-tviewer config set camera.fps 60 # 사용자 설정 파일에 저장
uv run ros-tviewer config path # 설정 파일 후보 경로 표시
uv run ros-tviewer version # 앱·의존성·런타임 리포트
q/Ctrl+C로 종료 (터미널 상태 자동 복구).--compressed미지정 시 토픽 타입을 자동 감지한다.- 설정 우선순위: CLI 플래그 >
.env> cwdconfig.toml> 사용자config.toml> 기본값. - 설정 파일 후보: cwd
./config.toml+ 플랫폼별 사용자 경로의config.toml(Linux:~/.config/ros-tviewer/, macOS:~/Library/Application Support/ros-tviewer/, Windows:%APPDATA%\\ros-tviewer/). uvx로 임의 디렉터리에서 실행해도 사용자 경로 설정이 유지된다.--config/-c플래그가 지정되면 최우선으로 로드되며,config init/config set의 저장 대상도 된다.
E2E 테스트
uv run pytest # 단위 테스트 (ROS 미설치 환경에서도 실행 가능, ROS 테스트는 skip)
bash tests/e2e.sh # 더미 퍼블리셔 → play 60프레임 데모
uv run pytest tests/test_ros2_e2e.py -v # 실제 rclpy 구독 + 렌더 E2E
구성
| 모듈 | 책임 |
|---|---|
main.py |
wpycli 커맨드 (play/topics/config), 플래그·설정 파싱 |
config_io.py |
TOML 읽기/쓰기 헬퍼 (config init/set가 사용, rclpy 무의존) |
ros_env.py |
rclpy 부트스트랩 (시스템 ROS 탐지 → sys.path 주입 → re-exec) |
node.py |
구독(QoS sensor_data), 최신 메시지 유지(drop), FPS 스로틀, 렌더 직전 변환 루프 |
convert.py |
Image/CompressedImage → RGB24 numpy (numpy/opencv만 사용, cv_bridge 없이) |
개발
- 아키텍처·TDD 규칙·컨벤션: AGENTS.md — 코드 변경 전 필독.
- 린트:
uv run ruff check . - 타입 체크:
uvx pyright --project . - 테스트:
uv run pytest
기여 및 보안
- 기여 방법: CONTRIBUTING.md
- 취약점 보고: SECURITY.md — 공개 이슈로 보고하지 마세요.
- 변경 이력: CHANGELOG.md
- 라이선스: MIT
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file ros_tviewer-0.1.1.tar.gz.
File metadata
- Download URL: ros_tviewer-0.1.1.tar.gz
- Upload date:
- Size: 50.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
74afe7d04de585411bc7bada5444f142899e43ba8f80b32f9728264744797359
|
|
| MD5 |
f59e53f8ddc6c1727ab02d6a2132cdcf
|
|
| BLAKE2b-256 |
37851fa20228f22bd576867cebe50dba6803916f71cbae9db6a283c7bc040791
|
Provenance
The following attestation bundles were made for ros_tviewer-0.1.1.tar.gz:
Publisher:
publish.yml on wkqco33/ros_tviewer
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
ros_tviewer-0.1.1.tar.gz -
Subject digest:
74afe7d04de585411bc7bada5444f142899e43ba8f80b32f9728264744797359 - Sigstore transparency entry: 2766537274
- Sigstore integration time:
-
Permalink:
wkqco33/ros_tviewer@5151cf3349b945ec4e486be753d2f810ab0574ae -
Branch / Tag:
refs/tags/v0.1.1 - Owner: https://github.com/wkqco33
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@5151cf3349b945ec4e486be753d2f810ab0574ae -
Trigger Event:
release
-
Statement type:
File details
Details for the file ros_tviewer-0.1.1-py3-none-any.whl.
File metadata
- Download URL: ros_tviewer-0.1.1-py3-none-any.whl
- Upload date:
- Size: 18.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f7be80af151bf3b5dafe00fed9601763aed58c6580422220aab985bf3a59dcf5
|
|
| MD5 |
acd642f269068c9f87567e518b2c804f
|
|
| BLAKE2b-256 |
41c39bf51dd97ce17d89fe369d3ab9ce12820ded5b9ea81ad42525fecb23860a
|
Provenance
The following attestation bundles were made for ros_tviewer-0.1.1-py3-none-any.whl:
Publisher:
publish.yml on wkqco33/ros_tviewer
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
ros_tviewer-0.1.1-py3-none-any.whl -
Subject digest:
f7be80af151bf3b5dafe00fed9601763aed58c6580422220aab985bf3a59dcf5 - Sigstore transparency entry: 2766537424
- Sigstore integration time:
-
Permalink:
wkqco33/ros_tviewer@5151cf3349b945ec4e486be753d2f810ab0574ae -
Branch / Tag:
refs/tags/v0.1.1 - Owner: https://github.com/wkqco33
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@5151cf3349b945ec4e486be753d2f810ab0574ae -
Trigger Event:
release
-
Statement type: