The Robotiq2F85Driver
is a Python module that provides a driver for interacting with the Robotiq 2F-85 gripper. It includes functionalities for finding the gripper"s serial port, activating/deactivating the gripper, reading its status, and controlling its movements.
Compared to existing packages, this one is different in the following ways:
- It is independant from ROS, you only need to import the Python module to use the gripper.
- It is a pure Python implementation, no need to compile any C++ code.
- It detects the gripper"s serial port based on its serial number.
- It provides a function to account for the motion of the fingertips when planning grasps.
Make sure you have Python 3.x installed. After cloning the repository, you can install the package using the following command:
pip install .
executed from the root directory of the repository.
To allow access to the serial connection, you will also need to add make your user a member of the dialout
group with
sudo adduser $USER dialout
and logout/login to refresh the membership.
from Robotiq2F85Driver import Robotiq2F85Driver
# Initialize the driver with the gripper"s serial number
gripper = Robotiq2F85Driver(serial_number="DAK1RLYZ")
# Reset the gripper
gripper.reset()
# Move the gripper to fully open position (opening = 85 mm)
# The motion is done at 150 mm/s with a force of up to 235 Newtons.
gripper.go_to(opening=85, speed=150, force=235)
# Get the current gripper opening
print(gripper.opening)
In contrast to most existing packages, this driver finds the serial port of a device with a specific serial number so you dont need to worry about the port number changing when you plug the device in. This is done by iterating over all /dev/ttyUSB*
devices and finding the one with the given serial number.
Ever had the gripper collide with the table when closing onto a small object? Not anymore! This driver provides a function that can be used to account for the motion of the fingertips when planning grasps.
Due to how the gripper is designed, the fingertips move away from the gripper"s base frame when the gripper closes. This can be inconvenient when the Tool Center Point (TCP) is on the fingertips and needs to be precisely positioned to accurately grasp small objects. The tcp_Z_offset
function calculates the distance along the gripper Z+ axis that the TCP will move when the gripper goes from its current opening to the desired opening. This function is particularly useful when planning robotic movements for grasping objects. Knowing the offset allows the robot to compensate for the gripper"s movement and position the TCP precisely at the desired location before grasping an object of known thickness.
Let
be defined in millimeters, then
and
is the distance along the Z+ axis of the base frame between the base frame and the TCP frame.
Noting that
we get
that provides an expression for the position of the TCP frame as a function of the opening and pad thickness (both in millimeters).
-
opening: float
: Current gripper opening in millimeters. -
current: float
: Current in milliamps. -
is_activated: bool
: Check if the gripper is activated. -
is_moving: bool
: Check if the gripper is currently moving. -
object_detected: bool
: Check if an object is detected by the gripper. -
in_fault: bool
: Check if the gripper is in a fault state.
Currently assumes that Linux is used as the operating system, which could be easily extended to support other operating systems.
This project is licensed under the MIT License.