Skip to content

Interface for simulated and real Panda robots from Franka Emika

License

Notifications You must be signed in to change notification settings

marcbone/franka-interface

Repository files navigation

crates.io GitHub Workflow Status crates.io crates.io docs.rs

franka-interface

franka-interface allows developing software for controlling Franka Emika Panda robots in simulation and then run it on the real hardware.

This is done by providing an abstraction over libfranka-rs and RuBullet.

Example

use franka_interface::experiment::{Experiment, Mode, RealSetup, SimulationSetup};
use franka_interface::RobotArguments;
use std::f64::consts::PI;
use std::path::PathBuf;

struct MySimSetup {}
impl SimulationSetup for MySimSetup {
    fn set_franka_urdf_path(&self) -> PathBuf {
        "path/to/panda.urdf".into()
    }
}
struct MyRealSetup {}
impl RealSetup for MyRealSetup {}
fn main() {
    let mode = Mode::Simulation;
    let mut experiment = Experiment::new(mode, MySimSetup {}, MyRealSetup {});
    let mut robot = experiment.new_robot(RobotArguments {
        name: "franka-ip".to_string(), // IP-Address or hostname of the real Panda (Not needed for the simulation)
        base_pose: None,
        initial_config: None,
    });
    robot.joint_motion(
        0.1,
        [1., PI / 4., 0., -2. * PI / 4., 0., PI / 2., -PI / 4.].into(),
    );
}

This example will spawn the panda robot in RuBullet and perform a join movement. To run the program on the real robot it is necessary to set the mode to Mode::Real. Also, you have to build the program in Release-Mode or with opt-level = 3 to run it on the real robot.

The URDF of the panda can be downloaded from the bullet3 repository. Make sure to also download the mesh files.

Features

Robots in franka-interface do allow the following control modes:

  • Joint position control
  • Cartesian pose control
  • Torque control
  • Joint motions by specifying a goal configuration (see example above)

The robot has access to the following properties:

  • Joint position
  • Joint velocity
  • Cartesian pose
  • Jacobian
  • Mass matrix
  • Coriolis torques
  • Gravity torques

Further, the library is very flexible as the user can define custom mechanisms for interacting with the simulation or the real robot. For example, it is possible to create a camera and get images from the simulation or adding visualization markers inside the simulation. Take a look at the examples in the examples folder.

Limitations

While it is possible to spawn/connect to multiple robots, it is not possible to control multiple robots at the same time.

Licence

This library is copyrighted © 2021 Marco Boneberger

Licensed under the EUPL, Version 1.2 or – as soon they will be approved by the European Commission - subsequent versions of the EUPL (the "Licence");

You may not use this work except in compliance with the Licence. You may obtain a copy of the Licence at:

https://joinup.ec.europa.eu/software/page/eupl

Unless required by applicable law or agreed to in writing, software distributed under the Licence is distributed on an "AS IS" basis WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.

See the Licence for the specific language governing permissions and limitations under the Licence.

About

Interface for simulated and real Panda robots from Franka Emika

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages