Skip to content

Abstract class for grippers to support hardware-agnostic applications - #64

Open
hello-garv wants to merge 17 commits into
mainfrom
feature/abstract-class-for-easy-gripper-swapping
Open

Abstract class for grippers to support hardware-agnostic applications#64
hello-garv wants to merge 17 commits into
mainfrom
feature/abstract-class-for-easy-gripper-swapping

Conversation

@hello-garv

Copy link
Copy Markdown
Contributor

Summary:

Added a new gripper metadata object that stores gripper-specific properties like finger joint and link names, subsystem client, and unit conversions. The gripper metadata is used by RobotJoints to return robot-specific properties without needing to hardcode the gripper name.

@hello-robot-shehab hello-robot-shehab left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I like the idea behind this!

A few thoughts for later discussion:

  1. Can gripper_metadata.py just replace gripper_conversion.py? It looks like they have similar methods
  2. Need to port gripper status and gamepad teleop to use this abstracted and conversion logic.

Comment thread stretch4_body/utils/gripper_metadata.py Outdated

@property
@abstractmethod
def subsystem_range(self) -> tuple[float, float]:

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it possible to rename subsystem to servo or motor to keep the naming the same as the current implementation in gripper_conversion.py?

Comment thread stretch4_body/utils/gripper_metadata.py Outdated
@abstractmethod
def finger_joints(self) -> List[str]:
"""List of finger joint names in URDF"""
pass

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Might be cleaner to throw NotImplementedError instead of a None return, in addition to the abstract decorator.

joints.append(RobotJoints.gripper)
return joints

def to_subsystem_units(self, position: float) -> float:

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It would be helpful to have one-line docstrings for the conversion methods like this one, or to add associated documentation for what each unit type means.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this would be similar to the docstrings in the GripperMetadata(ABC)

@hello-lamsey

Copy link
Copy Markdown
Contributor

I really like this design - it appears to be straightforward to instantiate and register a new custom gripper in the future.

@hello-binit

Copy link
Copy Markdown
Contributor

@hello-garv Does this need my review? Do you have testing instructions?

@hello-binit

Copy link
Copy Markdown
Contributor

@hello-garv would it make sense to add a end_of_arm.gripper attribute to access the gripper?

See Shehab's comment here: #92 (comment)

hello-garv and others added 8 commits August 19, 2026 12:47
* Added support for custom user tools in ~/stretch_user/user_tools

* Support for gamepad, collision and better params loading

* Fixed rebase artifact not allowing robot client to use custom tool

* Fixed the user_tools filenames so they are the same across custom tools

* stretch_gripper_home and _jog now work

* custom tools now have pose models

* Fixed bug with gamepad teleop not using CommandGripperPosition for custom tools. Added support for subsystem_to_urdf conversion

* Fix user-defined end-of-arm tools in teleop, motion, and collision (#134)

* Resolve a custom tool's gamepad command class by convention and disable gripper teleop when none is defined

* Treat a joint with req_calibration disabled as homed so its soft motion limits resolve instead of raising a TypeError

* Cache user tool collision mappers with retry on failure and map raw status in one place

* Respect a custom gripper client's own pct convention instead of overwriting it with the Stretch Gripper formula

* Some modifications from the merged PR

* Fixed WristJointClient.status recursion bug

* Cleaned up gamepad teleop logic for loading custom tools

* Fixed auto-detect not working with custom tools

---------

Co-authored-by: Bharadwaj Chukkala <bharadwaj@hello-robot.com>
@hello-garv
hello-garv force-pushed the feature/abstract-class-for-easy-gripper-swapping branch from 1e08af1 to 672e878 Compare August 19, 2026 16:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants