Skip to main content

franka-rs for Python

import franka: drive a Franka FR3 (FCI v10) or Franka Emika Robot / Panda (FCI v5) from a program that runs at its own rate -- a policy at 5 to 30 Hz, a script, a keyboard. The 1 kHz control loop is franka-rs's target control on a Rust thread; the GIL is never on the 1 kHz path. move_to / move_by are one write into that loop's seqlock slot, follow hands a chunk of targets to a Rust timer thread, and state() is a copy out of a mutex.

For an arm served by franka-node over Zenoh, see its client, pip install franka-node-client.

import franka

robot = franka.Robot("172.16.0.2")    # FRANKA_REALTIME=ignore for franka-sim

with robot.cartesian_targets(max_velocity=0.3, max_acceleration=0.5, max_jerk=20.0) as arm:
    while not done:
        obs = arm.state().flat()      # 1-D float64 in the order of franka.FLAT_LAYOUT
        action = policy(obs)
        arm.move_by(action[:3])       # metres, relative to the current target
        # or: arm.move_to([x, y, z]); arm.follow(chunk, dt=0.02)  # chunk: (N, 3) absolute

robot.joint_targets(fraction=0.2) is the same over the seven joints. __exit__ stops the loop; an exception inside the block still stops the motion and is re-raised. Errors are franka.FrankaError; a motion the robot aborted is a franka.ControlException with the reflex reason. robot.gripper() drives the Franka Hand, releasing the GIL while it waits.

The loop tracks the targets with the crate's own impedance torques by default, so the arm is a spring around the target: push it and it gives way, let go and it returns. cartesian_stiffness=400 softens the default 750 N/m (15 Nm/rad rotational); cartesian_damping, joint_stiffness, joint_damping, torque_limits, posture, leash and project_joint_gains are the other knobs, and backend='robot' has the robot's own controller track the targets instead, as the bindings did in 0.2.0. Target control sets no collision thresholds: with the default gains give robot.set_collision_behavior_simple(...) at least 40 N / 40 Nm. The law and the defaults are on the book's Python page.

A Cartesian target of 7 elements (move_to, the rows of follow) sets the orientation too, as a unit quaternion x, y, z, w after the position; a move_by of 6 elements appends a rotation vector (axis times angle, rad) composed onto the target orientation in the base frame. arm.target() is that 7-vector, arm.target_pose() the 4x4 matrix. examples/policy_loop.py is a jittery 6-10 Hz loop with a circle, a yaw and tilt sweep and a follow chunk; examples/rotate.py is the rotation alone, and examples/quickstart.ipynb a notebook that connects, moves, and replays the motion inline with Franka's meshes. robot.model() is the kinematics and dynamics over numpy (pose, body_jacobian, zero_jacobian, mass, coriolis, gravity, link_poses, hand_pose).

Install

pip install franka-rs

The wheel is named franka-rs, the package franka. To build from the source tree into a virtualenv instead (prefix with env -u CONDA_PREFIX under an active conda env):

pip install maturin
maturin develop --release -m crates/franka-py/Cargo.toml

The crate is publish = false on crates.io; its tests are

flock .sim.lock env FRANKA_SIM_IMAGE=franka-sim:dev pytest crates/franka-py/tests

against the simulator (see the book's Testing with franka-sim).

Metadata

Release files for franka-rs 0.4.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for franka-rs 0.4.0
File Size Uploaded
franka_rs-0.4.0.tar.gz 1.6 MB Details

Built distributions (wheels)

Table of built distributions (wheels) for franka-rs 0.4.0
File Interpreter ABI Platform
franka_rs-0.4.0-cp39-abi3-manylinux_2_34_x86_64.whl CPython 3.9 abi3 Linux glibc 2.34+ x86-64 Details
franka_rs-0.4.0-cp39-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl CPython 3.9 abi3 Linux glibc 2.17+ ARM64 Details

Total release size: 3.2 MB

Release files / franka_rs-0.4.0.tar.gz

Download URL franka_rs-0.4.0.tar.gz
Size 1.6 MB
Tags Source
SHA-256 checksum
How to use checksums
32b0783a53f8f8d797e9d0c265fb89b00c84abaac14d99314ee51cf4c217ec6f
BLAKE2b-256 checksum
How to use checksums
2a54da1ab49bb4a3397458d6a85886ef353d9e207b4711c6b6801f843cc78537
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 Sep 21, 2026.

Transparency log

Release files / franka_rs-0.4.0-cp39-abi3-manylinux_2_34_x86_64.whl

Download URL franka_rs-0.4.0-cp39-abi3-manylinux_2_34_x86_64.whl
Size 837.0 kB
Tags CPython 3.9 Linux glibc 2.34+ x86-64 abi3
SHA-256 checksum
How to use checksums
f6616766bb594d7eb6a26db98f57ddebfba61964998f135541ae1f13b5be1ebc
BLAKE2b-256 checksum
How to use checksums
e2ba3844a1120825374c2ac1caae22fef601a9ebdd453286f9e85ce4dbe44ee0
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 Sep 21, 2026.

Transparency log

Release files / franka_rs-0.4.0-cp39-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl

Download URL franka_rs-0.4.0-cp39-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Size 773.3 kB
Tags CPython 3.9 Linux glibc 2.17+ ARM64 abi3
SHA-256 checksum
How to use checksums
0e123e28fa22acd64761dac759f9df0e91901a06bbd75865efd688f43575c776
BLAKE2b-256 checksum
How to use checksums
527cfd80ae7b1dc78b84fec7a173b992010e2532edbcc2f1d635657e02539d2a
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 Sep 21, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

0.4.0 This release

3 release files

0.3.0

3 release files

0.2.0

3 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page