Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018 import rospy
00019 import roslib
00020 from tf.transformations import *
00021 from simple_moveit_interface import *
00022
00023
00024 def gen_pose(frame_id="/odom_combined", pos=[0,0,0], euler=[0,0,0]):
00025 pose = PoseStamped()
00026 pose.header.frame_id = frame_id
00027 pose.header.stamp = rospy.Time.now()
00028 pose.pose.position.x, pose.pose.position.y, pose.pose.position.z = pos
00029 pose.pose.orientation.x, pose.pose.orientation.y, pose.pose.orientation.z, pose.pose.orientation.w = quaternion_from_euler(*euler)
00030 return pose
00031
00032 if __name__ == '__main__':
00033 rospy.init_node('spawn_grasp_object')
00034 while rospy.get_time() == 0.0: pass
00035
00036 psi = get_planning_scene_interface()
00037 rospy.sleep(1.0)
00038
00039
00040 object_name = "pringles"
00041 pose = gen_pose(frame_id="base_footprint", pos=[-0.7, 0.5, 1.05], euler=[0, 0, 0])
00042 filename = roslib.packages.get_pkg_dir('cob_grasp_generation')+'/files/meshes/'+object_name+'.stl'
00043
00044 psi.add_box(object_name, pose, size=(0.1, 0.1, 0.1))
00045
00046 rospy.sleep(1.0)
00047