TimSchneider42/franky
概要
High-Level Control Library for Franka Robots with Python and C++ Support
開発ツールできること
- Control your Franka robot directly from Python in just a few lines! No more endless hours setting up ROS, juggling packages, or untangling dependencies. Just pip install, no ROS at all.
- Deploy learned policies and teleoperate the real robot A compliant controller configured like the CRISP controllers follows end-effector targets from your policy or teleoperation device.
- Trajectory control: Cartesian position, Cartesian velocity, Joint position, and Joint velocity control. franky's trajectory controllers use Ruckig to generate smooth, time-optimal trajectories while respecting velocity, acceleration, and jerk limits.
- Torque control: Direct torque control and Impedance control. Command joint torques directly, or use franky's built-in Cartesian and joint impedance controllers.
計測したスター増加
- 24時間
- +2
- 7日間
- +8
- 15日間
- +11
- 1か月
- 履歴を収集中
期間ごとの純増数です。期間は重複しており、日別の値ではありません。未計測の値は空欄です。スター数は注目度の指標であり、品質の保証ではありません。
README.md
オリジナルDeploy your learned policies on real Franka robots in minutes
Got a trained policy or a teleoperation device? Stream its targets to a real Franka robot straight from Python: no ROS,
no real-time programming, just pip install.
franky ships compliant CRISP-style controllers for your policies
and time-optimal Ruckig trajectories for everything else.
Under the hood, it exposes all of libfranka
in Python and C++.
No robot at hand? Try everything in simulation first.
📖 Quickstart
Install franky (and, optionally, the franky-sim simulator):
pip install franky-control franky-sim
On the real robot, franky needs a real-time kernel and real-time permissions; see the installation instructions. Then unlock the brakes in the web interface and activate FCI.
🤖 Deploy a learned policy
CRISPTracker runs a compliant Cartesian impedance controller at 1 kHz in the background, configured like the
CRISP controllers
(San José Pro et al., 2025).
Stream one end-effector target per policy step:
from franky import Affine, CRISPTracker, Robot
robot = Robot("10.90.90.1") # Replace this with your robot's IP
robot.recover_from_errors()
with CRISPTracker(robot, period=0.05) as tracker: # 20 Hz policy
while tracker.tick():
# End-effector target in the robot base frame:
# position [x, y, z] in m, orientation as quaternion [x, y, z, w]
position, quaternion = policy()
tracker.set_target(Affine(position, quaternion))
The robot stays compliant, so contact and the jumps between targets do not turn into torque spikes. See the tutorial for adjusting stiffness, filtering, and force feedforward.
🦾 Move the robot
For scripted motions, franky plans smooth trajectories for you:
from franky import *
robot = Robot("10.90.90.1") # Replace this with your robot's IP
# franky starts slow: by default, the robot uses at most 5% of its velocity, acceleration, and jerk limits.
# Raise robot.relative_dynamics_factor once your code works.
# Move the robot 20cm along the relative X-axis of its end-effector
robot.move(CartesianMotion(Affine([0.2, 0.0, 0.0]), ReferenceType.Relative))
🖥️ Run it in simulation
franky-sim speaks the same protocol as the real robot, so both examples run unchanged against a simulated FR3. Just create the robot like this instead:
from franky import RealtimeConfig, Robot
from franky_sim import SimulationServer
from franky_sim.mujoco_simulator import MujocoSimulator
with MujocoSimulator(enable_visualization=True) as sim:
robot_model = sim.add_robot()
with SimulationServer(sim) as server:
server.run_async()
robot = Robot(robot_model.hostname, realtime_config=RealtimeConfig.Ignore)
... # Continue with either example above
🧠 Let your coding agent do it
Working with an AI coding agent? Tell it:
Use franky to control the Franka robot. Read https://github.com/TimSchneider42/franky/blob/master/AGENTS.md first
and test the code in franky-sim before running it on the real robot.
Seeing server version mismatch errors? See Server Version Mismatch?.
🚀 Features
Control your Franka robot directly from Python in just a few lines! No more endless hours setting up ROS, juggling packages, or untangling dependencies. Just
pip install, no ROS at all.Deploy learned policies and teleoperate the real robot A compliant controller configured like the CRISP controllers follows end-effector targets from your policy or teleoperation device.
Trajectory control: Cartesian position, Cartesian velocity, Joint position, and Joint velocity control. franky's trajectory controllers use Ruckig to generate smooth, time-optimal trajectories while respecting velocity, acceleration, and jerk limits.
Torque control: Direct torque control and Impedance control. Command joint torques directly, or use franky's built-in Cartesian and joint impedance controllers.
Real-time control from Python and C++ Need to change the target while the robot’s moving? No problem. franky replans trajectories on the fly so that you can preempt motions anytime.
Reactive behavior Robots don’t always go according to plan. franky lets you define reactions to unexpected events, like contact with the environment, so you can change course in real-time.
Motion and reaction callbacks Want to monitor what’s happening under the hood? Add callbacks to your motions and reactions. They won’t block the control thread and are super handy for debugging or logging.
Things are moving too fast? Tune the robot's dynamics to your needs Adjust max velocity, acceleration, and jerk to match your setup or task. Fine control for smooth, safe operation.
Full Python access to the libfranka API Want to tweak impedance, read the robot state, set force thresholds, or mess with the Jacobian? Go for it. If libfranka supports it, chances are franky does, too.
Scared to test code on the real system?: franky-sim provides simulator support for franky! It is easy to install and use and serves as a drop-in replacement for the real robot.
📚 Documentation
The full documentation is available at https://timschneider42.github.io/franky/. For runnable code, check out the examples.
🔌 Server Version Mismatch?
Seeing an error like libfranka: Incompatible library version (server version: 9, library version: 10)?
Your robot is running an older firmware or is a Franka Panda.
Install the wheels matching the server version from the error message (franky supports server versions 3 through 10):
pip uninstall franky-control # pip does not replace an installed wheel of the same version otherwise
# Replace 9 with your robot server version
pip install franky-control --extra-index-url "https://timschneider42.github.io/franky/whl/by-robot-server-version/9/"
To find the server version from your robot's system version, and for help with other errors, see Troubleshooting.
🧪 Development Builds
We also provide development builds of the latest master (stable) and dev (unstable) branches.
Install them with --pre:
# Replace 10 with your robot server version
# Latest master branch
pip install --pre franky-control --extra-index-url "https://timschneider42.github.io/franky/whl/by-robot-server-version/10/"
# Latest dev branch
pip install --pre franky-control --extra-index-url "https://timschneider42.github.io/franky/branches/dev/whl/by-robot-server-version/10/"
📜 License
Starting with version 2.0.0, franky is licensed under the MIT License. Versions prior to 2.0.0 were released under the LGPL v3.0 and remain available under that license.
The Python docstrings of the franka.* entities (python/docstrings.hpp) are extracted from
the headers of libfranka, Copyright (c) Franka Robotics GmbH, which is
licensed under the Apache License 2.0.
Contributing
If you wish to contribute to this project, you are welcome to create a pull request. Please check out the contributing guidelines first.
関連プロジェクトを探す
読み込み中…