Open the gripper before each trial

This commit is contained in:
Michel Breyer 2021-12-03 14:10:32 +01:00
parent c0ae6e2333
commit e6e116bf54

View File

@ -25,6 +25,7 @@ class HwNode:
self.scene_config = load_yaml(cfg["scene_file"]) self.scene_config = load_yaml(cfg["scene_file"])
def init_robot_connection(self): def init_robot_connection(self):
self.gripper = PandaGripperClient()
self.switch_to_joint_trajectory_controller = rospy.ServiceProxy( self.switch_to_joint_trajectory_controller = rospy.ServiceProxy(
"controller_manager/switch_controller", SwitchController "controller_manager/switch_controller", SwitchController
) )
@ -39,6 +40,8 @@ class HwNode:
return SeedResponse() return SeedResponse()
def reset(self, req): def reset(self, req):
self.gripper.move(0.04)
# Move to the initial configuration # Move to the initial configuration
self.switch_to_joint_trajectory_controller() self.switch_to_joint_trajectory_controller()
self.moveit.goto(self.scene_config["q0"]) self.moveit.goto(self.scene_config["q0"])