Some time ago, I developed a straightforward ROS 2 grasp service. The purpose of this service is to move along a sequence of points, close the gripper, pause, return to home positions, and open the gripper. While it may not be the most flexible solution, it is effective for scenarios that require a simple and direct configuration.
Simple config looks like this:
grasp_service:
ros__parameters:
joints_controller_name: joint_trajectory_controller
joints_names:
- joint1
- joint2
- joint3
- joint4
positions_to_target_list:
- first_pos
- second_pos
positions_to_target:
first_pos:
positions: [0.50, 0.0, 0.0, 0.0]
time_to_target: 2
second_pos:
positions: [-0.50, 0.0, 0.0, 0.0]
time_to_target: 4
positions_to_home_list:
- first_pos
positions_to_home:
first_pos:
positions: [0.50, 0.0, 0.0, 0.0]
time_to_target: 2
time_to_wait_on_target: 5
gripper_controller_name: gripper_action_controller
gripper_close: -0.01
gripper_open: 0.019
Link to the package with demo:
ros2_grasp_service
You can also check it on youtube: