# how to open pr2 gripper with moveit_commander

Hi, I cannot get move group to open gripper of pr2 eventhough I can successfully move the head torso and other parts of pr2 using the MoveGroupCommander. See the code below with two basic functions: move_head and open_gripper. This does not work when I try to open the gripper's hand. Note that the gripper's hand closes when it is opened and I set all the joint values to zero. But I can't get it to open when the gripper's hands are closed.

#!/usr/bin/python
# coding: utf-8
import sys

import moveit_commander
import rospy
import roscpp

jv = mgc.get_current_joint_values()
jv[0] = 0.0
jv[1] = 0.5
mgc.set_joint_value_target(jv)
p = mgc.plan()
mgc.execute(p)

def open_right_hand():
mgc = moveit_commander.MoveGroupCommander("right_gripper")
jv = mgc.get_current_joint_values()
jv = [1.0, 1.0, 0.477, 0.477, 0.477, 0.477, 0.04]
mgc.set_joint_value_target(jv)
p = mgc.plan()
mgc.execute(p)

if __name__ == "__main__":

moveit_commander.roscpp_initialize(sys.argv)
rospy.init_node(node_name)

rc = moveit_commander.RobotCommander()