#franka #libfranka #emika #panda

nightly franka_rust

Rust bindings for the Franka Emika Panda robot

3 releases

Uses new Rust 2024

new 0.1.2 Mar 28, 2025
0.1.1 Mar 26, 2025
0.1.0 Mar 26, 2025

#33 in Robotics

Download history 97/week @ 2025-03-21

97 downloads per month

Apache-2.0

205KB
4K SLoC

Readme

English | 简体中文

unofficial rust implementation of libfranka!

This library is part of the Universal Robot Driver Project! We are committed to providing Rust driver support for more robotic platforms! Unifying driver interfaces across different robot models, reducing the learning curve for robotics, and delivering more efficient robot control solutions!

During implementation, we referenced both libfranka and libfranka-rs. Special thanks to open-source contributors, especially marcbone - their library provided significant assistance! This implementation is not intended to be a direct replica of the official approach, but rather follows a more idiomatic Rust methodology.

Additionally, the official driver implementation has limited support for non-Ubuntu systems and high dependency on real-time kernels. In this library, we make real-time kernels an optional dependency. We strive to provide support for platforms without real-time kernels or with performance constraints.

OS Architecture Support
Windows 10 x86_64
Windows 10 amd64
Windows 11 x86_64
Windows 11 amd64
Ubuntu 20.04 x86_64
Ubuntu 22.04 x86_64
macOS 13 x86_64
macOS 14 aarch64
Other Other ???

Other OS/arch combinations may work but remain untested due to hardware limitations. PRs and issues are welcome!

This library also aims to support multiple language bindings through our unified interface. Currently supported:

  • Python
  • C++ (Planned)
  • Java (Planned)
  • Go (Planned)
  • C# (Planned)

Requirements

  • Rust 2024

Features

  • Robot state reading
  • Robot behavior parameters, controller parameters, and payload configuration
  • Access to official Franka dynamic models
  • Known-target interfaces
    • Joint-space point-to-point motion generator (blocking/async)
    • Cartesian-space point-to-point motion generator (blocking/async)
    • Waypoint spline motion generator (blocking/async)
  • Closure-based control interfaces
    • Joint position control
    • Joint velocity control
    • Cartesian position control
    • Cartesian velocity control
    • Torque control
  • Handler tracking interfaces
    • Joint position tracking
    • Joint velocity tracking
    • Cartesian position tracking
    • Cartesian velocity tracking
    • Torque tracking
  • Official gripper support
  • Official vacuum gripper support

Quick Start

Add to your Cargo.toml:

[dependencies]
franka-rust = "*"

Minimal example (see examples for more):

fn main() -> RobotResult<()> {
    let mut robot = FrankaRobot::new("172.16.0.3");
    robot.set_default_behavior()?;

    robot.set_collision_behavior(SetCollisionBehaviorData {
        lower_torque_thresholds_acceleration: [20., 20., 18., 18., 16., 14., 12.],
        upper_torque_thresholds_acceleration: [20., 20., 18., 18., 16., 14., 12.],
        lower_torque_thresholds_nominal: [20., 20., 18., 18., 16., 14., 12.],
        upper_torque_thresholds_nominal: [20., 20., 18., 18., 16., 14., 12.],
        lower_force_thresholds_acceleration: [20., 20., 20., 25., 25., 25.],
        upper_force_thresholds_acceleration: [20., 20., 20., 25., 25., 25.],
        lower_force_thresholds_nominal: [20., 20., 20., 25., 25., 25.],
        upper_force_thresholds_nominal: [20., 20., 20., 25., 25., 25.],
    })?;

    robot.move_to(MotionType::Joint(FRANKA_ROBOT_DEFAULT_JOINT), 0.3)?;

    Ok(())
}

This code connects to a Franka Emika robot at 172.16.0.3 and performs a blocking move to FRANKA_ROBOT_DEFAULT_JOINT.

Simple, right? Give it a try!

TODO

  • more examples
  • handler interface

Dependencies

~7–16MB
~235K SLoC