19 from geometry_msgs.msg
import PoseStamped
20 from tf.transformations
import quaternion_from_euler
21 from simple_moveit_interface
import get_planning_scene_interface, add_ground, clear_objects
24 def gen_pose(frame_id="/odom_combined", pos=[0,0,0], euler=[0,0,0]):
26 pose.header.frame_id = frame_id
27 pose.header.stamp = rospy.Time.now()
28 pose.pose.position.x, pose.pose.position.y, pose.pose.position.z = pos
29 pose.pose.orientation.x, pose.pose.orientation.y, pose.pose.orientation.z, pose.pose.orientation.w = quaternion_from_euler(*euler)
32 if __name__ ==
'__main__':
33 rospy.init_node(
'load_scene')
34 while rospy.get_time() == 0.0:
pass 44 psi.add_box(
"box", pose, size=(0.3, 0.5, 0.7))
47 psi.add_sphere(
"sphere", pose, radius=(0.3))
54 pose =
gen_pose(pos=[0.6, 0.0, 0.9], euler=[-1.57, 0, 3.14])
55 filename =
'/opt/ros/groovy/stacks/simulator_gazebo/gazebo_worlds/Media/models/mug-test.stl' 56 psi.add_mesh(
"mug", pose, filename)
66 psi.attach_box(
"tray_link",
"box2", pose, (0.1,0.1,0.1))
68 pose =
gen_pose(pos=[0.5, -0.9, 0.9], euler=[-1.57, 0, 3.14])
69 filename =
'/opt/ros/groovy/stacks/simulator_gazebo/gazebo_worlds/Media/models/mug-test.stl' 70 touch_links = [
"sdh_grasp_link",
"sdh_palm_link",
"sdh_finger_11_link",
"sdh_finger_12_link",
"sdh_finger_13_link",
"sdh_finger_21_link",
"sdh_finger_22_link",
"sdh_finger_23_link",
"sdh_thumb_1_link",
"sdh_thumb_2_link",
"sdh_thumb_3_link"]
71 psi.attach_mesh(
"arm_7_link",
"mug", pose, filename, touch_links)
77 psi.remove_attached_object(
"arm_7_link",
"mug")
82 psi.remove_world_object(
"sphere")
def gen_pose(frame_id="/odom_combined", pos=[0, euler=[0)
def get_planning_scene_interface()