Skip to content

Latest commit

 

History

History
92 lines (63 loc) · 2.48 KB

readme.md

File metadata and controls

92 lines (63 loc) · 2.48 KB

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

More information about the packages and the modules of this project is available in the docstrings.

You can generate e.g. html documentation using pdoc. For example:

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

Installation

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.