Skip to main content

ros-tviewer

CI PyPI Python License: MIT

ROS 2 카메라 토픽을 터미널에서 재생하는 CLI 뷰어.

sensor_msgs/msg/Imagesensor_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 $COLORTERMtruecolor/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 > cwd config.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

기여 및 보안

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

ros_tviewer-0.1.1.tar.gz (50.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

ros_tviewer-0.1.1-py3-none-any.whl (18.5 kB view details)

Uploaded Python 3

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

Hashes for ros_tviewer-0.1.1.tar.gz
Algorithm Hash digest
SHA256 74afe7d04de585411bc7bada5444f142899e43ba8f80b32f9728264744797359
MD5 f59e53f8ddc6c1727ab02d6a2132cdcf
BLAKE2b-256 37851fa20228f22bd576867cebe50dba6803916f71cbae9db6a283c7bc040791

See more details on using hashes here.

Provenance

The following attestation bundles were made for ros_tviewer-0.1.1.tar.gz:

Publisher: publish.yml on wkqco33/ros_tviewer

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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

Hashes for ros_tviewer-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 f7be80af151bf3b5dafe00fed9601763aed58c6580422220aab985bf3a59dcf5
MD5 acd642f269068c9f87567e518b2c804f
BLAKE2b-256 41c39bf51dd97ce17d89fe369d3ab9ce12820ded5b9ea81ad42525fecb23860a

See more details on using hashes here.

Provenance

The following attestation bundles were made for ros_tviewer-0.1.1-py3-none-any.whl:

Publisher: publish.yml on wkqco33/ros_tviewer

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Release history Release notifications | RSS feed

This release

0.1.1 This release

2 files

0.1.0

2 files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page