Skip to content
Snippets Groups Projects

Add instruction how to install ArmarX Python via axii.

Merged Tilman Daab requested to merge daab-master-patch-98386 into master
+ 97
0
Installation
============
You may install the ArmarX Python either as a pypi package, or from source. When installing from source, which guarantees you to use the most up-to-date version of the code and enables you to contribute to the development of the ArmarX Python code itself, you can choose between a manual installation and an automated installation via axii.
Option 1: Installation via PyPi Packages:
-----------------------------------------
The ArmarX Python bindings are available as packages.
Just grab the latest version from `pypi.org <https://pypi.org/armarx>`__ .
With poetry
.. highlight:: bash
.. code-block:: bash
poetry add armarx
or with pip
.. highlight:: bash
.. code-block:: bash
@@ -21,7+26,7 @@
Alternatatively, you can create a project template with the `armarx-package`
tool, i.e. `armarx-package add python <your project name>`. Then you can use
`poetry install` to setup a virtual env.
Since the `zeroc-ice` package requires a rebuild you can grab already precompiled packages
@@ -45,7+50,7 @@
url = "https://pypi.humanoids.kit.edu/simple/"
Option 2: Installation From Source, Manually
--------------------------------------------
Clone the ArmarX Python repository somewhere. If you are in an active axii workspace, executing `echo $armarx__python3_armarx__PATH` might return a path that indicates where that repository is already cloned on your computer.
Within the base directory of your ArmarX project, run
.. highlight:: bash
.. code-block:: bash
armarx-package add python subfolder-name
This creates a pyproject.toml at `python/subfolder-name/`, from which you can delete the armarx-dev dependency and the pypi.humanoids.kit.edu repository.
Still being in `python/subfolder-name/`, create a virtual environment by running
.. highlight:: bash
.. code-block:: bash
virtualenv venv
Update pip by running
.. highlight:: bash
.. code-block:: bash
source venv/bin/activate
pip install --upgrade pip
Now you can install the dependencies of your python project, by running
.. highlight:: bash
.. code-block:: bash
pip install pyproject.toml
pip install -e path/to/the/armarx-python/repository
Option 3: Installation From Source, via axii
--------------------------------------------
Create an axii module for your project. Below, you can find a short example. For an extensive documentation, visit https://git.h2t.iar.kit.edu/sw/armarx/meta/axii/-/blob/main/docs/module_authors/README.md.
.. highlight:: json
.. code-block:: json
{
"general": {
"url": "https://git.h2t.iar.kit.edu/path-to-your-project",
"authors": [
"FirstName LastName <mail@example.com>"
]
},
"update": {
"git": {
"h2t_gitlab_slug": "path-to-your-project"
}
},
"prepare": {
"cmake": {
"definitions": {
"CMAKE_C_COMPILER": "$ARMARX_C_COMPILER",
"CMAKE_CXX_COMPILER": "$ARMARX_CXX_COMPILER"
}
},
"python": {
"packages": {
"python/folder_of_your_python_project_in_which_to_create_a_venv": {
"install_editable": [
"$armarx__python3_armarx__PATH"
]
}
}
}
},
"build": "cmake",
"required_modules": {
"tools/default_python_interpreter": {},
"armarx/meta/compiler": {},
"armarx/python3-armarx": {},
"optionally/add/further/packages/just/as/armarx/VisionX": {}
}
}
Add the axii package to your workspace and upgrade your workspace as usual (see https://git.h2t.iar.kit.edu/sw/armarx/meta/axii). This will automatically create the virtual environment and setup ArmarX Python.
Configuration
-------------
Loading