{"id":18439411,"url":"https://github.com/idiap/pygafro","last_synced_at":"2026-01-08T17:20:26.958Z","repository":{"id":231269147,"uuid":"772593356","full_name":"idiap/pygafro","owner":"idiap","description":"PyGAFRO: geometric algebra for robotics in Python","archived":false,"fork":false,"pushed_at":"2024-12-16T10:51:42.000Z","size":108,"stargazers_count":8,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-03-23T01:01:44.483Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/idiap.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSES/GPL-3.0-only.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-03-15T13:57:35.000Z","updated_at":"2025-03-17T09:19:38.000Z","dependencies_parsed_at":"2024-04-03T08:26:08.174Z","dependency_job_id":"fe1201e8-92fa-4001-b78b-3bb531fa3706","html_url":"https://github.com/idiap/pygafro","commit_stats":null,"previous_names":["idiap/pygafro"],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/idiap%2Fpygafro","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/idiap%2Fpygafro/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/idiap%2Fpygafro/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/idiap%2Fpygafro/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/idiap","download_url":"https://codeload.github.com/idiap/pygafro/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247732679,"owners_count":20986901,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-06T06:24:41.541Z","updated_at":"2025-10-26T02:32:29.235Z","avatar_url":"https://github.com/idiap.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003c!--\n SPDX-FileCopyrightText: Copyright © 2024 Idiap Research Institute \u003ccontact@idiap.ch\u003e\n\n SPDX-FileContributor: Philip Abbet \u003cphilip.abbet@idiap.ch\u003e\n\n SPDX-License-Identifier: MPL-2.0\n--\u003e\n\n\n# Geometric Algebra For RObotics in Python\n\nThis library provides a geometric algebra tools targeted towards robotics applications.\nIt includes various computations for the kinematics and dynamics of serial manipulators\nas well as optimal control.\n\nIt is based on *gafro*, a C++ library relying on templates to efficiently implement the\ngeometric algebra operations.\n\n**Note that only the Conformal Geometric Algebra part of *gafro* is available in *pygafro***.\n\nPlease visit https://gitlab.com/gafro in order to find the entire *gafro* software stack.\n\n## Installation using pip (pre-compiled binaries)\n\n\tpip install pygafro\n\nWheels for Linux (x64_86 \u0026 arm64) and MacOS (arm64) are available (for Python 3.8 to 3.13).\n\nFor other platforms, *pygafro* is compiled from sources.\n\nShould you want to have access to mesh and texture files for the robots, you can install the\noptional package *pygafro-assets* by running either one of those commands:\n\n\tpip install pygafro-assets\n\tpip install pygafro[assets]\n\nNote that *pygafro* doesn't provide any rendering functions, it only indicates which mesh file\nto use for each link.\n\n## Installation using pip (compilation from sources)\n\nDue to the template-based nature of *gafro* (see **Differences between *gafro* and *pygafro***\nbelow), the compilation of pygafro can take a long time. Additionally, **using ```clang```\ninstead of ```gcc```** is highly recommended: ```gcc``` requires more memory resources when\ncompiling *pygafro*, which can become problematic on lower-end computers.\n\n### Using the default compiler of your computer\n\n\tpip install pygafro\n\n### Forcing the usage of *clang*\n\n(assuming that ```clang``` is installed at ```/usr/bin/clang```)\n\n\texport CC=/usr/bin/clang\n\texport CXX=/usr/bin/clang++\n\tpip install pygafro\n\n## Installation with ROS2\n\nAdd PyGafro in your colcon workspace and build it with:\n\n\tCC=clang CXX=clang++ USE_COLCON=1 colcon build\n\n## Installation from source\n\n(works either in a **conda** or **virtual environment**)\n\nRequirements:\n\n* ```numpy```\n\nDue to the template-based nature of *gafro* (see **Differences between *gafro* and *pygafro***\nbelow), the compilation of pygafro can take a long time. Additionally, **using ```clang```\ninstead of ```gcc```** is highly recommended: ```gcc``` requires more memory resources when\ncompiling *pygafro*, which can become problematic on lower-end computers.\n\n### Using the default compiler of your computer\n\n\tgit clone\n\tcd pygafro\n\tmkdir build \u0026\u0026 cd build\n\tcmake ..\n\tmake # or for example \"make -j4\" if you have enough resources\n\tmake install\n\n### Forcing the usage of *clang*\n\n(assuming that ```clang``` is installed at ```/usr/bin/clang```)\n\n\tgit clone\n\tcd pygafro\n\tmkdir build \u0026\u0026 cd build\n\tcmake -DCMAKE_CXX_COMPILER=/usr/bin/clang++ -DCMAKE_C_COMPILER=/usr/bin/clang ..\n\tmake # or for example \"make -j4\" if you have enough resources\n\tmake install\n\n## Usage\n\n### Multivectors\n\n\tfrom pygafro import Multivector\n\tfrom pygafro import Point\n\tfrom pygafro import Motor\n\n\t# create a multivector that corresponds to a Euclidean vector\n\tvector = Multivector.create(['e1', 'e2', 'e3'], [1.0, 2.0, 3.0])\n\n\t# create a point (a specialized multivector subclass)\n\tpoint = Point(1.0, 2.0, 3.0)\n\n\t# create a random motor\n\tmotor = Motor.Random()\n\n\t# apply the motor to our multivectors\n\tvector2 = motor.apply(vector)\n\tpoint2 = motor.apply(point)\n\n\t# geometric product\n\tresult = vector * point\n\n\t# inner product\n\tresult = vector | point\n\n\t# outer product\n\tresult = vector ^ point\n\n### Robots\n\n\tfrom pygafro import FrankaEmikaRobot\n\n\tpanda = FrankaEmikaRobot()\n\n\tposition = panda.getRandomConfiguration()\n\n\t# forward kinematics: compute the motor at the end-effector\n\tee_motor = panda.getEEMotor(position)\n\n## Differences between *gafro* and *pygafro*\n\n*gafro* being based on C++ templates, only the classes and operations you are effectively\nusing are compiled into your software.\n\nThis versatility cannot be achieved in a Python library: we cannot instantiate the\ntemplates at runtime, nor can we realistically instantiate all the possible combinations\nat compile time.\n\nA compromise was choosen: a subset of multivectors (using sensible blades combinations)\nare instantiated and compiled, and other blades combinations are supported through a\nPython class that internally use a C++ multivector with more blades and transparently\nuse a mask to only expose the blades requested by the user.\n\nThus, creating a multivector is done using the following helper function:\n\n\t# using values\n\tvector = Multivector.create(['e1', 'e2', 'e3'], [1.0, 2.0, 3.0])\n\n\t# using only the list of blades\n\tvector = Multivector.create(['e1', 'e2', 'e3', 'ei', 'e123i'])\n\n## Background\n\nYou can find the accompanying article [here](http://arxiv.org/abs/2212.07237) and more information on our [website](https://geometric-algebra.tobiloew.ch/).\n\n## How to cite\n\nIf you use *gafro* in your research, please cite:\n\n\t@article{loewGeometricAlgebraOptimal2023,\n\t  title = {Geometric {{Algebra}} for {{Optimal Control}} with {{Applications}} in {{Manipulation Tasks}}},\n\t  author = {L\\\"ow, Tobias and Calinon, Sylvain},\n\t  date = {2023},\n\t  journal = {IEEE Transactions on Robotics},\n\t  doi = {10.1109/TRO.2023.3277282}\n\t}\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fidiap%2Fpygafro","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fidiap%2Fpygafro","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fidiap%2Fpygafro/lists"}