O'Reilly logo

Robot Operating System Cookbook by Kumar Bipin

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

How to do it…

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, ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required