Skip to main content

A high-fidelity simulation server that implements the Franka robot network protocol, enabling seamless switching between simulation and hardware.

Project description

Franka Simulation Server

A high-fidelity Genesis simulation server that communicates with the Franka robot's network protocol, enabling seamless switching between simulation and hardware.

Overview

The Franka Simulation Server provides a drop-in replacement for the real Franka robot, implementing the complete libfranka network protocol. This allows developers to:

  • Test and debug robot controllers in simulation before deployment
  • Develop applications that work identically on both simulation and hardware
  • Validate error handling and safety features
  • Experiment with different control strategies risk-free

Compatibility

franka_sim implements the latest libfranka wire protocol — robot server version 10. In this protocol the robot model is built client-side: during connection the client fetches the robot URDF via the GetRobotModel command and builds its own Pinocchio model. The server therefore just serves a valid URDF (a hand-less FR3 arm by default) instead of a precompiled model library.

You need a libfranka version that speaks server protocol 10:

libfranka Version Robot System Version Robot/Gripper Server
>= 0.18.0 >= 5.9.0 10 / 3 ✅ supported
>= 0.15.0 >= 5.7.2 9 / 3 — not supported

See the Franka software compatibility matrix for the full list. Older libfranka releases (server version 9 and below) use a different wire format — double-based RobotState and server-side LoadModelLibrary instead of GetRobotModel — and are not compatible with this server.

Related Projects

Preview Video

  • Native libfranka control

Libfranka Native Control

  • With Python

With Python

Architecture

Architecture

In this repository, we only provide the simulation server backend with Genesis connection.

The libfranka python bindings will become available in a separate repository.

The system consists of several key components:

  1. libfranka Interface Layer

    • Implements the standard Franka robot network protocol
    • Handles TCP command interface and UDP state updates
    • Targets the latest libfranka wire protocol (robot server version 10)
  2. Genesis Simulation Backend

    • Physics-based robot simulation using the Genesis engine
    • Real-time joint state computation and dynamics
  3. State Management

    • Complete robot state tracking and synchronization
    • Accurate error reporting and status updates
    • Real-time state transmission (1kHz update rate)
  4. Control Modes

    • Joint Position Control
    • Joint Velocity Control
    • Joint Torque Control
    • Supports seamless switching between modes

Key Features

  • Protocol Compatibility: Full implementation of the Franka robot network protocol
  • Real-time Simulation: High-frequency state updates and control (1kHz)
  • Multiple Control Modes: Supports position, velocity, and torque control
  • Error Handling: Replicates real robot error states and recovery

Getting Started

Prerequisites

  • Python 3.9+
  • genesis-world==0.2.1
  • numpy==1.26.4
  • numba==0.60.0

Installation

Option 1: Install from PyPI (Recommended)

The package is available on PyPI and can be installed with pip:

pip install franka-sim

Option 2: Install from Source

# Clone the repository
git clone git@github.com:BarisYazici/libfranka-sim.git

# Install the package
cd libfranka-sim/simulation
pip install -e .

Basic Usage

After installation, you can run the server using the command-line executable:

# Start the server without visualization
run-franka-sim-server

# Start the server with visualization
run-franka-sim-server -v

Alternatively, if you installed from source, you can use:

# Start the simulation server
python -m franka_sim.run_server -v

In your application, use standard libfranka commands. The simulation will respond exactly like the real robot.

Gripper (Franka Hand)

The gripper server (libfranka gripper protocol, TCP port 1338) runs by default alongside the arm. Drive it with the standard franka::Gripper client (homing / move / grasp / stop).

# Arm + gripper, kinematic hand (no mesh; width tracked analytically, CI-friendly)
python -m franka_sim.run_server -v

# Arm + gripper, physics-backed Franka Hand: the hand mesh is loaded and the
# finger DOFs are simulated, so homing/move/grasp visibly move the fingers in
# the viewer (grasp succeeds on a finger-position stall against an object)
python -m franka_sim.run_server -v --gripper-physics

# Disable the gripper server entirely
python -m franka_sim.run_server -v --no-gripper
Flag Gripper backend Hand in viewer
(default) FrankaHandSim (kinematic) no
--gripper-physics GenesisFrankaHand (physics) yes, fingers move
--no-gripper none (arm only) no

Troubleshooting

If you encounter issues related to missing asset files, make sure you have the correct version of genesis-world installed:

pip install genesis-world==0.2.1

The simulator now automatically uses the assets provided by the Genesis package, so no additional asset files are needed.

Configuration

Switching Between Simulation and Hardware

To switch between simulation and hardware:

  1. Update the robot IP address in your application:

    • Use localhost or 127.0.0.1 for simulation
    • Use the real robot's IP for hardware
  2. No other changes needed - your application code remains identical

Development Status

