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                                # 현재 설정 출력
uv run ros-tviewer version                               # 앱·의존성·런타임 리포트
  • q/Ctrl+C로 종료 (터미널 상태 자동 복구).
  • --compressed 미지정 시 토픽 타입을 자동 감지한다.
  • 설정 우선순위: CLI 플래그 > .env > config.toml > 기본값.

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), 플래그·설정 파싱
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.0.tar.gz (44.3 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.0-py3-none-any.whl (14.2 kB view details)

Uploaded Python 3

File details

Details for the file ros_tviewer-0.1.0.tar.gz.

File metadata

  • Download URL: ros_tviewer-0.1.0.tar.gz
  • Upload date:
  • Size: 44.3 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.0.tar.gz
Algorithm Hash digest
SHA256 714f13a5e99bd20669067cbb07ec66da6fda320f7ba8d3ccf22766616851549c
MD5 caa166277090129164a0590bd2a50a96
BLAKE2b-256 58ccffc9f5cf3b8ff7d64197c42e8321b00ce3fea5e7ccfac861c7a637f74589

See more details on using hashes here.

Provenance

The following attestation bundles were made for ros_tviewer-0.1.0.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.0-py3-none-any.whl.

File metadata

  • Download URL: ros_tviewer-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 14.2 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.0-py3-none-any.whl
Algorithm Hash digest
SHA256 b7e9efc531a542ad5ee2a7191331b7434b47607ec03594907c96fb31bf796c35
MD5 aa4aae9051a2fa08a3e877aee7722310
BLAKE2b-256 ae4d6df0f59b02c9816f4f0861d6a25e119bd755471fed67d6739ebd6e6dc369

See more details on using hashes here.

Provenance

The following attestation bundles were made for ros_tviewer-0.1.0-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

0.1.1

2 files

This release

0.1.0 This release

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