Skip to content

Commit

Permalink
Merge pull request #24 from gautams3/franka_gripper
Browse files Browse the repository at this point in the history
Add ability to control franka gripper
  • Loading branch information
youliangtan authored Feb 14, 2024
2 parents 2099733 + 9143193 commit 8ada212
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
2 changes: 1 addition & 1 deletion serl_robot_infra/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ The HTTP server is used to communicate between the ROS controller and gym enviro
| get_gripper | Return current gripper position |
| close_gripper | Close the gripper completely |
| open_gripper | Open the gripper completely |
| move_gripper | Move the gripper to a given position (Robotiq only) |
| move_gripper | Move the gripper to a given position |
| clearerr | Clear errors |
| update_param | Update the impedance controller parameters |

Expand Down
7 changes: 7 additions & 0 deletions serl_robot_infra/robot_servers/franka_gripper_server.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,5 +34,12 @@ def close(self):
msg.goal.force = 130
self.grippergrasppub.publish(msg)

def move(self, position: int):
"""Move the gripper to a specific position in range [0, 255]"""
msg = MoveActionGoal()
msg.goal.width = float(position / (255 * 10)) # width in [0, 0.1]m
msg.goal.speed = 0.3
self.grippermovepub.publish(msg)

def update_gripper(self, msg):
self.gripper_pos = np.sum(msg.position)

0 comments on commit 8ada212

Please sign in to comment.