Home

Awesome

Franka ROS Interface Release ROS Version Python 2.7+, 3.6+

Codacy Badge Build Status

A ROS interface library for the Franka Emika Panda robot (real and simulated), extending the franka-ros library to expose more information about the robot, and providing low-level control of the robot using ROS and Python API.

Franka ROS Interface provides utilites for controlling and managing the Franka Emika Panda robot. Contains exposed customisable controllers for the robot (joint position, velocity, torque), interfaces for the gripper, controller manager, coordinate frames interface, etc. Also provides utilities to control the robot using 'MoveIt!' and ROS Trajectory Action & ActionClient. This package also provides almost complete sim-to-real / real-to-sim transfer of code with the Panda Simulator package.

Documentation Page: https://justagist.github.io/franka_ros_interface

This branch requires franka_ros release version 0.7.1 franka_ros_version. (For older franka_ros versions, try building this package from the corresponding branches of this repo. All functionalities may not be available in older versions.)

A more unified ROS Python interface built over this package is available at PandaRobot, which provides a more intuitive interface class that combines the different API classes in this package. Simple demos are also available.

Features

Demo Using PandaRobot API and Panda Simulator

vid Watch video here

vid Watch video here

vid Watch video here

Installation

This branch works with ROS Melodic and ROS Noetic. Build Status

NOTE: Tested on:

ROS VersionPython VersionFranka ROS Branch
Melodic2.7+melodic-devel
Noetic3.6+noetic-devel

Dependencies

Once the above dependencies are installed, the package can be installed using catkin:

   cd <catkin_ws>
   git clone -b v0.7.1-dev https://github.com/justagist/franka_ros_interface src/franka_ros_interface
   catkin build # or catkin_make (catkin build is recommended)
   source devel/setup.bash

Note: Python code in this package is written to be compatible with both Python 2 and 3, so make sure you have the Python future module installed (pip install future (or pip3 install ..)).

After building the package (this is not required if using with simulated robot):

Usage

NOTE: For using this package with Panda Simulator, the following sections are not required; all the required "driver" nodes are started along with the simulation launch file, and the Franka ROS Interface API (as well as PandaRobot API) can be directly used. Follow instructions in the demos section in the Panda Simulator package. See their corresponding source files for usage examples.

The franka.sh environments

Once the values are correctly modified in the franka.sh file, different environments can be set for controlling the robot by sourcing this file.

More information regarding the usage of franka.sh can be found within the franka.sh file.

Starting the Franka ROS Interface 'Driver'

The 'driver' node can be started by running (can only be used if run in 'master' environment - see Environments section above):

    roslaunch franka_interface interface.launch # (use argument load_gripper:=false for starting without gripper)

Available keyword arguments for launch file:

This starts the robot controllers and drivers to expose a variety of ROS topics and services for communicating with and controlling the robot.

Controlling and Monitoring the Robot

Once the 'driver' is running, the robot can be controlled from another terminal by running in 'master' environment (if running in the same machine as 'driver'), or 'remote' environment (if using a different connected computer). The robot can then be controlled and monitored using ROS topics and services (see below to find out about some of the available topics and services), or using the provided Python API (also see PandaRobot).

Example of the robot working with MoveIt can be found by running roslaunch franka_moveit demo_moveit.launch.

Basic usage of the Python API is shown in the demo_interface.py example file. An example of controlling the robot joints with keyboard using direct position control is shown in demo_joint_positions_keyboard.py (read the notes in the file before running the demo. start this demo by running rosrun franka_interface joint_position_keyboard.py).

See documentation for all available methods and functionalities.

See the tests and scripts directories in franka_interface for few more usage examples.

More usage examples can be found in the PandaRobot package.

Some useful ROS topics

Published Topics
ROS TopicData
/franka_ros_interface/custom_franka_state_controller/robot_stategravity, coriolis, jacobian, cartesian velocity, etc.
/franka_ros_interface/custom_franka_state_controller/tip_stateend-effector pose, wrench, etc.
/franka_ros_interface/joint_statesjoint positions, velocities, efforts
/franka_ros_interface/franka_gripper/joint_statesjoint positions, velocities, efforts of gripper joints
Subscribed Topics
ROS TopicData
/franka_ros_interface/motion_controller/arm/joint_commandscommand the robot using the currently active controller
/franka_ros_interface/franka_gripper/[move/grasp/stop/homing](action msg) command the joints of the gripper

Other topics for changing the controller gains (also dynamically configurable), command timeout, etc. are also available.

ROS Services

Controller manager service can be used to switch between all available controllers (joint position, velocity, effort). Gripper joints can be controlled using the ROS ActionClient. Other services for changing coordinate frames, adding gripper load configuration, etc. are also available.

Python API

Most of the above services and topics are wrapped using simple Python classes or utility functions, providing more control and simplicity. This includes direct control of the robot and gripper using the provided custom low-level controllers, MoveIt, and JointTrajectoryAction. Refer README files in individual subpackages.

Documentation

More usage examples in the PandaRobot package.

Related Packages

License

License

Copyright (c) 2019-2021, Saif Sidhik

If you use this software for research, please considering citing using DOI.