Metadata-Version: 2.4
Name: gafropy
Version: 2.0.0
Summary: Python bindings for the GAFRO geometric-algebra robotics library
Keywords: geometric-algebra,conformal-geometric-algebra,robotics,kinematics,gafro
Author: Tobias Loew
License-Expression: MPL-2.0
License-File: LICENSE
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: Intended Audience :: Science/Research
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: C++
Classifier: Topic :: Scientific/Engineering
Classifier: Topic :: Scientific/Engineering :: Mathematics
Classifier: Operating System :: POSIX :: Linux
Project-URL: Homepage, https://gitlab.com/tloew/gafropy
Project-URL: Repository, https://gitlab.com/tloew/gafropy
Project-URL: GAFRO (C++), https://gitlab.com/gafro/gafro
Requires-Python: >=3.9
Requires-Dist: numpy>=1.23
Requires-Dist: mujoco>=3.0
Provides-Extra: viz
Requires-Dist: viser>=0.2; extra == "viz"
Requires-Dist: trimesh>=4.0; extra == "viz"
Description-Content-Type: text/markdown

# gafropy

Python bindings for the [GAFRO](https://gitlab.com/gafro/gafro) geometric-algebra library.

`gafropy` mirrors the binding surface exposed by
[`gafrojs`](https://gitlab.com/tloew/gafrojs): one Python class per concrete
C++ wrapper, with no template variants or operator overloads. The intent is to
expose CGA primitives (Point, Vector, Rotor, Translator, Motor, Line, Plane,
Sphere, Circle, PointPair, FlatPoint, DirectionVector, TangentVector, Dilator,
Transversion) and the robot ``System`` (loaded from URDF/MJCF/YAML) in an
ergonomic Python API.

Visualization-specific methods (anything tied to three.js in `gafrojs`) are
not bound. Methods that return arrays/matrices return `numpy.ndarray`.

## Install (from source)

```bash
pip install -v .
```

The build pulls `gafro`, `gafro_robot_descriptions`, `eigen3`, `yaml-cpp`,
`tinyxml2`, `behemoth` and `sackmesser` via CMake `FetchContent`, the same way
`gafrojs` does.

## Usage

```python
import gafropy as ga

p = ga.Point(1.0, 0.0, 0.0)
r = ga.Rotor.from_angle_axis(0.5, 0.0, 0.0, 1.0)
t = ga.Translator(0.0, 0.0, 0.1)
m = ga.Motor(r, t)
p2 = p.apply(m)
print(p2.to_array())   # numpy.ndarray, shape (3,)
```
