Inside the package that we have created in the previous subsection, we will create a new folder named scripts and create a new file named pick_and_place.py there before copying the following code inside of it:
#!/usr/bin/env python import rospy from moveit_commander import RobotCommander, PlanningSceneInterface from moveit_commander import roscpp_initialize, roscpp_shutdown from actionlib import SimpleActionClient, GoalStatus from geometry_msgs.msg import Pose, PoseStamped, PoseArray, Quaternion from moveit_msgs.msg import PickupAction, PickupGoal from moveit_msgs.msg import PlaceAction, PlaceGoal from moveit_msgs.msg import PlaceLocation from moveit_msgs.msg import MoveItErrorCodes from moveit_simple_grasps.msg import GenerateGraspsAction, ...