Skip to main content

Trafolib: a Python framework for handling transformations in 2D and 3D

Project description

Trafolib

Pipeline Status Coverage

The use of 2D and 3D rigid body transformations is common in fields such as robotics and computer vision. This package provides two classes, Trafo2d and Trafo3d, to handle all different representations, such as homogeneous matrices, quaternions, and various flavors of Euler angles. All classes are well tested and documented. The library has few external dependencies and can be easily used in any project requiring transformation computations.

Features

  • Class representations for 2D and 3D rigid body transformations
  • Conversions from/to rotation matrices, homogeneous matrices, RPY angles, Euler angles, quaternions and Rodrigues vectors
  • Inversion and concatenation of transformations
  • Transformation of points
  • Save to dictionary/JSON, load from dictionary/JSON
  • Interpolations of transformations
  • Averaging and distance computations
  • Visualizations in Matplotlib
  • Very well tested in unit tests and various projects
  • Permissive License (MIT), code can be used in commercial software

Requirements

All dependencies are declared in pyproject.toml.

Installation

It is strongly recommended to use a virtual environment.

For Users (Runtime Only)

This will install the core libraries needed to run Trafolib, without any development tools or tests.

pip install trafolib

2. For Developers

This installation is for contributors who want to run tests or modify the code.

  1. Clone the repository:

    git clone https://gitlab.com/proebrock/trafolib.git
    cd trafolib
    
  2. Create a virtual environment (recommended):

    python -m venv .venv
    source .venv/bin/activate  # Linux / macOS
    .venv\Scripts\activate     # Windows
    
  3. Install the project with development extras:

    pip install -e ".[dev]"
    
  4. Run ruff:

    • As a linter:
      ruff check
      
    • As a formatter:
      ruff format
      
  5. Run all tests:

    pytest
    

About me and the project

My name is Philipp Roebrock and I work as a lecturer at the Institute for Photonics and Robotics at the University of Applied Sciences of the Grisons FHGR in Chur in Switzerland.

If you have any questions or suggestions please drop and issue or a personal message to philipp DOT roebrock AT fhgr DOT ch.

Project details


Download files

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

Source Distribution

trafolib-1.0.0.tar.gz (23.4 kB view details)

Uploaded Source

Built Distribution

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

trafolib-1.0.0-py3-none-any.whl (17.3 kB view details)

Uploaded Python 3

File details

Details for the file trafolib-1.0.0.tar.gz.

File metadata

  • Download URL: trafolib-1.0.0.tar.gz
  • Upload date:
  • Size: 23.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.2.0 CPython/3.12.13

File hashes

Hashes for trafolib-1.0.0.tar.gz
Algorithm Hash digest
SHA256 76823ba9ff6e48e4fe4dd47af228517f23e8c46797d2f3ca2dcef2ea7e297e2b
MD5 ad20394c5c63ea7f14468b133805c030
BLAKE2b-256 8bab065bbbf376215e90705d679cb04811df361bef68ae8a4e36cf21bd90302a

See more details on using hashes here.

File details

Details for the file trafolib-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: trafolib-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 17.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.2.0 CPython/3.12.13

File hashes

Hashes for trafolib-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 8d816dc00626c981fbbe3b2f74cfa9c7742d92baedf68bcbefcc0f8f07c54360
MD5 1813ed45b3bd78b3d9e4b1e0dde7824f
BLAKE2b-256 6fe225438f61297201d12f14e83ee9cb9008f15badd62c16cee882afedcac8a6

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page