Skip to main content

Unified ROS-Python API for Franka Emika Panda robot using Franka ROS Interface

Project description

Panda Robot PyPI ROS Version

Python 2.7, 3.6+ Codacy Badge

A Python interface package built over the Franka ROS Interface package, combining its different classes to provide a unified interface for controlling and handling the Franka Emika Panda robot. Also works directly with Panda Simulator.

The package provides an extensive and unified API for controlling and managing the Franka Emika Robot (and gripper) using pre-defined low-level controllers (position, velocity, torque, joint impedance), MoveIt planners, and JointTrajectory action service.

NOTE: This version requires Franka ROS Interface v0.7.1 ('master'/'v0.7.1-dev' branch) to be installed. For usage with older versions, use Panda Robot branch v0.6.0 from Github.

Features

  • Provides simple-intuitive interface classes with methods to directly and easily control the robot using low-level controllers, MoveIt planners, or Trajectory action client.
  • Get real-time robot state, joint state, controller state, kinematics, dynamics, etc.
  • Provides Kinematics computation (using KDL library). Automatically adjusts computations for the end-effector frames set in Dash or by code.
  • Integrated with gripper control.
  • Manage frames transformation and controller switching using simple utility functions.
  • Works directly on simulated robot when using Panda Simulator providing direct sim-to-real and real-to-sim code transfer.

DOCUMENTATION: https://justagist.github.io/panda_robot/

vid Watch video here

vid Watch video here

Installation

NOTE: This branch should work with ROS Melodic and ROS Noetic. Tested on:

ROS Version Required Python Version
Melodic 2.7+
Noetic 3.6+

The following dependencies have to be met before installing PandaRobot:

  • Requires ROS Melodic or Noetic (preferably the desktop-full version to cover all dependencies such as PyKDL and MoveIt)

  • Franka ROS Interface package. This package should be installed from source (v0.7.1 or master branch) following all instructions in the Installation section. Installing this package correctly would also resolve all the other dependencies for PandaRobot.

Once the dependencies are installed, the package can be installed either from pypi, or by building from source. Note that the installation may be successful even if the above dependencies are not met, but the package cannot be used until the dependencies are installed.

Install with pip

PyPI

pip install panda-robot

NOTE: This will not check for the required ROS dependencies. They have to be installed as described in the previous section.

Build from source

If you want to install the package from source, you can either clone this repository and run python setup.py install, or build it as a catkin package in your ROS workspace. To build as catkin package:

  • Clone this repo to src folder of your catkin workspace.

  • In catkin workspace root, run:

 catkin build
 source devel/setup.bash

Note: 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).

Usage

Note: If using with a real physical Franka Emika Panda robot, the franka_ros_interface 'driver' should be running in the 'master' environment in one terminal (See Franka ROS Interface instructions for details). Then, any code which uses PandaRobot or Franka ROS Interface should be run in 'master' or 'remote' environment (as appropriate). When using with Panda Simulator, this package can be used directly without the need for any specific environment as long as this package, the simulator package, and Franka ROS Interface packages are in the same ROS workspace, and correctly sourced.

Example: Testing interface in terminal

>> python # or `python3` # start interactive python session; make sure the correct ros workspace is sourced.
>> import rospy
>> from panda_robot import PandaArm
>> rospy.init_node("panda_demo") # initialise ros node

>> r = PandaArm() # create PandaArm instance

>> r.move_to_neutral() # moves robot to neutral pose; uses moveit if available, else JointTrajectory action client

>> pos,ori = r.ee_pose() # get current end-effector pose (3d position and orientation quaternion of end-effector frame in base frame)

>> r.get_gripper().home_joints() # homes gripper joints
>> r.get_gripper().open() # open gripper

>> r.move_to_joint_position([-8.48556818e-02, -8.88127666e-02, -6.59622769e-01, -1.57569726e+00, -4.82374882e-04,  2.15975946e+00,  4.36766917e-01]) # move robot to the specified pose

>> r.move_to_cartesian_pose(pos,ori) # move the robot end-effector to pose specified by 'pos','ori'

See script (test/test_pos_controllers.py) to see how the robot can be controlled using low-level joint controllers.

See script (scripts/env.py), and run it interactively (python -i env.py) for testing other available functionalities.

See other files in the tests and demos directories for more usage examples.

Learn about all available functionalities in the Documentation.

License

License

Copyright (c) 2019-2021, Saif Sidhik

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

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

panda_robot-0.0.5.tar.gz (17.9 kB view details)

Uploaded Source

Built Distributions

panda_robot-0.0.5-py3-none-any.whl (22.6 kB view details)

Uploaded Python 3

panda_robot-0.0.5-py2-none-any.whl (22.6 kB view details)

Uploaded Python 2

File details

Details for the file panda_robot-0.0.5.tar.gz.

File metadata

  • Download URL: panda_robot-0.0.5.tar.gz
  • Upload date:
  • Size: 17.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/4.2.0 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.61.0 CPython/3.6.9

File hashes

Hashes for panda_robot-0.0.5.tar.gz
Algorithm Hash digest
SHA256 3b4471fa228151cdb8c06e5744530de5c4b159752ee01e5973d1d52b036e09d1
MD5 28f066665ea6b1a6a401c1242bec06e3
BLAKE2b-256 37999abb7c527f856183fb14701608fb4500b9814f6c045ebdcbae85d138e473

See more details on using hashes here.

File details

Details for the file panda_robot-0.0.5-py3-none-any.whl.

File metadata

  • Download URL: panda_robot-0.0.5-py3-none-any.whl
  • Upload date:
  • Size: 22.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/4.2.0 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.61.0 CPython/3.6.9

File hashes

Hashes for panda_robot-0.0.5-py3-none-any.whl
Algorithm Hash digest
SHA256 00208a7797c4780e965ef8d71adeaa986dcb07e0bd730338661f7aaf75ddf4ee
MD5 fc657ede27508300906bba2fb3cd7410
BLAKE2b-256 217e9d95bca66b2b01b6b4a8a0411fcf19d3dc665bee08e4267847245036166b

See more details on using hashes here.

File details

Details for the file panda_robot-0.0.5-py2-none-any.whl.

File metadata

  • Download URL: panda_robot-0.0.5-py2-none-any.whl
  • Upload date:
  • Size: 22.6 kB
  • Tags: Python 2
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/4.2.0 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.61.0 CPython/3.6.9

File hashes

Hashes for panda_robot-0.0.5-py2-none-any.whl
Algorithm Hash digest
SHA256 1c4617e783f02346242abaedd3b3cf029f1d4ae0cca12af8c98a2298a3d2fa80
MD5 0be075228338b9f3442a038c90d4af74
BLAKE2b-256 b1b686748b0d1b55a26db631e0f748d1829c913737e8c5f7e761ff73cb65da53

See more details on using hashes here.

Supported by

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