The simulation server currently implements all major features of the Franka robot:

  • Complete network protocol implementation
  • All joint interfaces
  • Real-time state updates
  • Visualization support
  • Genesis connection
  • libfranka python bindings
  • v10 wire protocol (Connect, float-based RobotState, GetRobotModel/URDF)
  • Robot model via URDF (client-side Pinocchio through GetRobotModel)
  • Gripper simulation / Franka Hand (kinematic + Genesis physics, --gripper-physics)
  • Automatic error recovery (so franka_hardware / franka_ros2 can activate)
  • Advanced collision detection (in progress)
  • Cartesian interfaces (planned)

Contributing

Contributions are welcome! Please read our contributing guidelines and submit pull requests to our repository.

License

This project is licensed under the Apache License Version 2.0 - see the LICENSE file for details.

Acknowledgments

  • Franka Robotics GmbH for the original libfranka implementation
  • The Genesis Simulator team for the physics engine

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

franka_sim-0.3.0.tar.gz (5.9 MB view details)

Uploaded Source

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

franka_sim-0.3.0-cp311-cp311-manylinux2014_x86_64.whl (328.2 kB view details)

Uploaded CPython 3.11

franka_sim-0.3.0-cp311-cp311-macosx_11_0_universal2.whl (328.2 kB view details)

Uploaded CPython 3.11macOS 11.0+ universal2 (ARM64, x86-64)

franka_sim-0.3.0-cp310-cp310-manylinux2014_x86_64.whl (328.2 kB view details)

Uploaded CPython 3.10

franka_sim-0.3.0-cp310-cp310-macosx_11_0_universal2.whl (328.2 kB view details)

Uploaded CPython 3.10macOS 11.0+ universal2 (ARM64, x86-64)

franka_sim-0.3.0-cp39-cp39-manylinux2014_x86_64.whl (327.1 kB view details)

Uploaded CPython 3.9

File details

Details for the file franka_sim-0.3.0.tar.gz.

File metadata

  • Download URL: franka_sim-0.3.0.tar.gz
  • Upload date:
  • Size: 5.9 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for franka_sim-0.3.0.tar.gz
Algorithm Hash digest
SHA256 d1f4efade2ed3444a58aa0337eeb9533edd356d17f90ea032554b299a7ecf006
MD5 339c4a283b7bb7a907d1fb2e2b0b06c2
BLAKE2b-256 e487a96fb18541ab0fccece1fac1762bbfdfbe05027a3ee57cbf212646e05aba

See more details on using hashes here.

File details

Details for the file franka_sim-0.3.0-cp311-cp311-manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for franka_sim-0.3.0-cp311-cp311-manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 00e830c8d05a56195e3c1b08fd89a597735913de8ca538bc3562fd7b81dde2b8
MD5 7c96b6c7b0cfd9c232b200c5d2af5922
BLAKE2b-256 50dfb3cfbf7b593c39e08014eb9c5f1443f1e11f31186ebcbba0671daddf8876

See more details on using hashes here.

File details

Details for the file franka_sim-0.3.0-cp311-cp311-macosx_11_0_universal2.whl.

File metadata

File hashes

Hashes for franka_sim-0.3.0-cp311-cp311-macosx_11_0_universal2.whl
Algorithm Hash digest
SHA256 b74bd83c3d17ccf1ccad25acc18125cc1da8cd07768cbe92ced9f221f825e9d4
MD5 cc17487605cd5e62538c742166c58e8e
BLAKE2b-256 c87070882250fe013fee72b5b449b7ee5c0660b44405e432a855bd2744220a33

See more details on using hashes here.

File details

Details for the file franka_sim-0.3.0-cp310-cp310-manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for franka_sim-0.3.0-cp310-cp310-manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 04714cc7fac603e0710c9043aa0f026d592313a2186e9232f235a3db58ef1112
MD5 39e10bdb5157e570d8ab8be8d3b221ab
BLAKE2b-256 2f9399d8b73a05162d83d4ab0ca0780890b6d7217e26e806a9be7e790c6cd601

See more details on using hashes here.

File details

Details for the file franka_sim-0.3.0-cp310-cp310-macosx_11_0_universal2.whl.

File metadata

File hashes

Hashes for franka_sim-0.3.0-cp310-cp310-macosx_11_0_universal2.whl
Algorithm Hash digest
SHA256 ae80bbf76d59bdce3efe2d09da6cd48de8fdb1051b437aa725fa28a6d6baf62d
MD5 7014be23bcc1cecceb98a6c622f61944
BLAKE2b-256 8c3f0f551407858d6de87f1a29c1f4538e1350a148ae1fd71fbc8ddab710357e

See more details on using hashes here.

File details

Details for the file franka_sim-0.3.0-cp39-cp39-manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for franka_sim-0.3.0-cp39-cp39-manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 1780b8548660a90074efa66869b0e7448dddd6e345d4afbefd2697d32cfb98e2
MD5 ee3ba5b637e15189b60cd2865e388345
BLAKE2b-256 dd99a852f51b1b80a6261094f81440cc7217f78392401a3c5754a1027344eab0

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page