This solution allows you to run your Python Franky code on a workstation (client) while the actual robot control happens on a real-time enabled machine (server).
- Server: Runs on the real-time machine. It hosts the actual
frankylibrary and exposes it via RPyC. - Client: Runs on your workstation. It installs a "fake"
frankypackage that transparently forwards all calls to the server.
This project wraps the Franky library created by Tim Schneider.
- Original Library: https://github.com/TimSchneider42/franky
- License: The core
franky-remotecode is licensed under MIT. However, the examples directory includes code from the originalfrankyrepository which is licensed under LGPL-3.0.
If you use this project, please credit the original authors of franky.
If you are using Servobox to manage your real-time environment, you can simply run:
# For Franka Emika Panda (Gen1)
servobox pkg-install franky-remote-gen1
servobox run franky-remote-gen1 # This will auto-spin the server
# For Franka Research 3 (FR3)
servobox pkg-install franky-remote-fr3
servobox run franky-remote-fr3- Ensure
frankyis installed and working. - Install
rpyc:pip install rpyc
- Run the server script (preferably with sudo for Real-Time scheduling):
(You can set the port via
# Runs with SCHED_FIFO priority if possible sudo python3 server/run.py # For infinite recovery on failure: sudo python3 server/run.py --persistent
FRANKY_SERVER_PORTenv var, default is 18861)
-
Install
rpyc:pip install rpyc
-
Install the client package:
From source (development):
pip install -e .Directly from GitHub:
pip install git+https://github.com/kvasios/franky-remote.git
Note: If you already have
frankyinstalled on the client, you should uninstall it first to avoid conflicts, or rely on PYTHONPATH precedence. -
Configure the connection: Set the environment variable
FRANKY_SERVER_IPto the IP of your server.export FRANKY_SERVER_IP=192.168.1.X
Run your scripts exactly as before!
from franky import Robot, JointMotion
# This connects to the remote server, which connects to the robot
robot = Robot("172.16.0.2")
motion = JointMotion([0, 0, 0, -1.5, 0, 1.5, 0])
robot.move(motion)The client franky package connects to the server upon import. It then populates its own namespace with references to the server's franky objects. When you create a Robot or Motion object, you are actually creating it on the server. All method calls are forwarded over the network.