Skip to main content

Kinematics/geometric primitives

Project description

This is the Kinematics/Geometric primitives Python package.

This project provides some types and functions to represent entities like rigid bodies, frames, points, rigid motions.

Most of the types are purely symbolic placeholders, and are meant to be used for building models, with Python.

The ct package contains facilities to model coordinate-transforms, and also to get concrete matrix representations.

Code documentation

API and package documentation is hosted here.

The HTML docs are generated from the docstrings in the source code, using pdoc.

You can generate the docs offline from your working copy, with something like:

cd src/
pdoc --no-show-source -o /tmp/docs kgprim/ motiondsl/

Installation

pip install kgprim

To install from source (usually more up-to-date than the PyPi package):

git clone <repo> kgprim    # replace <repo> with the right URL
cd kgprim/
pip install .              # should also fetch and install the dependencies

Before doing the above, you might want to set up a Python3 virtual environment:

mkdir myvenv && python3 -m venv myvenv
source myvenv/bin/activate  # may need to pick another script depending on your shell

Dependencies

Python > 3.3

Python packages:

  • NetworkX

  • SymPy, for the representation of variables, parameters and constants in the values module. Also for the symbolic matrix representation of coordinate transforms.

  • NumPy, for the numerical matrix representation of coordinate transforms.

  • textX, for the grammar of the MotionDSL language (required by the motiondsl package only).

Testing

Testing code is based on the unittest framework from the standard library. After installation (see above), one may run all the tests with something like:

python -m unittest discover --start-directory test/ --pattern '*.py'

The test modules can also be executed individually, e.g.:

python test/ct/testcore.py

# or
python -m test.ct.testcore

# or
python -m unittest test.ct.testcore

The module test/ct/testcore.py is a test suite for the kgprim.ct package which indirectly also covers the kgprim.motions module.

Similarly, the test/values.py performs some simple tests on the types defined in the kgprim.values module.

The package test/motiondsl has tests for the motiondsl package, though it may also involve kgprim.ct.

License

Copyright 2020-2024, Marco Frigerio

Distributed under the BSD 3-clause license. See the LICENSE file for more details.

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

kgprim-0.1.2.tar.gz (24.4 kB view details)

Uploaded Source

Built Distribution

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

kgprim-0.1.2-py3-none-any.whl (28.8 kB view details)

Uploaded Python 3

File details

Details for the file kgprim-0.1.2.tar.gz.

File metadata

  • Download URL: kgprim-0.1.2.tar.gz
  • Upload date:
  • Size: 24.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.8

File hashes

Hashes for kgprim-0.1.2.tar.gz
Algorithm Hash digest
SHA256 1b3d57f9e862b4db72c0e9b4abd4d9ff24ae53460a70d40860d44153d48f19d3
MD5 53652dff204d67506a69248022d163cf
BLAKE2b-256 a32e07bf2c3dd7110e7596dfca3690ba8a90788ab9ef7231c68af024ff368c44

See more details on using hashes here.

File details

Details for the file kgprim-0.1.2-py3-none-any.whl.

File metadata

  • Download URL: kgprim-0.1.2-py3-none-any.whl
  • Upload date:
  • Size: 28.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.8

File hashes

Hashes for kgprim-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 4bc57e0ffe3cc55be8d4a9f6940a1ebeb62da5f9dae2fb5204f124958c9fc4d8
MD5 55ce8f2e2fba406bdc38d4ba0c9dfbb2
BLAKE2b-256 8d48b767c7a826c495f71234928a42a93da34e2902e0459a2386c1d7df69e7ba

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