Hello,
It looks like your script is based on the sample moveit_ik_demo.py script described in Chapter 11.20 of ROS By Example Volume 2. I tested your script using the simulated Pi Robot arm after changing the target pose to be a valid pose for Pi Robot and the script works fine. So unfortunately I don't have an answer for you. Perhaps try posting your question to the MoveIt users group and be sure to include your launch file as well.
--patrick
HI Pulkit,
I'm not sure what you mean when you say "when simulating with ros_control". Can you please provide more details?