pylibfranka Installation and Usage Guide
This document provides comprehensive instructions for installing and using pylibfranka, a Python binding for libfranka that enables control of Franka Robotics robots.
Table of Contents
Installation
From PyPI (Recommended)
The easiest way to install pylibfranka is via pip. Pre-built wheels include all necessary dependencies.
pip install pylibfranka
Platform Compatibility
| Ubuntu Version | Supported Python Versions |
|---|---|
| 20.04 (Focal) | Python 3.9 only |
| 22.04 (Jammy) | Python 3.9, 3.10, 3.11, 3.12 |
| 24.04 (Noble) | Python 3.9, 3.10, 3.11, 3.12 |
Note: Ubuntu 20.04 users must use Python 3.9 due to glibc compatibility requirements.
From Source
If you need to build from source (e.g., for development or unsupported platforms):
Prerequisites
- Python 3.9 or newer
- CMake 3.16 or newer
- C++ compiler with C++17 support
- Eigen3 development headers
- Poco development headers
Disclaimer: If you are using the provided devcontainer, you can skip the prerequisites installation as they are already included in the container.
Installing Prerequisites on Ubuntu/Debian
sudo apt-get update
sudo apt-get install -y build-essential cmake libeigen3-dev libpoco-dev python3-dev
Build and Install
From the pylibfranka/ folder, you can install pylibfranka using pip:
pip install .
This will install pylibfranka in your current Python environment.
Examples
pylibfranka comes with three example scripts that demonstrate how to use the library to control a Franka robot.
Joint Position Example
This example demonstrates how to use an external control loop with pylibfranka to move the robot joints.
To run the example:
cd examples
python3 joint_position_example.py --ip <robot_ip>
Where <robot_ip> is the IP address of your Franka robot. If not specified, it defaults to "localhost".
The active control example:
- Sets collision behavior parameters
- Starts joint position control with CartesianImpedance controller mode
- Moves the robot using an external control loop
- Performs a simple motion of selected joints
Print Robot State Example
This example shows how to read and display the complete state of the robot.
To run the example:
cd examples
python3 print_robot_state.py --ip <robot_ip> [--rate <rate>] [--count <count>]
Where:
--ipis the robot's IP address (defaults to "localhost")--rateis the frequency at which to print the state in Hz (defaults to 0.5)--countis the number of state readings to print (defaults to 1, use 0 for continuous)
The print robot state example:
- Connects to the robot
- Reads the complete robot state
- Prints detailed information about:
- Joint positions, velocities, and torques
- End effector pose and velocities
- External forces and torques
- Robot mode and error states
- Mass and inertia properties
Joint Impedance Control Example
This example demonstrates how to implement a joint impedance controller that renders a spring-damper system to move the robot through a sequence of target joint configurations.
To run the example:
cd examples
python3 joint_impedance_example.py --ip <robot_ip>
Where --ip is the robot's IP address (defaults to "localhost").
The joint impedance example:
- Implements a minimum jerk trajectory generator for smooth joint motion
- Uses a spring-damper system for compliant control
- Moves through a sequence of predefined joint configurations:
- Home position (slightly bent arm)
- Extended arm pointing forward
- Arm pointing to the right
- Arm pointing to the left
- Return to home position
- Includes position holding with dwell time between movements
- Compensates for Coriolis effects
And more control examples
There are more control examples to discover. All of them can be executed in a similar way:
cd examples
python3 other_example.py --ip <robot_ip>
Gripper Control Example
This example demonstrates how to control the Franka gripper, including homing, grasping, and reading gripper state.
To run the example:
cd examples
python3 move_gripper.py --robot_ip <robot_ip> [--width <width>] [--homing <0|1>] [--speed <speed>] [--force <force>]
Where:
--robot_ipis the robot's IP address (required)--widthis the object width to grasp in meters (defaults to 0.005)--homingenables/disables gripper homing (0 or 1, defaults to 1)--speedis the gripper speed (defaults to 0.1)--forceis the gripper force in N (defaults to 60)
The gripper example:
- Connects to the gripper
- Performs homing to estimate maximum grasping width
- Reads and displays gripper state including:
- Current width
- Maximum width
- Grasp status
- Temperature
- Timestamp
- Attempts to grasp an object with specified parameters
- Verifies successful grasping
- Releases the object
Async Joint Position Control Example
You can also use the async API to control the robot in a low-rate fashion, e.g. 50Hz. This allows you to specify joint position setpoints without the need for a blocking loop.
cd examples
python3 async_position_control.py --ip <robot_ip>
Metadata
Release files for pylibfranka 0.21.3
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Built distributions (wheels)
| File | Actions Reset | |||
|---|---|---|---|---|
| pylibfranka-0.21.3-cp312-cp312-manylinux_2_34_x86_64.whl | CPython 3.12 | CPython 3.12 | Linux glibc 2.34+ x86-64 | Details for pylibfranka-0.21.3-cp312-cp312-manylinux_2_34_x86_64.whl |
| pylibfranka-0.21.3-cp311-cp311-manylinux_2_34_x86_64.whl | CPython 3.11 | CPython 3.11 | Linux glibc 2.34+ x86-64 | Details for pylibfranka-0.21.3-cp311-cp311-manylinux_2_34_x86_64.whl |
| pylibfranka-0.21.3-cp310-cp310-manylinux_2_34_x86_64.whl | CPython 3.10 | CPython 3.10 | Linux glibc 2.34+ x86-64 | Details for pylibfranka-0.21.3-cp310-cp310-manylinux_2_34_x86_64.whl |
| pylibfranka-0.21.3-cp39-cp39-manylinux_2_31_x86_64.whl | CPython 3.9 | CPython 3.9 | Linux glibc 2.31+ x86-64 | Details for pylibfranka-0.21.3-cp39-cp39-manylinux_2_31_x86_64.whl |
Total release size: 16.9 MB
Release files / pylibfranka-0.21.3-cp312-cp312-manylinux_2_34_x86_64.whl
| Download URL | pylibfranka-0.21.3-cp312-cp312-manylinux_2_34_x86_64.whl |
|---|---|
| Size | 4.2 MB |
| Tags | CPython 3.12 Linux glibc 2.34+ x86-64 |
|
SHA-256 checksum How to use checksums |
ba952e369a91d49487b01babb02f70507997cf2472379c27d92ca0da1fa6da56
|
|
BLAKE2b-256 checksum How to use checksums |
5d58676d3c47012b5927f3f04984add4c3021de19cbac7e0b00640bdc15e9eb5
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Jul 30, 2026.
Transparency logRelease files / pylibfranka-0.21.3-cp311-cp311-manylinux_2_34_x86_64.whl
| Download URL | pylibfranka-0.21.3-cp311-cp311-manylinux_2_34_x86_64.whl |
|---|---|
| Size | 4.2 MB |
| Tags | CPython 3.11 Linux glibc 2.34+ x86-64 |
|
SHA-256 checksum How to use checksums |
e71d0c7a04f77a640c6784de7f524474c57fee56e5019929896d6182273a99a0
|
|
BLAKE2b-256 checksum How to use checksums |
1007bf2f15d06a0f9b9981e9066c00f9514cd7b293b6089c27f3c52e0dadc1e0
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Jul 30, 2026.
Transparency logRelease files / pylibfranka-0.21.3-cp310-cp310-manylinux_2_34_x86_64.whl
| Download URL | pylibfranka-0.21.3-cp310-cp310-manylinux_2_34_x86_64.whl |
|---|---|
| Size | 4.2 MB |
| Tags | CPython 3.10 Linux glibc 2.34+ x86-64 |
|
SHA-256 checksum How to use checksums |
acf2320a87f7a6c419233ce003aa222662bb0395fbed7424d9832a2413f68d6a
|
|
BLAKE2b-256 checksum How to use checksums |
015846ca58106ea15067a93d4c3907013da43fcfcc0a25704e11597ed5973b7c
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Jul 30, 2026.
Transparency logRelease files / pylibfranka-0.21.3-cp39-cp39-manylinux_2_31_x86_64.whl
| Download URL | pylibfranka-0.21.3-cp39-cp39-manylinux_2_31_x86_64.whl |
|---|---|
| Size | 4.4 MB |
| Tags | CPython 3.9 Linux glibc 2.31+ x86-64 |
|
SHA-256 checksum How to use checksums |
88f646fa0a43caa623d85ddb0f9742357960ed3d421460e1767c3021e588033d
|
|
BLAKE2b-256 checksum How to use checksums |
99d96352ac00b9b0a2702681433096fe3250757599fe15f5e47291ae703cb018
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Jul 30, 2026.
Transparency logSecurity for pylibfranka 0.21.3
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
Full provenance
All 4 files in this release have been uploaded with provenance metadata.
Attestation for pylibfranka-0.21.3-cp312-cp312-manylinux_2_34_x86_64.whl
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Jul 30, 2026.
Transparency logA note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.