Skip to content

apirrone/frames_viewer_rs

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

frames_viewer_rs

A fast OpenGL-based 6D frames viewer with Python bindings.

This is a re-implementation of https://github.com/apirrone/FramesViewer in rust with python bindings. Absolutely everything has been done by Cursor editor (https://www.cursor.com/) with Claude 3.5 sonnet

Requirements

System Dependencies

  • Python >= 3.7
  • Rust toolchain (install via rustup)
  • OpenGL development libraries
# Ubuntu/Debian
sudo apt-get install libgl1-mesa-dev

# Fedora
sudo dnf install mesa-libGL-devel

# Arch Linux
sudo pacman -S mesa

Python Dependencies

  • numpy
  • setuptools >= 64
  • setuptools-rust >= 1.5.2
  • wheel

Installation

# Create and activate a virtual environment (optional but recommended)
python -m venv venv
source venv/bin/activate  # or `vf new frames_viewer_rs` if using virtualfish

# Install the package
pip install -e .

Usage

from frames_viewer import Viewer
import numpy as np
import time

# Create and start the viewer
fv = Viewer()
fv.start()  # pops the viewer window in a separate thread

# Create a transformation matrix (4x4)
frame1 = np.eye(4, dtype=np.float32)
frame1[:3, 3] = [0.0, 0.1, 0.1]  # position in meters

try:
    while True:
        # Animate the frame
        frame1[:3, 3][0] = 0.1 * np.sin(2 * np.pi * 1.0 * time.time())
        
        # Push the frame to the viewer
        fv.push_frame(frame1, "frame1")
        
        time.sleep(0.01)
except KeyboardInterrupt:
    fv.stop()

Features

  • Real-time visualization of multiple coordinate frames
  • Metric units (meters)
  • Smooth animations
  • Interactive camera controls:
    • Left mouse button: Orbit
    • Middle mouse button: Pan
    • Mouse wheel: Zoom
  • Grid visualization in XY, XZ, and YZ planes with 10cm spacing
  • Color-coded axes (Red: X, Green: Y, Blue: Z)

Development

To contribute to the project:

# Clone the repository
git clone https://github.com/apirrone/frames_viewer_rs.git
cd frames_viewer_rs

# Create a virtual environment
python -m venv venv
source venv/bin/activate  # or use virtualfish

# Install in development mode
pip install -e .

License

MIT

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published