File tree Expand file tree Collapse file tree 9 files changed +129
-1
lines changed
extensions/rcs_robotiq2f85 Expand file tree Collapse file tree 9 files changed +129
-1
lines changed Original file line number Diff line number Diff line change 7171 # Python extensions
7272 - rcs_xarm7
7373 - rcs_realsense
74- # - rcs_robotiq
74+ - rcs_robotiq2f85
7575 - rcs_tacto
7676 - rcs_usb_cam
7777 runs-on : ubuntu-latest
Original file line number Diff line number Diff line change @@ -12,4 +12,5 @@ rcs_realsense
1212rcs_usb_cam
1313rcs_tacto
1414rcs_robotics_library
15+ rcs_robotiq2f85
1516```
Original file line number Diff line number Diff line change @@ -30,6 +30,7 @@ RCS comes with several supported extensions:
3030- ** rcs_usb_cam** : Support for generic USB webcams.
3131- ** rcs_tacto** : Integration with the Tacto tactile sensor simulator.
3232- ** rcs_robotics_library** : Integration with the Robotics Library (RL).
33+ - ** rcs_robotiq2f85** : Integration with the Robotiq 2F-85 Gripper.
3334
3435## Creating Extensions
3536
Original file line number Diff line number Diff line change 1+ # RCS Robotiq2F85 Extension
2+
3+ This extension provides support for Robotiq 2F-85 Gripper in RCS.
4+
5+ ## Installation
6+
7+ ``` shell
8+ pip install -ve extensions/rcs_robotiq2f85
9+ ```
10+
11+ Get the serial number of the gripper with this command:
12+ ``` shell
13+ udevadm info -a -n /dev/ttyUSB0 | grep serial
14+ ```
15+
16+ Provide the necessary permission:
17+ ``` shell
18+ chmod 777 /dev/ttyUSB0
19+ ```
20+
21+ ## Usage
22+ ``` python
23+ from rcs_robotiq2f85 import RobotiQGripper
24+
25+ gripper = RobotiQGripper(' <YOUR_SERIAL_NUMBER>' )
26+ gripper.reset()
27+ gripper.shut()
28+ print (gripper.get_normalized_width())
29+ ```
Original file line number Diff line number Diff line change 1+ # RCS Robotiq 2F-85 Gripper Hardware Extension
2+ Extension to use the Robotiq 2F-85 Gripper with rcs.
3+
4+ ## Installation
5+ ``` shell
6+ pip install -ve .
7+ ```
8+
9+ Get the serial number of the gripper with this command:
10+ ``` shell
11+ udevadm info -a -n /dev/ttyUSB0 | grep serial
12+ ```
13+
14+ Provide the necessary permission:
15+ ``` shell
16+ chmod 777 /dev/ttyUSB0
17+ ```
18+
19+ ## Usage
20+ ``` python
21+ from rcs_robotiq2f85 import RobotiQGripper
22+
23+ gripper = RobotiQGripper(' <YOUR_SERIAL_NUMBER>' )
24+ gripper.reset()
25+ gripper.shut()
26+ print (gripper.get_normalized_width())
27+ ```
28+
Original file line number Diff line number Diff line change 1+ [build-system ]
2+ requires = [" setuptools" ]
3+ build-backend = " setuptools.build_meta"
4+
5+ [project ]
6+ name = " rcs_robotiq2f85"
7+ version = " 0.6.2"
8+ description =" RCS RobotiQ module"
9+ dependencies = [
10+ " rcs>=0.6.2" ,
11+ " 2f85-python-driver @ git+https://github.com/PhilNad/2f85-python-driver.git" ,
12+ ]
13+ readme = " README.md"
14+ maintainers = [
15+ { name = " Tobias Jülg" , email = " tobias.juelg@utn.de" },
16+ ]
17+ authors = [
18+ { name = " Tobias Jülg" , email = " tobias.juelg@utn.de" },
19+ ]
20+ requires-python = " >=3.10"
21+ license = { text = " AGPL-3.0-or-later" }
Original file line number Diff line number Diff line change 1+ __version__ = "0.6.2"
Original file line number Diff line number Diff line change 1+ from rcs ._core .common import Gripper
2+ from Robotiq2F85Driver .Robotiq2F85Driver import Robotiq2F85Driver
3+
4+
5+ class RobotiQGripper (Gripper ):
6+ def __init__ (self , serial_number ):
7+ super ().__init__ ()
8+ self .gripper = Robotiq2F85Driver (serial_number = serial_number )
9+
10+ def get_normalized_width (self ) -> float :
11+ # value between 0 and 1 (0 is closed)
12+ return self .gripper .opening / 85
13+
14+ def grasp (self ) -> None :
15+ """
16+ Close the gripper to grasp an object.
17+ """
18+ self .set_normalized_width (0.0 )
19+
20+ def open (self ) -> None :
21+ """
22+ Open the gripper to its maximum width.
23+ """
24+ self .set_normalized_width (1.0 )
25+
26+ def reset (self ) -> None :
27+ self .gripper .reset ()
28+
29+ def set_normalized_width (self , width : float , _ : float = 0 ) -> None :
30+ """
31+ Set the gripper width to a normalized value between 0 and 1.
32+ """
33+ if not (0 <= width <= 1 ):
34+ msg = f"Width must be between 0 and 1, got { width } ."
35+ raise ValueError (msg )
36+ abs_width = width * 85
37+ self .gripper .go_to (opening = float (abs_width ), speed = 150.0 , force = 30.0 )
38+
39+ def shut (self ) -> None :
40+ """
41+ Close the gripper.
42+ """
43+ self .set_normalized_width (0.0 )
Original file line number Diff line number Diff line change @@ -214,4 +214,8 @@ version_files = [
214214 " extensions/rcs_tacto/pyproject.toml:version" ,
215215 " extensions/rcs_tacto/src/rcs_tacto/__init__.py:__version__" ,
216216 " extensions/rcs_tacto/pyproject.toml:\" rcs>=(.*)\" " ,
217+
218+ " extensions/rcs_robotiq2f85/pyproject.toml:version" ,
219+ " extensions/rcs_robotiq2f85/src/rcs_robotiq2f85/__init__.py:__version__" ,
220+ " extensions/rcs_robotiq2f85/pyproject.toml:\" rcs>=(.*)\" " ,
217221]
You can’t perform that action at this time.
0 commit comments