|
franky 1.1.4
A High-Level Motion API for Franka
|
franky is a high-level control library for Franka robots, offering Python and C++ support. By providing a high-level control interface, franky eliminates the need for strict real-time programming at 1 kHz, making control from non-real-time environments, such as Python programs, feasible. Instead of relying on low-level control commands, franky expects high-level position or velocity targets and uses Ruckig to plan time-optimal trajectories in real-time.
Although Python does not provide real-time guarantees, franky strives to maintain as much real-time control as possible. Motions can be preempted at any moment, prompting franky to re-plan trajectories on the fly. To handle unforeseen situations—such as unexpected contact with the environment — franky includes a reaction system that allows for updating motion commands dynamically. Furthermore, most non-real-time functionality of libfranka, such as Gripper control is made directly available in Python.
Check out the tutorial and the examples for an introduction. The full documentation can be found at https://timschneider42.github.io/franky/.
If you do not have a robot at hand, you can also try the simulation first.
pip install — no ROS at all.Real-time kernel already installed and real-time permissions granted? Just install franky via
Otherwise, follow the setup instructions first.
Now we are already ready to go! Unlock the brakes in the web interface, activate FCI, and start coding:
If you are seeing server version mismatch errors, such as
then your Franka robot is either not on the most recent firmware version, or you are using the older Franka Panda model. In any case, it's no big deal; just check here which libfranka version you need and follow our instructions to install the appropriate franky wheels.
To install franky, you have to follow three steps:
In order for Franky to function properly, it requires the underlying OS to use a real-time kernel. Otherwise, you might see communication_constrains_violation errors.
To check whether your system is currently using a real-time kernel, type uname -a. You should see something like this:
If it does not say PREEMPT_RT, you are not currently running a real-time kernel.
There are multiple ways of installing a real-time kernel. You can build it from source or, if you are using Ubuntu, it can be enabled through Ubuntu Pro.
First, create a group realtime and add your user (or whoever is running franky) to this group:
Afterward, add the following limits to the real-time group in /etc/security/limits.conf:
Log out and log in again to let the changes take effect.
To verify that the changes were applied, check if your user is in the realtime group:
If real-time is not listed in your groups, try rebooting.
To start using franky with Python and libfranka 0.21.2, just install it via
We also provide wheels for libfranka versions 0.7.1, 0.8.0, 0.9.2, 0.12.1, 0.13.3, 0.14.2, 0.17.0, and 0.21.2. They can be installed via
If you need the latest features before they make it into an official release, we provide wheels of the current master branch in the rolling dev release. These wheels are rebuilt on every push to master and are provided for all supported libfranka versions. They can be installed via the package index by adding the --pre flag:
Development builds are versioned as pre-releases of the next patch version, and their version indicates the commit and libfranka version they were built against: e.g., if the latest release is 1.1.4, then 1.1.5.dev1234+g8cb09e5.libfranka.0.9.2 is a development build of commit 8cb09e5 on master for libfranka 0.9.2.
To use franky within Docker we provide a Dockerfile and accompanying docker-compose file.
To use another version of libfranka than the default (0.21.2), add a build argument:
To run the container:
The container requires access to the host machine's network and elevated user rights to allow the Docker user to set RT capabilities of the processes run from within it.
Yes. However, you need to set IGNORE_PREEMPT_RT_PRESENCE=1 during the installation and all subsequent updates of the CUDA drivers on the real-time kernel.
First, make sure that you have rebooted your system after installing the real-time kernel. Then, add IGNORE_PREEMPT_RT_PRESENCE=1 to /etc/environment, call export IGNORE_PREEMPT_RT_PRESENCE=1 to also set it in the current session, and follow the instructions of Nvidia to install CUDA on your system.
If you are on Ubuntu, you can also use this script to install CUDA on your real-time system:
Alternatively, if you are a cowboy and do not care about security, you can also use this one-liner to directly call the script without checking it:
No problem! There are two projects which let you run franky remotely via RPC with minimal effort: franky-remote and net_franky.
Please note that I’m not involved in the development of these projects, so I cannot take any liability for its use. If you decide to use it, please ensure that you credit the developers of these projects for their work.
franky is based on libfranka, Eigen for transformation calculations and pybind11 for the Python bindings. As the Franka is sensitive to acceleration discontinuities, it requires jerk-constrained motion generation, for which franky uses the Ruckig community version for Online Trajectory Generation (OTG).
After installing the dependencies (the exact versions can be found here), you can build and install franky via
To use franky, you can also include it as a subproject in your parent CMake via add_subdirectory(franky) and then target_link_libraries(<target> franky).
If you need only the Python module, you can install franky via
Make sure that the built library _franky.cpython-3**-****-linux-gnu.so is in the Python path, e.g. by adjusting PYTHONPATH accordingly.
For building franky and its wheels, we provide another Docker container that can also be launched using docker-compose:
The built wheels are placed in build/dist/ and can be installed via
franky comes with both a C++ and Python API that differ only regarding real-time capability. Check out the tutorial for a detailed introduction to geometry types, motion types, real-time reactions, asynchronous motion execution, gripper control, the Desk web interface API, and simulation.
franky is currently tested against the following versions
For non-commercial applications, this software is licensed under the LGPL v3.0. If you want to use franky within commercial applications or under a different license, please contact us for individual agreements.
franky started originally as a fork of frankx, though both codebase and functionality differ substantially from frankx by now. Aside from bug fixes and general performance improvements, franky provides the following new features/improvements:
setCollisionBehavior, setJoinImpedance, and setCartesianImpedance).Affine changed. Affine does not handle elbow positions anymore. Instead, a new class RobotPose stores both the end-effector pose and optionally the elbow position.MotionData class does not exist anymore. Instead, reactions and other settings moved to Motion.Measure class allows for arithmetic operations.If you wish to contribute to this project, you are welcome to create a pull request. Please run the pre-commit hooks before submitting your pull request. To install the pre-commit hooks, run:
pre-commit install or, alternatively, run pre-commit run --all-files manually.