Skip to content

PSI-273 Robotiq3f integration#6

Open
nitish3693 wants to merge 3 commits intonoetic-develfrom
PSI-273-RObotiq3F-Integration
Open

PSI-273 Robotiq3f integration#6
nitish3693 wants to merge 3 commits intonoetic-develfrom
PSI-273-RObotiq3F-Integration

Conversation

@nitish3693
Copy link
Copy Markdown
Collaborator

This has not been tested yet. To be tested at customer premises.

nitish3693 and others added 3 commits March 30, 2026 11:33
Updated environment variable name for gripper mode from 'GRIPPER_MODE' to 'gripperMode' and added the function call
@nitish3693 nitish3693 changed the title Psi 273 r obotiq3 f integration PSI-273 Robotiq3f integration Apr 2, 2026
SCISSOR = 3

class Robotiq3FGripperControlNode:
def __init__(self, mode):
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

I like the use of the enum structure here, but on closer inspection the whole Robotiq3FGripperControlNode class might get a fair bit simpler if you swapped it for a class-level dictionary

class Robotiq3FGripperControlNode:
    ROBOTIQ_3F_GRIPPER_MODES = {'BASIC': 0, 'PINCH': 1, 'WIDE': 2, 'SCISSOR': 3}
    def __init__(self, mode):

your current_mode_provider method then becomes:

    def current_mode_provider(self, request):
        response = GetStringResponse()
        response.data = self.ROBOTIQ_3F_GRIPPER_MODES[self.current_mode]
        return response

Your mode_select method would become:

    def mode_select(self, mode):
        gripper_control_msg = Robotiq3FGripperRobotOutput()
        gripper_control_msg.rACT = 1
        gripper_control_msg.rMOD = self.ROBOTIQ_3F_GRIPPER_MODES[self.current_mode]
        self.pub_robotiq_control.publish(gripper_control_msg)

etc...

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

maybe use a better variable name than what I suggested though
ROBOTIQ_3F_GRIPPER_MODES_ENUM_DICT or something

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.

2 participants