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.
import franka
robot = franka.Robot("192.168.0.1") # 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.
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, as run on a Panda; 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).
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distributions
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file franka_rs-0.2.0.tar.gz.
File metadata
- Download URL: franka_rs-0.2.0.tar.gz
- Upload date:
- Size: 1.3 MB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
98deec42858e390de99a3b424f0c7034259b403f9e0da73de1e1f5fd91e464f9
|
|
| MD5 |
508f11c1e2b685e3928cc797a7d874e3
|
|
| BLAKE2b-256 |
e33996b68273bf0f17f2ab0738a0e611630e206f34bc270d9695fdf1ad5910c3
|
Provenance
The following attestation bundles were made for franka_rs-0.2.0.tar.gz:
Publisher:
release.yml on BarisYazici/franka-rs
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
franka_rs-0.2.0.tar.gz -
Subject digest:
98deec42858e390de99a3b424f0c7034259b403f9e0da73de1e1f5fd91e464f9 - Sigstore transparency entry: 2768861980
- Sigstore integration time:
-
Permalink:
BarisYazici/franka-rs@a0b43156455b25106f3d0027d0bc680105429132 -
Branch / Tag:
refs/tags/v0.2.0 - Owner: https://github.com/BarisYazici
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@a0b43156455b25106f3d0027d0bc680105429132 -
Trigger Event:
push
-
Statement type:
File details
Details for the file franka_rs-0.2.0-cp39-abi3-manylinux_2_34_x86_64.whl.
File metadata
- Download URL: franka_rs-0.2.0-cp39-abi3-manylinux_2_34_x86_64.whl
- Upload date:
- Size: 748.6 kB
- Tags: CPython 3.9+, manylinux: glibc 2.34+ x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d72951eca4fdbf01980caaaebad0ef318162d09a291be40d31a3a17621ebba87
|
|
| MD5 |
8be0b0f24678856dc957bb2f7fa3ddaf
|
|
| BLAKE2b-256 |
42899a3f8e9f4c5d911becdfbb22f45d7b5edd9cfc9cb36803c00fe87de3ae1c
|
Provenance
The following attestation bundles were made for franka_rs-0.2.0-cp39-abi3-manylinux_2_34_x86_64.whl:
Publisher:
release.yml on BarisYazici/franka-rs
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
franka_rs-0.2.0-cp39-abi3-manylinux_2_34_x86_64.whl -
Subject digest:
d72951eca4fdbf01980caaaebad0ef318162d09a291be40d31a3a17621ebba87 - Sigstore transparency entry: 2768862179
- Sigstore integration time:
-
Permalink:
BarisYazici/franka-rs@a0b43156455b25106f3d0027d0bc680105429132 -
Branch / Tag:
refs/tags/v0.2.0 - Owner: https://github.com/BarisYazici
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@a0b43156455b25106f3d0027d0bc680105429132 -
Trigger Event:
push
-
Statement type:
File details
Details for the file franka_rs-0.2.0-cp39-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.
File metadata
- Download URL: franka_rs-0.2.0-cp39-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
- Upload date:
- Size: 693.5 kB
- Tags: CPython 3.9+, manylinux: glibc 2.17+ ARM64
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
928ab2ffda0b9e4c7b0ada6a45d14728760c8d7baaff94355afc6a121b432a53
|
|
| MD5 |
563d6f426542843ea9250d17b9724181
|
|
| BLAKE2b-256 |
7896a1060a4e9c8b074769a18be29f188ac337702e2e217dd17fea474389be6c
|
Provenance
The following attestation bundles were made for franka_rs-0.2.0-cp39-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl:
Publisher:
release.yml on BarisYazici/franka-rs
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
franka_rs-0.2.0-cp39-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl -
Subject digest:
928ab2ffda0b9e4c7b0ada6a45d14728760c8d7baaff94355afc6a121b432a53 - Sigstore transparency entry: 2768862083
- Sigstore integration time:
-
Permalink:
BarisYazici/franka-rs@a0b43156455b25106f3d0027d0bc680105429132 -
Branch / Tag:
refs/tags/v0.2.0 - Owner: https://github.com/BarisYazici
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@a0b43156455b25106f3d0027d0bc680105429132 -
Trigger Event:
push
-
Statement type: