Crates.io | franka-interface |
lib.rs | franka-interface |
version | 0.2.0 |
source | src |
created_at | 2021-06-18 12:48:59.014324 |
updated_at | 2022-09-05 07:53:08.953122 |
description | Devlop software for Franka Emika Panda robots in simulation and run it on the real robot |
homepage | |
repository | https://github.com/marcbone/franka-interface |
max_upload_size | |
id | 411765 |
size | 160,353 |
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.
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.
Robots in franka-interface do allow the following control modes:
The robot has access to the following properties:
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.
While it is possible to spawn/connect to multiple robots, it is not possible to control multiple robots at the same time.
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.