Metadata-Version: 2.4
Name: rigeo
Version: 0.2.0
Summary: Rigid body geometry and inertial parameters.
Author-email: Adam Heins <mail@adamheins.com>
License: MIT
License-File: LICENSE
Requires-Python: >=3.8
Requires-Dist: cvxpy[mosek]!=1.5.0,!=1.5.1,!=1.5.2,!=1.5.3,!=1.5.4,>=1.4.2
Requires-Dist: numpy>=1.23.0
Requires-Dist: pycddlib<3.0.0,>=2.1.6
Requires-Dist: scipy>=1.10.0
Requires-Dist: tqdm>=4.67.1
Description-Content-Type: text/markdown

# rigeo: rigid body geometry

Rigeo is a prototyping library for rigid body geometry in Python: it combines
three-dimensional geometry with the inertial properties of rigid bodies, with
applications to robotic manipulation.

## Density Realizable Inertial Parameters

One of the main features of this library is a set of necessary conditions for
**density realizability** on 3D shapes based on moment relaxations (see [this
paper](https://arxiv.org/abs/2411.07079) for more information). A set of
inertial parameters (i.e., mass, center of mass, inertia matrix) is called
*density realizable* on a given shape if it can be physically realized by
*some* rigid body contained in that shape. These conditions can be included as
constraints in semidefinite programs for inertial parameter identification or
for checking robustness to inertial parameter uncertainty.

## Other Features

* Build rigid bodies out of flexible shape primitives: convex polyhedra,
  ellipsoids, and cylinders.
* Obtain the intersection of two convex polyhedra (via
  [cdd](https://pycddlib.readthedocs.io)). This is particularly useful for
  obtaining contact patches between polyhedral objects for manipulation; e.g.,
  when [solving the waiter's problem](https://arxiv.org/abs/2305.17484)
* Obtain the distance between primitive shapes using convex programming.
* Compute maximum-volume inscribed and minimum-volume bounding ellipsoids for
  sets of points.
* Compute convex hulls for degenerate sets of points (i.e., points that live in
  some lower-dimensional subspace than the ambient space).
* Uniform random sampling inside of and on the surface of ellipsoids.

## Installation

The library requires Python >=3.8. It has been tested on Ubuntu 20.04 and
24.04. Optimization problems use [cvxpy](https://www.cvxpy.org/); MOSEK is
installed by default and is used as the solver for the tests. Academic licenses
for MOSEK can be obtained for free. If this is not an option for you, Clarabel
is a reasonable open-source alternative.

From pip:
```
pip install rigeo
```

From source (using [uv](https://docs.astral.sh/uv/)):
```
git clone https://github.com/utiasDSL/rigeo
cd rigeo
uv venv
uv sync
```

From source (using pip):
```
git clone https://github.com/utiasDSL/rigeo
cd rigeo
python -m pip install .
```

## Development

Tests are run using pytest:
```
cd tests
python -m pytest .
```

To test against different Python versions, use:
```
# for example
uv run --isolated --python=3.9 pytest
```

## License

MIT - see the LICENSE file.
